View Single Post
  #4  
Old 10th January 2010, 11:47
Tony's Avatar
Tony Tony is offline
Senior Member
 
Join Date: Mar 2008
P2P
Posts: 182
Default
ok replace your cleanup with this cleanup as ive added 2 cleanup codes for the forum and if 1 doesnt work then you can try the other code instead :)

if it doesnt work first time then open the cleanup and search for this

Code:
// update forum post/topic count //Old
    /*<-- remove to enable
    $forums = mysql_query("select id from forums");
    while ($forum = mysql_fetch_assoc($forums))
    {
        $postcount = 0;
        $topiccount = 0;
        $topics = mysql_query("select id from topics where forumid=$forum[id]");
        while ($topic = mysql_fetch_assoc($topics))
        {
            $res = mysql_query("select count(*) from posts where topicid=$topic[id]");
            $arr = mysql_fetch_row($res);
            $postcount += $arr[0];
            ++$topiccount;
        }
        mysql_query("update forums set postcount=$postcount, topiccount=$topiccount where id=$forum[id]");
    }remove to enable -->*/
as you can see ive left a note showing what to remove to enable that code . you need to remove the /* and */ from the code including the extra text i left of course :)

then just remove the other forum cleanup code thats rite below the code you just edited ..
Attached Files
File Type: php cleanup.php (18.7 KB, 11 views)
Reply With Quote