[7.x] Stop Forum Spam Integration v0.2 (Template) - 02/17/2011 5:42 AM
This Template Hack is no longer supported, instead please see the Stop Forum spam Integration (Modification) thread.
Author: Gizmo (James of VNC Web Design)
Requirements:
About:
This modification will allow you to check your users (via the "Edit User" function in the Control Panel) and new signups (via the "Registration Queue") against the Stop Forum Spam databases.
When a spammer is identified a Red/Bold ! will display next to the field, clicking this ! will allow you to view the associated data on Stop Forum Spam.
Demo:
See the screen captures attached to this thread for a demo.
The Modification
In templates/default/admin/membermanage.tmpl
Find:
Add Under:
Find:
Replace With:
In templates/default/admin/showuser.tmpl
Find:
Add Under:
Find:
Replace With:
Find:
Replace With:
Find:
Replace With:
To be able to report users
In templates/default/admin/showuser.tmpl
Find:
Add Under (be sure to add your API Key to the API-Key section below):
Find:
Replace With:
To detect and deny detected spammers when they register (via IP):
In templates/default/newuser_signup.tpl
Find:
Add Under:
Find:
Add Under:
NOTE: StopForumSpam.com only allows 5k lookups per day; thus, you should refrain from attempting to implement this code on pages which would quickly hit this limit (such as adding searches for all types of data on the search users page).
Author: Gizmo (James of VNC Web Design)
Requirements:
- Valid UBB.Threads 7.0 install and license
- PHP5+, PHP4 is not supported.
- To REPORT users you will need an API Key from Stop Forum Spam.
About:
This modification will allow you to check your users (via the "Edit User" function in the Control Panel) and new signups (via the "Registration Queue") against the Stop Forum Spam databases.
When a spammer is identified a Red/Bold ! will display next to the field, clicking this ! will allow you to view the associated data on Stop Forum Spam.
Demo:
See the screen captures attached to this thread for a demo.
The Modification
In templates/default/admin/membermanage.tmpl
Find:
Code
for($i=0;$i<sizeof($que);$i++) { //UBBTREMARK
Add Under:
Code
$xml_string = file_get_contents("http://www.stopforumspam.com/api?email=". $que[$i]['email']);
$xml = new SimpleXMLElement($xml_string);
if($xml->appears == 'yes'){
$spammer_real_email = " <a href=\"http://stopforumspam.com/search/?q=". $que[$i]['email'] ."\" target=\"_blank\" style=\"color: #FF0000; font-weight: bold;\">!</a>";
} else {
$spammer_real_email = "";
}
$xml_string = file_get_contents("http://www.stopforumspam.com/api?ip=". $que[$i]['ip']);
$xml = new SimpleXMLElement($xml_string);
if($xml->appears == 'yes'){
$spammer_reg_ip = " <a href=\"http://stopforumspam.com/ipcheck/". $que[$i]['ip'] ."\" target=\"_blank\" style=\"color: #FF0000; font-weight: bold;\">!</a>";
} else {
$spammer_reg_ip = "";
}
Find:
Code
<br />{$que[$i]['uname']}<br />{$que[$i]['email']}<br />{$que[$i]['ip']}
Replace With:
Code
<br />{$que[$i]['uname']}<br />{$que[$i]['email']}{$spammer_real_email}<br />{$que[$i]['ip']}{$spammer_reg_ip}
In templates/default/admin/showuser.tmpl
Find:
Code
$forum_link = make_ubb_url("", "", false);
Add Under:
Code
$xml_string = file_get_contents("http://www.stopforumspam.com/api?email=". $email);
$xml = new SimpleXMLElement($xml_string);
if($xml->appears == 'yes'){
$spammer_real_email = " <a href=\"http://stopforumspam.com/search/?q=". $email ."\" target=\"_blank\" style=\"color: #FF0000; font-weight: bold;\">!</a>";
} else {
$spammer_real_email = "";
}
$xml_string = file_get_contents("http://www.stopforumspam.com/api?ip=". $regip);
$xml = new SimpleXMLElement($xml_string);
if($xml->appears == 'yes'){
$spammer_reg_ip = " <a href=\"http://stopforumspam.com/ipcheck/". $regip ."\" target=\"_blank\" style=\"color: #FF0000; font-weight: bold;\">!</a>";
} else {
$spammer_reg_ip = "";
}
if($lastpostip != "") {
$xml_string = file_get_contents("http://www.stopforumspam.com/api?ip=". $lastpostip);
$xml = new SimpleXMLElement($xml_string);
if($xml->appears == 'yes'){
$spammer_last_ip = " <a href=\"http://stopforumspam.com/ipcheck/". $lastpostip ."\" target=\"_blank\" style=\"color: #FF0000; font-weight: bold;\">!</a>";
} else {
$spammer_last_ip = "";
}
} else {
$spammer_last_ip = "";
}
Find:
Code
<input type="text" name="email" value="$email" id="email" />
Replace With:
Code
<input type="text" name="email" value="$email" id="email" />$spammer_real_email
Find:
Code
$regdate - $regip
Replace With:
Code
$regdate - $regip$spammer_reg_ip
Find:
Code
$lastpost - $lastpostip
Replace With:
Code
$lastpost - $lastpostip$spammer_last_ip
To be able to report users
In templates/default/admin/showuser.tmpl
Find:
Code
$forum_link = make_ubb_url("", "", false);
Add Under (be sure to add your API Key to the API-Key section below):
Code
if($lastpostip != "") {
$report_spammer = "http://www.stopforumspam.com/add.php?username=". $lname ."&ip_addr=". $lastpostip ."&email=". $email ."&api_key=API-KEY";
} else {
$report_spammer = "http://www.stopforumspam.com/add.php?username=". $lname ."&ip_addr=". $regip ."&email=". $email ."&api_key=API-KEY";
}
Find:
Code
$lname
Replace With:
Code
$lname (<a href="$report_spammer" target="_blank" style="color: #FF0000;">Report Spammer</a>)
To detect and deny detected spammers when they register (via IP):
In templates/default/newuser_signup.tpl
Find:
Code
{* Script Version 7.5.6 *}
Add Under:
Code
{php}
$xml_string = file_get_contents("http://www.stopforumspam.com/api?ip=". $_SERVER["REMOTE_ADDR"]);
$xml = new SimpleXMLElement($xml_string);
if ($xml->appears == 'yes') {
{/php}
{$tbopen}
<tr>
<td class="tdheader" colspan="2">
Spammer Detected
</td>
</tr>
<tr>
<td colspan="2" class="alt-2">
At this time your registration can not be continued. Your IP address has been flagged as that of a known spammer/spambot via the <a href="http://stopforumspam.com/ipcheck/{$smarty.server.REMOTE_ADDR}" target="_blank">Stop Forum Spam</a> database. To proceed you'll need to <a href="http://stopforumspam.com/contact" target="_blank">contact them</a> to clear yourself from their database.
</td>
</tr>
{$tbclose}
{php}
} else {
{/php}
Find:
Code
</form>
Add Under:
Code
{php} } {/php}
NOTE: StopForumSpam.com only allows 5k lookups per day; thus, you should refrain from attempting to implement this code on pages which would quickly hit this limit (such as adding searches for all types of data on the search users page).