Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Jan 2000
Posts: 5,819
Likes: 16
Gizmo Offline OP
UBBDev / UBBWiki Owner
Time Lord
OP Offline
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,819
Likes: 16
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 Images
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, My UBB Scripts
Sponsored Links
Joined: Mar 2007
Posts: 16
S
Newbie
Offline
Newbie
S
Joined: Mar 2007
Posts: 16
Thanks Gizmo! It appears to work very well.

Joined: Mar 2006
Posts: 32
G
Beta Tester
Offline
Beta Tester
G
Joined: Mar 2006
Posts: 32
Works great, thanks Giz :thumb:

Joined: Jan 2000
Posts: 5,819
Likes: 16
Gizmo Offline OP
UBBDev / UBBWiki Owner
Time Lord
OP Offline
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,819
Likes: 16
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, My UBB Scripts
Joined: Nov 2010
Posts: 1
L
Lurker
Offline
Lurker
L
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
Joined: Mar 2006
Posts: 32
G
Beta Tester
Offline
Beta Tester
G
Joined: Mar 2006
Posts: 32
Thanks Giz, I just signed up there and tested with the API and it submitted perfectly. Good job :thumb:

Joined: Jan 2000
Posts: 5,819
Likes: 16
Gizmo Offline OP
UBBDev / UBBWiki Owner
Time Lord
OP Offline
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,819
Likes: 16
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, My UBB Scripts
Joined: Mar 2006
Posts: 32
G
Beta Tester
Offline
Beta Tester
G
Joined: Mar 2006
Posts: 32
Thanks Giz, I would def love to see this become stock in v8!!

Joined: Jan 2000
Posts: 5,819
Likes: 16
Gizmo Offline OP
UBBDev / UBBWiki Owner
Time Lord
OP Offline
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,819
Likes: 16
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, My UBB Scripts
Joined: Mar 2006
Posts: 32
G
Beta Tester
Offline
Beta Tester
G
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 12:05 AM.
Sponsored Links
Joined: Jan 2000
Posts: 5,819
Likes: 16
Gizmo Offline OP
UBBDev / UBBWiki Owner
Time Lord
OP Offline
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,819
Likes: 16
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, My UBB Scripts
Joined: Mar 2006
Posts: 32
G
Beta Tester
Offline
Beta Tester
G
Joined: Mar 2006
Posts: 32
Great minds think.... Who am I kidding I dont have a great mind :roflmao:

Joined: Jan 2000
Posts: 5,819
Likes: 16
Gizmo Offline OP
UBBDev / UBBWiki Owner
Time Lord
OP Offline
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,819
Likes: 16
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, My UBB Scripts
Joined: Mar 2006
Posts: 32
G
Beta Tester
Offline
Beta Tester
G
Joined: Mar 2006
Posts: 32
Sweet, been added. I see no reason this shouldn't be added to stock, I hope it does!

Joined: Oct 2007
Posts: 10
C
Newbie
Offline
Newbie
C
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
Joined: Jan 2000
Posts: 5,819
Likes: 16
Gizmo Offline OP
UBBDev / UBBWiki Owner
Time Lord
OP Offline
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,819
Likes: 16
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, My UBB Scripts
Joined: Jan 2000
Posts: 5,819
Likes: 16
Gizmo Offline OP
UBBDev / UBBWiki Owner
Time Lord
OP Offline
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,819
Likes: 16
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, My UBB Scripts

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
Posts: 70
Joined: January 2007
Forum Statistics
Forums63
Topics37,558
Posts293,857
Members13,848
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,819
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 70
Gizmo 16
Brett 7
WebGuy 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2022 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Snapshot build 20220120)
Responsive Width:

PHP: 7.3.29 Page Time: 0.030s Queries: 50 (0.015s) Memory: 0.8918 MB (Peak: 1.0116 MB) Data Comp: Zlib Server Time: 2022-01-23 15:55:08 UTC
Valid HTML 5 and Valid CSS