View Full Version : Eximpt super-mods from censortext!!
neo
I don't think FireFly has got this one :D
Any idia how can this be done please!!
In functions.php:
look for:
function censortext($text) {
global $enablecensor,$censorwords,$censorword,$censorchar ;
replace with:
function censortext($text) {
global $enablecensor,$censorwords,$censorword,$censorchar ,$bbuserinfo;
if($bbuserinfo[usergroupid] == 5) {
$enablecensor = 0;
}
Viola... :D
HAHAHAHAH.. thanks for the mentions Remi
Thank you very much, but it is not working!!
My functions.php is a bit deferint
======
// ###################### Start censortext #######################
function censortext($text) {
global $enablecensor,$censorwords,$censorword,$censorchar ;
if ($enablecensor==1 and $censorwords!="") {
if (!isset($censorword)) {
any other suggestions please?
What version are you on?
This works like a charm in version 2.2.4. ;)
I am using 2.2.4 !!
I have noticed you dont have this line in your code:
if ($enablecensor==1 and $censorwords!="") {
Do I have to remove it ?
Thanks
No, you keep everything else the same. ;) Maybe my lack of indentation threw you off. :)
Original censortext:
function censortext($text) {
global $enablecensor,$censorwords,$censorword,$censorchar ;
if ($enablecensor==1 and $censorwords!="") {
if (!isset($censorword)) {
$censorwords = preg_quote($censorwords);
$censorwords = str_replace('/', '\\/', $censorwords);
$censorword=explode(" ",$censorwords);
} else {
reset($censorword);
}
while (list($key,$val)=each($censorword)) {
if ($val!="") {
if (substr($val,0,2)=="\\{") {
$val=substr($val,2,-2);
$text=trim(preg_replace("/([^A-Za-z])".$val."(?=[^A-Za-z])/si","\\1".repeatchar($censorchar,strlen($val))," $text "));
} else {
$text=trim(preg_replace("/$val/si",repeatchar($censorchar,strlen($val))," $text "));
}
}
}
}
return $text;
}
Modified censortext:
function censortext($text) {
global $enablecensor,$censorwords,$censorword,$censorchar ,$bbuserinfo;
if($bbuserinfo[usergroupid] == 5) {
$enablecensor = 0;
}
if ($enablecensor==1 and $censorwords!="") {
if (!isset($censorword)) {
$censorwords = preg_quote($censorwords);
$censorwords = str_replace('/', '\\/', $censorwords);
$censorword=explode(" ",$censorwords);
} else {
reset($censorword);
}
while (list($key,$val)=each($censorword)) {
if ($val!="") {
if (substr($val,0,2)=="\\{") {
$val=substr($val,2,-2);
$text=trim(preg_replace("/([^A-Za-z])".$val."(?=[^A-Za-z])/si","\\1".repeatchar($censorchar,strlen($val))," $text "));
} else {
$text=trim(preg_replace("/$val/si",repeatchar($censorchar,strlen($val))," $text "));
}
}
}
}
return $text;
}
Thank very much Zzed
Now I understand what do you mean, it still doesn't work for me.
but I think the problem is with my overhacked functions.php file.
I will try it later on a clean board :D
Thanks
Ah... I see. :D It 's working fine on my board. :)
You are very welcome. :)
BTW, I released this as a hack. ;)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.