Apparently there is something wrong with this hacked function, it causes errors on pages that call it directly, ie. smilies page, index page (when categories only is set), faq etc...
// ###################### Start dovars #######################
function dovars($vartext,$fid=0) {
// parses replacement vars
global $DB_site;
global $forumid;
global $vars;
// load vars
$cusvars=$DB_site->query("SELECT * FROM replacement where forumid = $forumid ORDER BY replacementid DESC");
$newtext=$vartext;
$DB_site->data_seek(0,$cusvars);
$forumspec = "";
while ($cusvar=$DB_site->fetch_array($cusvars)) {
$newtext=str_replace($cusvar[findword],$cusvar[replaceword],$newtext);
$forumspec .= "and findword != '$cusvar[findword]' ";
}
$vars=$DB_site->query("SELECT * FROM replacement where forumid = 0 $forumspec ORDER BY replacementid DESC");
$DB_site->data_seek(0,$vars);
while ($var=$DB_site->fetch_array($vars)) {
$newtext=str_replace($var[findword],$var[replaceword],$newtext);
}
return $newtext;
}
I've tried rewriting this, but I'm not making much progress.
taking out the following line solves the problem illout mentioned.
$DB_site->data_seek(0,$cusvars);
but I'm not sure if thats a vital piece of code or not.
ANY help with this would be much appreciated.
Goldenboy
|