Advanced search
Registered users
Username:

Password:

Log me on automatically next visit?

¤  Forgot password
¤  Registration
 
♥ ♥ SHOUTBOX ♥ ♥



Please leave name in the shoutbox to be activated. Thanks Manimal & Heidi (You can IM us in Hal also!) or contact us @ patient@theasylum.me


Random image

AsylumFemBWMegas1108-001
AsylumFemBWMegas1108-001

Manimal
  


Stop Spammers (Really Works!)

Previous image:
   4 Images Remove the Headline from Comments  
 Next image:
4images - Auto Thumbnail - Check Thumbnail - Change Default Number from 10 to Any Number   

 


    
Stop Spammers (Really Works!)
Description: How to stop spammers with the help of Stop Forum Spam. This actually works!
If you need help IM me in HAL @ Heidi or Snob! (Source also: http://iezombie.net/4images-stop-register-spammers/)
Email me at
Forteheidi@gmail.com



First Step:

You need to access functions.php which is in the includes folder of your 4images.

Once you have located the file open it and before the last ?> (at the end) add the following code:




function checkspammers($input,$inputtype='email'){
//Load the file, and implode the array.
$xml = implode('',file("http://www.stopforumspam.com/api?".$inputtype."=".$input));

//Start new xml parser.
$p = xml_parser_create();

//Get the xml into an array
xml_parse_into_struct($p, $xml, $vals, $index);

//Free some memory by clearing the xml parser
xml_parser_free($p);

//We don't need $index or the $xml any more
unset($index,$xml);


//Prepare the return array
$return = array();

//Now we are going to make the array use able
foreach($vals as $array){
//If it's the opening array we can do it slightly differently
if($array['type'] == 'open'){
//Just get weather it was sucess or not.
$return[$array['tag']] = $array['attributes']['SUCCESS'];
}elseif($array['type'] == 'complete'){
//Else just get the value
$return[$array['tag']] = $array['value'];
}
}

//Save a bit mroe memory by clearing the vals array
unset($vals);

//Now make time into a unix timestamp
if($return['LASTSEEN']){
//Sepparate the timestamp into the time and the date
$time = explode(' ',$return['LASTSEEN']);
//Sepparate the date
$date = explode("-",$time[0]);
//Sepparate the time
$time = explode("-",$time[0]);

//Now make the time, note we times by 1 to remove leading zeros, if we don't then php can sometimes use the octal system instead of decimal.
$return['UNIXLASTSEEN'] = gmmktime($time[0]*1,$time[1]*1,$time[2]*1,$date[1]*1,$date[2]*1,$date[0]*1);
}

//RESPONCE would be better as booleen, not a string
if($return['RESPONCE'] == 'true'){ $return['RESPONCE'] = true; }else{ $return['RESPONCE'] = false; }

//Now return our array.
return $return;
}

//Example function to check in ip
function isaspammer($ip){
//Get the xml results as an array from teh function above
$result = checkspammers($ip);
//Is he reported?
if($result['FREQUENCY'] > 0 && (time() - $result['UNIXLASTSEEN']) < (3600 * 24 * 365)){
//He is a spammer
return true;
}else{
//He is not reported as a spammer
return false;
}
}





Next Step:

Now open register.php this should be in the
main folder of you 4images gallery
(please note you should log into your host and make the
changes these aren't for the HTML under edit templates).

find this line:


if ($user_password == "") {

and above it copy this:

if (isaspammer($user_email) || isaspammer($site_sess->user_ip, "ip")) {
$msg .= (($msg != "") ? "
" : "").$lang['invalid_email_format']; // or add anything else, bots doesn't understand nothing :)
$error = 1;
}
Keywords:  
Date: 13.06.2016 12:24
Hits: 1246
Downloads: 42
Rating: 0.00 (0 Vote(s))
File size: 29.4 KB
Added by: Heidi


Author: Comment:
There are no comments for this image



Previous image:
   4 Images Remove the Headline from Comments  
 Next image:
4images - Auto Thumbnail - Check Thumbnail - Change Default Number from 10 to Any Number   

 

RSS Feed: Stop Spammers (Really Works!) (Comments)


Template Modifications by Heidi (Forte)