I upgraded to vb3 last night.......all is well for now

This section is an archive with no posting allowed. The software represented in this forum is no longer supported or updated. If you need help upgrading to a newer version of vBulletin please open a support ticket. You can also post in the section supporting the upgrade version you're planning to use.
We are sorry for any inconvenience this may cause.
Welcome to the vBulletin support forums! In our community forums you can receive professional support and assistance with any issues you might have with your vBulletin Products.
Useful Links for Guests:
If you are having problems posting in the relevant areas for your software, please see this topic.
// ###################### Start update threads #######################
if ($action=="updatethread") {
if (isset($perpage)==0 or $perpage=="") {
$perpage=2000;
}
if (isset($startat)==0 or $startat=="") {
$startat=0;
}
$finishat=$startat+$perpage;
echo "<p>Thread ids:</p>";
$threads=$DB_site->query("SELECT MIN(post.postid) AS minpost, MAX(post.postid) AS maxpost, thread.threadid, MAX(post.dateline) AS dateline,
(COUNT(*)-1) AS posts,
SUM(attachment.visible) AS attachsum
FROM post,thread
LEFT JOIN attachment ON attachment.attachmentid=post.attachmentid
WHERE thread.threadid=post.threadid
AND thread.threadid>=$startat
AND thread.threadid<$finishat
GROUP BY thread.threadid
ORDER BY threadid DESC");
while ($thread=$DB_site->fetch_array($threads)) {
$threadid=$thread[threadid];
echo "Processing thread <b>$threadid</b><br>\n";
flush();
$attachsum=$thread[attachsum];
$numberposts=$thread[posts];
$lastpost=$thread[dateline];
$firstusername=$DB_site->query_first("SELECT username,userid FROM post WHERE postid=$thread[minpost]");
$firstuserid=$firstusername['userid'];
if ($firstusername[userid]==0) {
$firstusername=$firstusername[username];
} else {
$users=$DB_site->query_first("SELECT username FROM user WHERE userid=$firstusername[userid]");
$firstusername=$users[username];
}
$lastusername=$DB_site->query_first("SELECT username,userid FROM post WHERE postid=$thread[maxpost]");
if ($lastusername[userid]==0) {
$lastusername=$lastusername[username];
} else {
$users=$DB_site->query_first("SELECT username FROM user WHERE userid=$lastusername[userid]");
$lastusername=$users[username];
}
if (!$attachsum) $attachsum = "0";
$DB_site->query("UPDATE thread SET lastpost=$lastpost,replycount=$numberposts,postusername='".addslashes($firstusername)."', postuserid='$firstuserid', lastposter='".addslashes($lastusername)."',attach=$attachsum WHERE threadid=$threadid");
}
if ($checkmore=$DB_site->query_first("SELECT threadid FROM thread WHERE threadid>=$finishat")) {
cpredirect("misc.php?s=$session[sessionhash]&action=updatethread&startat=$finishat&perpage=$perpage");
echo "<p><a href=\"misc.php?s=$session[sessionhash]&action=updatethread&startat=$finishat&perpage=$perpage\">Click here to continue updating threads</a></p>";
} else {
echo "<p>Threads updated!</p>";
cpredirect("misc.php?s=$session[sessionhash]",1);
}
}
Comment