This script will allow you to correct your thread and post counts if they are off. Thanks goes to Dave_L and Gardener for helping keep this updated since I first released it.
I've recently noticed that the Last Post info isn't getting updated properly when I move the most recent thread to another forum. I know that's probably a bug, but it would be useful to be able to update that column whenever it gets out of synch.
You probably don't need this, but here's a snippet from one of my import scripts for updating this info. It would have to changed a bit, but the general processing should be the same.
Code
// Get Bo_LastNumber, Bo_Posterid, Bo_Last, Bo_lastMain from latest post in forum<br />list($bo_lastnumber, $bo_posterid, $bo_last, $bo_lastmain) = array(0, 0, 0, 0);<br />if ($bo_total > 0) {<br /> $result = do_query("<br /> SELECT B_Number, B_Posterid, B_Posted, B_Main<br /> FROM tmp_posts<br /> WHERE B_Board = '$keyword'<br /> ORDER BY B_Posted DESC<br /> LIMIT 1<br /> ");<br /> list($bo_lastnumber, $bo_posterid, $bo_last, $bo_lastmain) = mysql_fetch_row($result);<br /> mysql_free_result($result);<br /> if (!$bo_lastnumber) {<br /> ubbimport_log("Warning: board $keyword, unable to determine Bo_LastNumber\n");<br /> }<br /> if (!$bo_posterid) {<br /> ubbimport_log("Warning: board $keyword, unable to determine Bo_Posterid\n");<br /> }<br /> if (!$bo_last) {<br /> ubbimport_log("Warning: board $keyword, unable to determine Bo_Last\n");<br /> }<br /> if (!$bo_lastmain) {<br /> ubbimport_log("Warning: board $keyword, unable to determine Bo_lastMain\n");<br /> }<br />}
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.