We all know, that captcha reduces the number of comments, because people are lazy to enter it. In that case I removed captcha in my blog, but few days later I found hundreds spam comments... This prompted me to make a system to protect against spam without the use of captcha.
I wrote it for my blog, but decided to share it to all Diferior users. It adds an invisible input to a comment form in posts and downloads.
5a and 5b must be without <?php ?> diferior forum automatically adds these symbols.
1. Upload dif_spam_comments.sql to your database using PhpMyAdmin. This will create table for storing all spam comments in database.
2. Paste this code to tpl_resources/skio/style/style.css .comment_inv
{
visibility:hidden;
display:none;
} This will make input invisible.
3. Paste this to your conf.php file # Use captcha? (if set to false, then will be used invisible input, to help detect spam)
define ( 'USE_CAPTCHA', false );
4. Open templates/skio/read.tpl.php and templates/skio/file.tpl.php In both files find lines: <div>
{img src="captcha/s/`$smarty.now`.jpg"|link alt="tpl_user_register_captcha"|translate onclick="javascript:reload_image(this)"}
<input type="text" name="captcha" value="" />
</div>
Blogs are always a main source of getting accurate information and provide you the handy viagra results; you can get instant and reliable information which surely helps you in any field of your concern. I am post graduate in IT and HR. engagement rings These days I am doing preparation of different online certifications and I found testking guide is the best helping source which is providing 100% authentic material. I also spend my extra time in surfing internet, listening music and playing games. After my exams I would like to join your group.buy phentermine
Forum posts: 2
I wrote it for my blog, but decided to share it to all Diferior users. It adds an invisible input to a comment form in posts and downloads.
Before doing any changes, backup all files.
Download Link
5a and 5b must be without <?php ?> diferior forum automatically adds these symbols.
1. Upload dif_spam_comments.sql to your database using PhpMyAdmin. This will create table for storing all spam comments in database.
2. Paste this code to tpl_resources/skio/style/style.css
.comment_inv { visibility:hidden; display:none; }
This will make input invisible.
3. Paste this to your conf.php file
# Use captcha? (if set to false, then will be used invisible input, to help detect spam) define ( 'USE_CAPTCHA', false );
4. Open templates/skio/read.tpl.php and templates/skio/file.tpl.php
In both files find lines:
<div> {img src="captcha/s/`$smarty.now`.jpg"|link alt="tpl_user_register_captcha"|translate onclick="javascript:reload_image(this)"} <input type="text" name="captcha" value="" /> </div>
And replace them with:
<div> {if $smarty.const.USE_CAPTCHA} {img src="captcha/s/`$smarty.now`.jpg"|link alt="tpl_user_register_captcha"|translate onclick="javascript:reload_image(this)"} <input type="text" name="captcha" value="" /> {else} <input class="comment_inv" type="text" name="inv" value="" maxlength="100" /> {/if} </div>
5. Now open functions/comments.php file find post function (136 line). We need edit just this function!
a)
Find line:
$captcha_p = trim ( $_POST [ 'captcha' ] );
replace it with
if( USE_CAPTCHA ) $captcha_p = trim ( $_POST [ 'captcha' ] ); else { if( (!isset($_POST['inv'])) OR (!empty($_POST['inv']))) $table = 'dif_spam_comments'; }
b)
Find
$err2 = $user -> validate_captcha ( $captcha_p );
and replace with
$err2 = (USE_CAPTCHA)?$user -> validate_captcha ( $captcha_p ):array();
c)
Find
else { throw new error ( 'Invalid comment table.' ); }
and replace with
elseif ( $table == 'dif_spam_comments' ) { //do nothing } else { throw new error ( 'Invalid comment table.' ); }
Now go drink some beer.
Added downloads: 2
Comments: 18
Forum posts: 573
Forum posts: 378