Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
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 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).
Attachments
edituser.jpg (92.83 KB, 63 downloads)
regqueue.jpg (71.28 KB, 56 downloads)
reportspam.jpg (98.59 KB, 49 downloads)
detected.jpg (35.97 KB, 54 downloads)


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Sponsored Links
Entire Thread
Subject Posted By Posted
[7.x] Stop Forum Spam Integration v0.2 (Template) Gizmo 02/17/2011 5:42 AM
Re: [7.x] Stop Forum Spam Integration v0.2 (Template) SteveS 02/17/2011 7:06 AM
Re: [7.x] Stop Forum Spam Integration v0.2 (Template) gliderdad 02/17/2011 7:14 AM
Re: [7.x] Stop Forum Spam Integration v0.2 (Template) Gizmo 02/19/2011 3:53 AM
Re: [7.x] Stop Forum Spam Integration v0.2 (Template) Larry920 02/19/2011 5:30 AM
Re: [7.x] Stop Forum Spam Integration v0.2 (Template) gliderdad 02/19/2011 6:24 AM
Re: [7.x] Stop Forum Spam Integration v0.2 (Template) Gizmo 02/19/2011 7:11 AM
Re: [7.x] Stop Forum Spam Integration v0.2 (Template) gliderdad 02/19/2011 7:34 AM
Re: [7.x] Stop Forum Spam Integration v0.2 (Template) Gizmo 02/19/2011 8:01 AM
Re: [7.x] Stop Forum Spam Integration v0.2 (Template) gliderdad 02/19/2011 8:05 AM
Re: [7.x] Stop Forum Spam Integration v0.2 (Template) Gizmo 02/19/2011 10:39 AM
Re: [7.x] Stop Forum Spam Integration v0.2 (Template) gliderdad 02/19/2011 10:54 AM
Re: [7.x] Stop Forum Spam Integration v0.2 (Template) Gizmo 02/20/2011 9:07 AM
Re: [7.x] Stop Forum Spam Integration v0.2 (Template) gliderdad 02/22/2011 4:35 AM
Re: [7.x] Stop Forum Spam Integration v0.2 (Template) Crasher 03/07/2011 2:16 PM
Re: [7.x] Stop Forum Spam Integration v0.2 (Template) Gizmo 03/26/2011 3:14 AM
Re: [7.x] Stop Forum Spam Integration v0.2 (Template) Gizmo 04/09/2011 11:37 PM

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,833
Joined: January 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)