it's that part:
PHP Code:
$bbcodes=$DB_site->query("SELECT bbcodetag,bbcodereplacement,twoparams FROM bbcode");
while($bbregex=$DB_site->fetch_array($bbcodes)) {
if ($bbregex[twoparams]) {
$regex=sprintf($doubleRegex, $bbregex[bbcodetag], $bbregex[bbcodetag]);
} else {
$regex=sprintf($singleRegex, $bbregex[bbcodetag], $bbregex[bbcodetag]);
}
$searcharray[] = $regex;
$replacearray[] = $bbregex[bbcodereplacement];
// and get nested ones:
$searcharray[] = $regex;
$replacearray[] = $bbregex[bbcodereplacement];
$searcharray[] = $regex;
$replacearray[] = $bbregex[bbcodereplacement];
}
and shortly after that the whole array parser:
PHP Code:
$bbcode=preg_replace($searcharray, $replacearray, $bbcode);