Page 1 of 1

diallowing names

Posted: Tue May 08, 2007 12:19 am
by Bob42
Script URL:
Version of script: 1.5
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution: disallowing names

Write your message below:

Hi,
Is it possible to disallow certain names that can be used when a person signs the guestbook? I'm hoping there's an addon that will let me do this.
Thanks.

Posted: Sat May 12, 2007 11:34 pm
by Klemen
Hi,

You'd need to add something like this to the settings.php file:

Code: Select all

$settings['ban_names']=array(
'your name',
'john doe',
'some name',
);
. Make sure all names are in lower-case and NOT UPPER-CASE.

Then in gbook.php just ABOVE line 92

Code: Select all

if (empty($name))
add this:

Code: Select all

if (in_array(strtolower($name),$settings['ban_names'])) {
	printSign($name,$from,$email,$url,$comments,$sign_nosmileys,$sign_isprivate,'Banned name');
}