Additional anti-spam feature in Gbook module
Previous article Next articleThe 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:
{if $showform == '1'}
{Gbook|replace:"{root_url}/guestbook":"{root_url}/guestbook?showform=1" action='form'}
{else}
<p><a href="{$page_alias}?showform=1" rel="nofollow">Show the form</a></p>
{/if}
{Gbook}
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 ( {$smarty.now|date_format:"%e"} is now 22 ) as value, so it changes every day... Let your imagination run wild :)
Working example
Comment Form
1 Comment
Great guide, used it for a CGBetterForms form. What is the:
replace:"{root_url}/guestbook":"{root_url}/guestbook?showform=1"
supposed to do though?