heretic
03-31-2002, 03:19 PM
After manuallyu upgrading, I get this when editing a post- the edit works, but it won't redirect back to the post...
any idea what's causing this?
Fatal error: Call to undefined function: unindexpost() in /home/hosted/warpstorm/public_html/forum/editpost.php on line 263
Admin
03-31-2002, 04:12 PM
What version did you upgrade FROM and TO? unindexpost() was changed throughout the 2.2.x line.
(See, this is why you shouldn't upgrade manually unless you know exactly what's going on :))
heretic
03-31-2002, 08:01 PM
2.2.1 to 2.2.3, then I went from there to 2.2.4
Admin
04-01-2002, 03:45 AM
OK stick this in your functions.php:
// ###################### Start unindexpost #######################
function unindexpost($postid,$title="",$pagetext="") {
global $DB_site;
// get the data
if ($pagetext=="") {
$post=$DB_site->query_first("SELECT postid,threadid,title,pagetext FROM post WHERE postid='$postid'");
} else {
$post['postid']=$postid;
$post['title']=$title;
$post['pagetext']=$pagetext;
}
// get word ids from table
$allwords=$post['title']." ".$post['pagetext'];
$allwords=preg_replace("/[\n\t\r,]/s"," ",$allwords);
$allwords=preg_replace("/(\.+)($| |\n|\t)/s", " ", $allwords);
$allwords=str_replace("[", " [", $allwords);
$allwords=str_replace("]", "] ", $allwords);
$allwords=preg_replace("/[\(\)\"':;\[\]?!#{}_\-+\\\\]/s","",$allwords);
$allwords=strtolower(trim(str_replace(" "," ",$allwords)));
if ($titlewords)
$allwords.=" ".$titlewords;
$wordarray=explode(" ",$allwords);
$getwordidsql="title IN ('".str_replace(" ","','",$allwords)."')";
$words=$DB_site->query("SELECT wordid,title FROM word WHERE $getwordidsql");
$wordids="";
while ($word=$DB_site->fetch_array($words)) {
$wordids .= ',' . $word[wordid];
}
// delete em!
$DB_site->query("DELETE FROM searchindex WHERE wordid IN (0$wordids) AND postid=$post[postid]");
}
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.