potential code for stopping spam?
3 posters
Page 1 of 1
potential code for stopping spam?
In Sources/Register.php after
Code: [Select]
// Set the options needed for registration.
You could add something like this:
Code: [Select]
//SPAM CHECK
function doBanAdd(){
include_once('Sources/ManageBans.php');
$_REQUEST['bg'] = 10; //Set this to whatever ban you want to use.
$_POST['add_new_trigger']='Add';
$_POST['HBan']="YourCustomKeyHERE";
BanEdit();
}
isBannedEmail($_POST['email'], 'cannot_register', 'Sorry, you are not allowed to register on this forum.');
if(isset($_SERVER['HTTP_X_FORWARD_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARD_FOR'];
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}
$xml_string = file_get_contents('http://www.stopforumspam.com/api?email='.$_POST['email']);
$xml = new SimpleXMLElement($xml_string);
if($xml->appears == 'yes')
{
$_POST['bantype'] = 'email_ban';
doBanAdd();
}
else
{
$xml_string = file_get_contents('http://www.stopforumspam.com/api?ip='.$ip);
$xml = new SimpleXMLElement($xml_string);
if($xml->appears == 'yes')
{
$_POST['bantype'] = 'ip_ban';
$_POST['ip']=$ip;
doBanAdd();
}
}
//END SPAM CHECK
Then in Sources/ManageBans.php
Find:
Code: [Select]
if (!empty($_POST['add_new_trigger']) || !empty($_POST['edit_trigger']))
{
checkSession();
And replace with:
Code: [Select]
if (!empty($_POST['add_new_trigger']) || !empty($_POST['edit_trigger']))
{
if(!isset($_POST['HBan']) || $_POST['HBan']!=="YourCustomKeyHERE")checkSession();
Then find:
Code: [Select]
$context['sub_template'] = 'ban_edit';
Replace with:
Code: [Select]
if(!isset($_POST['HBan']) || $_POST['HBan']!=="YourCustomKeyHERE")$context['sub_template'] = 'ban_edit';
remember to replace "YourCustomKeyHERE" with a secret key.
Code: [Select]
// Set the options needed for registration.
You could add something like this:
Code: [Select]
//SPAM CHECK
function doBanAdd(){
include_once('Sources/ManageBans.php');
$_REQUEST['bg'] = 10; //Set this to whatever ban you want to use.
$_POST['add_new_trigger']='Add';
$_POST['HBan']="YourCustomKeyHERE";
BanEdit();
}
isBannedEmail($_POST['email'], 'cannot_register', 'Sorry, you are not allowed to register on this forum.');
if(isset($_SERVER['HTTP_X_FORWARD_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARD_FOR'];
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}
$xml_string = file_get_contents('http://www.stopforumspam.com/api?email='.$_POST['email']);
$xml = new SimpleXMLElement($xml_string);
if($xml->appears == 'yes')
{
$_POST['bantype'] = 'email_ban';
doBanAdd();
}
else
{
$xml_string = file_get_contents('http://www.stopforumspam.com/api?ip='.$ip);
$xml = new SimpleXMLElement($xml_string);
if($xml->appears == 'yes')
{
$_POST['bantype'] = 'ip_ban';
$_POST['ip']=$ip;
doBanAdd();
}
}
//END SPAM CHECK
Then in Sources/ManageBans.php
Find:
Code: [Select]
if (!empty($_POST['add_new_trigger']) || !empty($_POST['edit_trigger']))
{
checkSession();
And replace with:
Code: [Select]
if (!empty($_POST['add_new_trigger']) || !empty($_POST['edit_trigger']))
{
if(!isset($_POST['HBan']) || $_POST['HBan']!=="YourCustomKeyHERE")checkSession();
Then find:
Code: [Select]
$context['sub_template'] = 'ban_edit';
Replace with:
Code: [Select]
if(!isset($_POST['HBan']) || $_POST['HBan']!=="YourCustomKeyHERE")$context['sub_template'] = 'ban_edit';
remember to replace "YourCustomKeyHERE" with a secret key.
Re: potential code for stopping spam?
Sorry, but PHP or SQL files doesn't work on forumotion. Anyway, you can suggest it here - https://help.forumotion.com/f30-suggestions-for-your-forums
Guest- Guest
Re: potential code for stopping spam?
Forumotion will never (99.9% sure) allow PHP scripts.
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: potential code for stopping spam?
LGforum just to add something, they is many resaons why it won't be allowed, and that includes abuse.
ShinyTwinky69- Forumember
- Posts : 35
Reputation : 1
Language : English/Spanish
Location : El Paso, Texas, United States
Similar topics
» Potential Members saying they cannot Register!
» Spam Control/Code Confirming Appereance
» Potential ios8 issues?
» Potential Hacker
» Potential Domain Propagation issues
» Spam Control/Code Confirming Appereance
» Potential ios8 issues?
» Potential Hacker
» Potential Domain Propagation issues
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum