Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Sep 2006
Posts: 9
Lurker
Lurker
Offline
Joined: Sep 2006
Posts: 9
Having trouble getting Stop Forum Spam mod to work.

This step:
Code

In templates/default/admin/membermanage.tmpl
Find:
for($i=0;$i<sizeof($que);$i++) { //UBBTREMARK

Add Below:
$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;\">{$ubbt_lang["SFS_ALERT"]}</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;\">{$ubbt_lang["SFS_ALERT"]}</a>";
} else {
$spammer_reg_ip = "";
}

Before:
Code

for($i=0;$i<sizeof($que);$i++) { //UBBTREMARK
echo <<<UBBTPRINT
<tr><td class="stdautorow autobottom colored-row" valign="top">
<small>
...

After:
Code

for($i=0;$i<sizeof($que);$i++) { //UBBTREMARK
$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;\">{$ubbt_lang["SFS_ALERT"]}</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;\">{$ubbt_lang["SFS_ALERT"]}</a>";
} else {
$spammer_reg_ip = "";
}
echo <<<UBBTPRINT
<tr><td class="stdautorow autobottom colored-row" valign="top">
<small>
...

And all I get is a blank member management page.
I see the four tabs across the top, but I cannot click on them.
Also the display pane is empty. Any ideas?

Sponsored Links
Joined: Jan 2000
Posts: 254
Likes: 4
Beta Tester
Beta Tester
Joined: Jan 2000
Posts: 254
Likes: 4
Okay ,Not sure if this is the issue but did you add your applied for API key to the language file.


There is no such thing as stupid questions.
Just stupid answers.
Joined: Sep 2006
Posts: 9
Lurker
Lurker
Offline
Joined: Sep 2006
Posts: 9
not if it wasn't in those directions.

What is that and how do I do it?

Joined: Jan 2000
Posts: 254
Likes: 4
Beta Tester
Beta Tester
Joined: Jan 2000
Posts: 254
Likes: 4
read the post for the mod again.
Mod

goto the api part.
Maybe that is what the issue is.

Last edited by Ruben Rocha; 04/15/2011 4:56 PM.

There is no such thing as stupid questions.
Just stupid answers.
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
It's on the posting where you downloaded the script... It says an API key is required, and it says how to sign up for one just above the download link...

In any case, the API key shouldn't "kill" any file, it simply wouldn't allow you to submit... So it's my guess that something, somewhere, has been modified incorrectly. That file's mod looks correct though.

The membermanage step is just for the registration queue, if you don't use the reg queue you can safely skip the member manage steps.


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: Sep 2006
Posts: 9
Lurker
Lurker
Offline
Joined: Sep 2006
Posts: 9
Okay, I got my API key and added it to both language files.

The I refresh the Member Management page, the 4 tabs appear, but the data area is empty. I also can't click the tabs.

I went through your steps one at a time and they all look perfect. I even restarted my IIS hoping that maybe something wasn't getting loaded. If I revert the AFTER step above to BEFORE , I get my member management page back. *sigh*

Joined: Sep 2006
Posts: 9
Lurker
Lurker
Offline
Joined: Sep 2006
Posts: 9
Okay, I tried a total hack to see what would happen....

If I delete all the lines in that section but leave the first one, i.e.,
Code

for($i=0;$i<sizeof($que);$i++) { //UBBTREMARK

$xml_string = file_get_contents("http://www.stopforumspam.com/api?email=". $que[$i]['email']);

member management works as per normal. But if I add the next line member management fails as explained.

Code

for($i=0;$i<sizeof($que);$i++) { //UBBTREMARK

$xml_string = file_get_contents("http://www.stopforumspam.com/api?email=". $que[$i]['email']);
$xml = new SimpleXMLElement($xml_string);

So...

The line$ xml = new SimpleXMLElement($xml_string); seems to kill member management. Is it possible my board doesn't know what SimpleXMLElement() is and if barfing there?

Last edited by luket; 04/15/2011 7:30 PM.
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
What version of PHP are you running? I coded this on PHP5 using the SimpleXMLElement

Does the mod fail on say editing a member in the CP?

Last edited by Gizmo; 04/15/2011 8:30 PM.

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: Sep 2006
Posts: 9
Lurker
Lurker
Offline
Joined: Sep 2006
Posts: 9
I'm running PHP Version 4.4.7

yep it fails with the following message while trying to "edit user"

Fatal error: Cannot instantiate non-existent class: simplexmlelement in C:\Inetpub\vhosts\game-master.net\httpdocs\pit\templates\default\admin\showuser.tmpl on line 6

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
You are aware that PHP4 is a shelved product and they're not even releasing security patches since 2008 right?...

SimpleXMLElement was added in PHP5 (to which PHP6 will start phasing it out soon), there isn't really a simple way to get this to work in PHP4...


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: Sep 2006
Posts: 9
Lurker
Lurker
Offline
Joined: Sep 2006
Posts: 9
Okie dokie, I'll look at upgrading.

PS. I see the tweet and facebook like .. is that a mod or just some sort of HTML insert. I'd like that on my forums as well.

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
The facebook/tweet buttons where added in 7.5.6 (I believe one version newer than what you're running).


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: Sep 2006
Posts: 9
Lurker
Lurker
Offline
Joined: Sep 2006
Posts: 9
Okay, I have the Stop Forum Spam working .. thanks Gizmo!
I'm now playing with it to figure out all the features.
(I had to upgrade to PHP5 as per your suggestion)

Question: I have a spammer which existe in the SFS database currently in the registration queue. When I go to the Registration queue, there is no indication he is a spammer. If I click on his name I'm taken to the Edit Profile page where I see the red '!' and the Report Spammer option.
Is this correct? Shouldn't I see an indication in the Registration Queue that this is a known spam account?

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
Different checks for different areas...

-The edit profile checks their Registration IP, Last Post IP (if it exists), and EMail.
-Reg Queue only checks the EMail address (false positives and all with the IP)
-The Registration Check checks the IP Address when accessed and the EMail when submitted.


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: Sep 2006
Posts: 9
Lurker
Lurker
Offline
Joined: Sep 2006
Posts: 9
Right.

My question is: Why on the Reg Que is there no indication that someone is a spammer.. you already have the email and ip address.

If I click on the username (in the Reg Que) I will see the Red '!' indicating he is a spammer.

I'm really only saying it's an unneeded step. If I could see the Red '!' in the reg que, I could simply Disallow the registration then and there.

Know what I mean?

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
Well, the reason there aren't more checks is because every lookup counts towards your lookups on their site; you only get so many per day... And for larger forums that have more activity per day will have more lookups...

Basically, same reason we don't do lookups on every member as they're loaded via the member management screen, you'll hit a limit and you won't be able to preform any lookups after you hit the limit.


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: Sep 2006
Posts: 9
Lurker
Lurker
Offline
Joined: Sep 2006
Posts: 9
Well I understand the limits, but they are what 20,000?
I'm only talking about new registrations sitting in the registration queue.

For me that seems like a natural. *shrugs*

In any case, thanks it's a nice mod!


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
isaac
isaac
California
Posts: 1,157
Joined: July 2001
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
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)