Most are domains which we banned to stop spammers.
It would take ages to add all 300.
Can I just write an SQL query to do it?
Thanks
It would take ages to add all 300.
Can I just write an SQL query to do it?
Thanks
<?php
$censor = <<<HERE
Ugly
Terrible
Words
Nasty
Fantasstic
HERE;
####################################################################################################
# Do not change anything below this
####################################################################################################
$words = trim($censor);
$words = preg_split("#[\r\n]+#", $words);
sort($words);
$data = array();
foreach ($words as $w)
{
$data['exact'][$w] = strlen($w);
}
$startTime = microtime(true);
$fileDir = dirname(__FILE__);
require($fileDir . '/library/XenForo/Autoloader.php');
XenForo_Autoloader::getInstance()->setupAutoloader($fileDir . '/library');
XenForo_Application::initialize($fileDir . '/library', $fileDir);
XenForo_Application::set('page_start_time', $startTime);
$db = XenForo_Application::getDb();
$db->query("UPDATE xf_option SET option_value = ? WHERE option_id='censorWords'", serialize($data));
print "Done";
Didn't even know that existed. You're right. Thanks, Mike. Excellent.You may be better off using the "spam phrases" option for them, and you can force the posts into moderation or just reject them.
Could you please change the script to cater spam phrases ?Can't be done with queries because the information is serialized. However, I did a small script for you.
Save this as "updateCensor.php" on your XenForo installation, then open http://yoursite.com/updateCensor.php
Also, change the word list (from Ugly to Fantastic in the example) to the list that you want to use
Code:<?php $censor = <<<HERE Ugly Terrible Words Nasty Fantasstic HERE; #################################################################################################### # Do not change anything below this #################################################################################################### $words = trim($censor); $words = preg_split("#[\r\n]+#", $words); sort($words); $data = array(); foreach ($words as $w) { $data['exact'][$w] = strlen($w); } $startTime = microtime(true); $fileDir = dirname(__FILE__); require($fileDir . '/library/XenForo/Autoloader.php'); XenForo_Autoloader::getInstance()->setupAutoloader($fileDir . '/library'); XenForo_Application::initialize($fileDir . '/library', $fileDir); XenForo_Application::set('page_start_time', $startTime); $db = XenForo_Application::getDb(); $db->query("UPDATE xf_option SET option_value = ? WHERE option_id='censorWords'", serialize($data)); print "Done";
It looks like there are a couple, not built in but a few addons.Just need a built-in multiple account detector now.
You don't need it. The spam phrases are stored in a text box. Just get your existing spam phrases and arrange them into a list. I used search and replace in word.Could you please change the script to cater spam phrases ?
Thanks !
We use essential cookies to make this site work, and optional cookies to enhance your experience.