What code in the BBCode function parses the code from the database? (turns it into the code specified in the db?)
Thanks
- Neo
We got some 1337 hackers here...
Xenon
02-01-2003, 10:44 AM
it's that part:
$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:
$bbcode=preg_replace($searcharray, $replacearray, $bbcode);
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.