Avoiding Spam in Joomla
If 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: 22% [?]
Related Entries:








January 13th, 2007 at 2:23 am
Hi! Very nice site! Thanks you very much! WkYi7zgWeXt
June 16th, 2007 at 11:02 am
On what ZOOM version is your solution based? In my version the view.php does not contain the code you specify. Instead the following is listed:
“if ($zoom->_CONFIG['commentsOn']) {$prefix = ZMG_Template_View::createViewBlock(_ZOOM_COMMENTS);
ZMG_Template_View::showCommentsBox($zoom->_CONFIG['viewtype'], $dir_prefix, $key);
if (($zoom->_CONFIG['anonymous_comments']) || (!$zoom->_CONFIG['anonymous_comments'] && !empty($my->username))){
if ($zoom->_CONFIG['popUpImages']) {
$cmt_action = $url_prefix;}
else {$cmt_action = sefRelToAbs($url_prefix);}
ZMG_Template_View::showCommentsForm($zoom->_CONFIG['viewtype'], $cmt_action, $dir_prefix, $popup, $key);}
ZMG_Template_View::finishViewBlock($zoom->_CONFIG['comments_state'], $prefix);} //END if commentsOn?”
June 16th, 2007 at 11:03 am
Forgot: I use version 2.5.1 RC4 wk08
June 22nd, 2007 at 10:58 pm
Hello! Good Site! Thanks you! qciluyzicnu
June 23rd, 2007 at 1:18 pm
looks good, but that code is not presemnt in my view.php
June 27th, 2007 at 5:50 am
Thanks for this site!
[url=http://qea.com/resources/phentermine_online.html]phentermine online[/url]
November 30th, 2008 at 3:21 pm
It’s not working.
It says the comment has been added but the comment box is empty.