Extension talk:Guestbook

Feature Request
Hey, I was wondering if there was a way to change the name of the guestbook on my personal wiki page. I'm trying to make an endorsement page for an organization that I run, and want to use the guestbook extension as an endorsement page, however I would like to change then mane from "guestbook" to "endorsements"
 * No problem, just do it ;)--Mcmilk 21:56, 17 April 2010 (UTC)

the book on each talk page
This is great, do you think it could be set up to make a questbook for each talk page?
 * Sorry, I don't know how to do that --Mcmilk (talk) 08:20, 21 June 2012 (UTC)

Blocking users with the built-in $wgUser->isBlocked function
To ensure blocked users or IP addresses cannot edit/post in the guestbook you can add the following few easy lines to 2 files in the extensions/guestbook folder. I used version 0.13 of the extension.

First backup the $wiki/extensions/guestbook/gbook.php and gbook.i18n-en.php files.

Then open gbook.php within a text editor and replace the following block of text:

function ParseUserInput { require_once("captcha-class.php"); global $wgRequest, $want_captcha; /* we are called the first time */

with the following block of text:

function ParseUserInput { require_once("captcha-class.php"); global $wgRequest, $want_captcha; // following if statement was added by moorej 31st Aug 2010 to ensure blocked users cannot use guestbook global $wgUser; if ( $wgUser->isBlocked ) { $this->error($this->text("err_blocked")); return; }  /* we are called the first time */

Then open gbook.i18n-en.php and replace the following block of text:

'err_captcha'    => "Sorry, the captcha is epmty!" );

with the following block of text:

'err_captcha'    => "Sorry, the captcha is epmty!", 'err_blocked'    => "Sorry, you are not permitted to edit this guestbook!" );

Upload the files to the server.

Test. You can block your own IP address and Username for 2 hours as part of the test unless you have multiple IPs to play with. To block users and IPs browse to your Special:Block page. Any questions email me at james at futureofmankind dot co dot uk

Blocking spam specified by $wgSpamRegex global variable
Hi I have modified this extension to reject guestbook spam. It will now compare the name, entry, origin, email address and homepage to the $wgSpamRegex global variable that has values usually defined in the localsettings.php file. If there is a match then the submitted guestbook entry will be rejected and a message displayed at the top saying "Sorry, no spam permitted!".

If you want to do the same then simply edit gbook.php and after the following code segment...

 if ($this->gbEntry == "") { $this->error($this->text("err_entry")); return; }

...insert the following code...

 global $wgSpamRegex; if ( $wgSpamRegex ) { if ( preg_match( $wgSpamRegex, $this->gbName ) || preg_match( $wgSpamRegex, $this->gbEntry ) || preg_match( $wgSpamRegex, $this->gbOrigin ) || preg_match( $wgSpamRegex, $this->gbEmail ) || preg_match( $wgSpamRegex, $this->gbHomepage ) ) { $this->error($this->text("err_spam")); return; } }
 * 1) 05/10/2010 MooreJ - Run everything through $wgSpamRegex if it has been specified

Then you can specify your error message in the gbook.i18n-en.php by locating the following line...

 'err_captcha'    => "Sorry, the captcha is empty!"

...then insert the following line just after it...

 'err_spam'	 => "Sorry, no spam permitted!"

So the last 9 lines or so might look like this:

 'err_name'       => "Sorry, your name is needed!", 'err_entry'      => "Sorry, your entry seems empty!", 'err_noentry'    => "Sorry, this entry doesn't exist!", 'err_captcha'    => "Sorry, the captcha is empty!", 'err_spam'	 => "Sorry, no spam permitted!" );

?>