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:
- 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 ModificationIn templates/default/admin/membermanage.tmplFind:
for($i=0;$i<sizeof($que);$i++) { //UBBTREMARK
Add Under:
$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:
<br />{$que[$i]['uname']}<br />{$que[$i]['email']}<br />{$que[$i]['ip']}
Replace With:
<br />{$que[$i]['uname']}<br />{$que[$i]['email']}{$spammer_real_email}<br />{$que[$i]['ip']}{$spammer_reg_ip}
In templates/default/admin/showuser.tmplFind:
$forum_link = make_ubb_url("", "", false);
Add Under:
$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:
<input type="text" name="email" value="$email" id="email" />
Replace With:
<input type="text" name="email" value="$email" id="email" />$spammer_real_email
Find:
Replace With:
$regdate - $regip$spammer_reg_ip
Find:
Replace With:
$lastpost - $lastpostip$spammer_last_ip
To be able to report usersIn templates/default/admin/showuser.tmplFind:
$forum_link = make_ubb_url("", "", false);
Add Under (be sure to add your API Key to the API-Key section below):
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:
Replace With:
$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.tplFind:
{* Script Version 7.5.6 *}
Add Under:
{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:
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).