MindTrix
01-11-2004, 11:48 AM
Newbie question :)
what am i doing wrong here
function fetch_censored_text($text)
{
global $vboptions;
static $censorwords;
if ($forumid == 1) {print $text;}
elseif ($vboptions['enablecensor'] AND !empty($vboptions['censorwords']))
{
if (empty($censorwords))
{
$vboptions['censorwords'] = preg_quote($vboptions['censorwords'], '#');
$censorwords = preg_split('#\s+#', $vboptions['censorwords'], -1, PREG_SPLIT_NO_EMPTY);
}
foreach ($censorwords AS $censorword)
{
if (substr($censorword, 0, 2) == '\\{')
{
$censorword = substr($censorword, 2, -2);
$text = preg_replace('#(?<=[^A-Za-z]|^)' . $censorword . '(?=[^A-Za-z]|$)#si', str_repeat($vboptions['censorchar'], strlen($censorword)), $text);
}
else
{
$text = preg_replace("#$censorword#si", str_repeat($vboptions['censorchar'], strlen($censorword)), $text);
}
}
}
// strip any admin-specified blank ascii chars
$text = strip_blank_ascii($text, $vboptions['censorchar']);
return $text;
}
Basically i added this part
if ($forumid == 1) {print $text;}
elseif
I know im probably going about everything totaly wrong.
Advice welcome :)
what am i doing wrong here
function fetch_censored_text($text)
{
global $vboptions;
static $censorwords;
if ($forumid == 1) {print $text;}
elseif ($vboptions['enablecensor'] AND !empty($vboptions['censorwords']))
{
if (empty($censorwords))
{
$vboptions['censorwords'] = preg_quote($vboptions['censorwords'], '#');
$censorwords = preg_split('#\s+#', $vboptions['censorwords'], -1, PREG_SPLIT_NO_EMPTY);
}
foreach ($censorwords AS $censorword)
{
if (substr($censorword, 0, 2) == '\\{')
{
$censorword = substr($censorword, 2, -2);
$text = preg_replace('#(?<=[^A-Za-z]|^)' . $censorword . '(?=[^A-Za-z]|$)#si', str_repeat($vboptions['censorchar'], strlen($censorword)), $text);
}
else
{
$text = preg_replace("#$censorword#si", str_repeat($vboptions['censorchar'], strlen($censorword)), $text);
}
}
}
// strip any admin-specified blank ascii chars
$text = strip_blank_ascii($text, $vboptions['censorchar']);
return $text;
}
Basically i added this part
if ($forumid == 1) {print $text;}
elseif
I know im probably going about everything totaly wrong.
Advice welcome :)