Additional anti-spam feature in Gbook module

  Previous article Next article  

The Gbook guestbook module for CMS Made Simple™ has a built-in anti-spam feature. It uses the b8 statistical (Bayesian) spam filter. At one of my websites where I use the GBook module I noticed spammers are getting more clever trying to by-pass the filter and it leaves me more work checking ham or spam...

I found a really simple method to hide and show the form. When there is no form, a bot can't fill it in...

  How to use

Open the guestbook content page in the Admins page-editor and set WYSIWYG off in the Options tab.
Replace the GBook tags with the following code:

{$showform = $smarty.get.showform|default:''}

{if $showform == '1'}
  {Gbook|replace:"{root_url}/guestbook":"{root_url}/guestbook?showform=1" action='form'}
  <p><a href="{$page_alias}?showform=1" rel="nofollow">Show the form</a></p>


Note: Change the URL's in the code above to the one of your guest book page!

Basically it takes these steps:
  • Read the "showform" parameter from page URL
  • Only show the form when having the showform parameter in the page URL and the value is 1
  • If not show the message button, when clicked it reloads the page *with* the showform parameter
  • Show the current guest book entries

Afterwards you can always change the parameter name and/or the value. Or even set the date ( {$|date_format:"%e"} is now 27 ) as value, so it changes every day... Let your imagination run wild :)

  Working example

Show the form »

Buy Me A Coffee

  Comment Form


Click here to open the form



Buy Me A Coffee

CMS Made Simple - Tutorials, Tips and Tricks - CMSMS

Additional anti-spam feature in Gbook module

  Article optimized for CMSMS 2.x

  Last tested in: CMSMS 2.2.19
  Last updated: 17-11-2020
  Comments: 13

Buy Me A Coffee


Ads help me to help you! Thanks!

Ads help me to help you! Buy products from these advertisers!