Previous Thread
Next Thread
Print Thread
Rate Thread
[7.x] Stop Forum Spam Integration v0.2 (Template) #318684 02/16/2011 10:42 PM
Joined: Jan 2000
Posts: 5,786
Gizmo Offline OP
UBB.Dev / UBB.Wiki Owner
Time Lord
OP Offline
UBB.Dev / UBB.Wiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,786
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).

Attached Files
edituser.jpg (92.83 KB, 62 downloads)
regqueue.jpg (71.28 KB, 56 downloads)
reportspam.jpg (98.59 KB, 48 downloads)
detected.jpg (35.97 KB, 53 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, UBB.Sitemaps
Sponsored Links
Re: [7.x] Stop Forum Spam Integration v0.2 (Template) [Re: Gizmo] #318685 02/17/2011 12:06 AM
Joined: Mar 2007
Posts: 15
SteveS Offline
Newbie
Offline
Newbie
Joined: Mar 2007
Posts: 15
Thanks Gizmo! It appears to work very well.

Re: [7.x] Stop Forum Spam Integration v0.2 (Template) [Re: Gizmo] #318686 02/17/2011 12:14 AM
Joined: Mar 2006
Posts: 32
gliderdad Offline
Beta Tester
Offline
Beta Tester
Joined: Mar 2006
Posts: 32
Works great, thanks Giz :thumb:

Re: [7.x] Stop Forum Spam Integration v0.2 (Template) [Re: Gizmo] #318689 02/18/2011 8:53 PM
Joined: Jan 2000
Posts: 5,786
Gizmo Offline OP
UBB.Dev / UBB.Wiki Owner
Time Lord
OP Offline
UBB.Dev / UBB.Wiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,786
Added ability to report spammers; see the last step and the notice about retrieving an API Key.


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, UBB.Sitemaps
Re: [7.x] Stop Forum Spam Integration v0.2 (Template) [Re: Gizmo] #318690 02/18/2011 10:30 PM
Joined: Nov 2010
Posts: 1
Larry920 Offline
Lurker
Offline
Lurker
Joined: Nov 2010
Posts: 1

Thanks Gizmo. We are gonna try it over the weekend and see what happens. We do have an API. Will report back.

Larry

Sponsored Links
Re: [7.x] Stop Forum Spam Integration v0.2 (Template) [Re: Gizmo] #318691 02/18/2011 11:24 PM
Joined: Mar 2006
Posts: 32
gliderdad Offline
Beta Tester
Offline
Beta Tester
Joined: Mar 2006
Posts: 32
Thanks Giz, I just signed up there and tested with the API and it submitted perfectly. Good job :thumb:

Re: [7.x] Stop Forum Spam Integration v0.2 (Template) [Re: Gizmo] #318692 02/19/2011 12:11 AM
Joined: Jan 2000
Posts: 5,786
Gizmo Offline OP
UBB.Dev / UBB.Wiki Owner
Time Lord
OP Offline
UBB.Dev / UBB.Wiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,786
Yeah, I grossly over-analyzed how to do it; when I thought outside the box with the demo code I had it just sort of clicked how easy it really was...

The "hard" part was where to put the report link yet have it stand out, so I just kind of suggested its current placement.

I also over-thought what to submit, then I figured that the only thing that really matters was their latest ip, so if a "last post ip" didn't exist then just grab the reg ip so no matter what it'd be their "last logged" ip address.

Have a couple little things I want to work in, but I went and reported this mod to them so that they could (hopefully) add it to their listing.

Let me know if you guys run into any oddities and I'll take a look. I'm thinking about building a separate (non UBB) script to do a one-time scan of user data, meant to be run on different days for large forums (to bypass the 5k limit) but I'll have that separate for those who want it.


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, UBB.Sitemaps
Re: [7.x] Stop Forum Spam Integration v0.2 (Template) [Re: Gizmo] #318693 02/19/2011 12:34 AM
Joined: Mar 2006
Posts: 32
gliderdad Offline
Beta Tester
Offline
Beta Tester
Joined: Mar 2006
Posts: 32
Thanks Giz, I would def love to see this become stock in v8!!

Re: [7.x] Stop Forum Spam Integration v0.2 (Template) [Re: gliderdad] #318694 02/19/2011 1:01 AM
Joined: Jan 2000
Posts: 5,786
Gizmo Offline OP
UBB.Dev / UBB.Wiki Owner
Time Lord
OP Offline
UBB.Dev / UBB.Wiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,786
Originally Posted by gliderdad79
Thanks Giz, I would def love to see this become stock in v8!!
Well, my code is pretty basic, Rick is more than welcome to use it for inspiration for v8; it's torn from the demo's at stopforumspam's api documentation.

In its current phase it's perfect for anyone who wants to use it, it likely won't hit their 5k limit; the problem is the api key needed for submission; but it could just not show unless an api key shows in the config.

It'd be great to integrate with the reg process, but the idea of false positives that users need to contact stopforumspam.com to bypass is kind of a setback... If I do add it (and I probably will) I'd advise against its general use, but it'd be there regardless.


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, UBB.Sitemaps
Re: [7.x] Stop Forum Spam Integration v0.2 (Template) [Re: Gizmo] #318695 02/19/2011 1:05 AM
Joined: Mar 2006
Posts: 32
gliderdad Offline
Beta Tester
Offline
Beta Tester
Joined: Mar 2006
Posts: 32
If included in stock I think it would need to be an option like twitter where you need to check the box to enable and enter your twitter name or in this case api key.

Last edited by gliderdad79; 02/19/2011 1:05 AM.
Sponsored Links
Re: [7.x] Stop Forum Spam Integration v0.2 (Template) [Re: Gizmo] #318696 02/19/2011 3:39 AM
Joined: Jan 2000
Posts: 5,786
Gizmo Offline OP
UBB.Dev / UBB.Wiki Owner
Time Lord
OP Offline
UBB.Dev / UBB.Wiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,786
Basically, yeah, that's what I was going for


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, UBB.Sitemaps
Re: [7.x] Stop Forum Spam Integration v0.2 (Template) [Re: Gizmo] #318697 02/19/2011 3:54 AM
Joined: Mar 2006
Posts: 32
gliderdad Offline
Beta Tester
Offline
Beta Tester
Joined: Mar 2006
Posts: 32
Great minds think.... Who am I kidding I dont have a great mind :roflmao:

Re: [7.x] Stop Forum Spam Integration v0.2 (Template) [Re: Gizmo] #318698 02/20/2011 2:07 AM
Joined: Jan 2000
Posts: 5,786
Gizmo Offline OP
UBB.Dev / UBB.Wiki Owner
Time Lord
OP Offline
UBB.Dev / UBB.Wiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,786
Added the ability to do an IP check against the Stop Forum Spam database at signup; if their IP is detected then they're not allowed to sign up (see the screen attached for the error message portion).


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, UBB.Sitemaps
Re: [7.x] Stop Forum Spam Integration v0.2 (Template) [Re: Gizmo] #318699 02/21/2011 9:35 PM
Joined: Mar 2006
Posts: 32
gliderdad Offline
Beta Tester
Offline
Beta Tester
Joined: Mar 2006
Posts: 32
Sweet, been added. I see no reason this shouldn't be added to stock, I hope it does!

Re: [7.x] Stop Forum Spam Integration v0.2 (Template) [Re: Gizmo] #318701 03/07/2011 7:16 AM
Joined: Oct 2007
Posts: 10
Crasher Offline
Newbie
Offline
Newbie
Joined: Oct 2007
Posts: 10
Awesome

Works a treat smile

Cheers for this.

Regards

Barry


I don't do a lot, but i do do this
Re: [7.x] Stop Forum Spam Integration v0.2 (Template) [Re: Gizmo] #318730 03/25/2011 8:14 PM
Joined: Jan 2000
Posts: 5,786
Gizmo Offline OP
UBB.Dev / UBB.Wiki Owner
Time Lord
OP Offline
UBB.Dev / UBB.Wiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,786
Fixed a bug reported by Gliderdad with the showuser.tmpl portion for last post ip; when a user doesn't have a last post ip (0 posts) the script will throw an error; the fix is to just not do the check in this case. New code (updated on first post) is:

Take this:
Code

$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 = "";
}


Change To:
Code

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 = "";
}


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, UBB.Sitemaps
Re: [7.x] Stop Forum Spam Integration v0.2 (Template) [Re: Gizmo] #318737 04/09/2011 4:37 PM
Joined: Jan 2000
Posts: 5,786
Gizmo Offline OP
UBB.Dev / UBB.Wiki Owner
Time Lord
OP Offline
UBB.Dev / UBB.Wiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,786
I've redone this template hack as a full modification available here. I've also added to it by setting it to check emails on registration and report offenders who're signing up with triggered email data to Stop Forum Spam automatically in the v0.3 Modification thread.


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, UBB.Sitemaps

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
Nettomo
Nettomo
Germany, Bremen
Posts: 417
Joined: November 2001
Forum Statistics
Forums63
Topics37,490
Posts293,665
Members13,828
Most Online5,166
Sep 15th, 2019
Top Posters(All Time)
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,786
Greg Hard 4,625
Top Posters(30 Days)
isaac 4
Today's Statistics
Currently Online 1426
Topics Created 0
Posts Made 0
Users Online 0
Birthdays 21
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2019 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Snapshot build 20191013.dev)
Responsive Width:

PHP: 5.4.45 Page Time: 0.051s Queries: 16 (0.017s) Memory: 3.3460 MB (Peak: 3.6071 MB) Data Comp: Zlib Server Time: 2019-10-21 15:42:05 UTC
Valid HTML 5 and Valid CSS