Avoiding Spam in Joomla
Thursday, September 21st, 2006If you own or administer a Joomla/Mambo site and are frequently being attacked by spammers in your forum/guestbook/gallery, com_securityimages may be the solution for you. There are some instructions here to show how to configure it to work with joomlaboard/simpleboard. Basically, you just call the security framework at insertion and validation time. To add anti-spam support for zOOm gallery (com_zoom), just edit the file /components/com_zoom/www/view.php and find the following lines:
<input type="hidden" name="isAdmin" value="<?php echo $zoom->_isAdmin; ?>" /> </td> </tr> <tr> <td> </td> <td><input type="submit" name="submit" value= "<?php echo _ZOOM_ADD;?>" class="button" /></td>
Replace this lines with:
<input type="hidden" name="isAdmin" value=
"<?php echo $zoom->_isAdmin; ?>" />
</td>
</tr>
<?php include ($mosConfig_absolute_path.
'/administrator/components/com_securityimages/client.php'); ?>
<tr>
<td class="sb_leftcolumn">Anti-spam:
</td>
<td>
<?php echo insertSecurityImage("security_refid"); ?><br/>
<?php echo getSecurityImageText("security_try"); ?></td></tr>
<tr>
<td> </td>
<td><input type="submit" name="submit" value=
"<?php echo _ZOOM_ADD;?>" class="button" /></td>
Now find the lines:
if ($zoom->_gallery->_images[$key]->isMember($popup)) {
if ($submit === true) {
$uname = $zoom->getParam($_REQUEST, 'uname');
$comment = ($zoom->getParam($_REQUEST, 'comment'));
$zoom->_gallery->_images[$key]->addComment($uname,$comment);
}
and replace them with:
if ($zoom->_gallery->_images[$key]->isMember($popup)) {
include ($mosConfig_absolute_path.
'/administrator/components/com_securityimages/server.php');
$checkSecurity = checkSecurityImage($security_refid, $security_try);
if ($submit === true) {
if ($checkSecurity==false){
echo "";} else{ $uname = $zoom->getParam($_REQUEST, 'uname'); $comment = ($zoom->getParam($_REQUEST, 'comment')); $zoom->_gallery->_images[$key]->addComment($uname,$comment); }}
And that’s it! You should now have captcha images showing up on your zOOm gallery comment boxes, avoind the huge ammount of spam that this component is usually victim.
This code was implemented in this website: Carapecos Online – Photo Gallery and is currently using SecurityImages component 4.2.1
Popularity: 17% [?]








