Changeset 956

Show
Ignore:
Timestamp:
04/23/07 22:16:01 (1 year ago)
Author:
Neal
Message:

Modified topic/post counts for forums to include redirect topics.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/upload/include/functions.php

    r953 r956  
    353353 
    354354// 
    355 // Update posts, topics, last_post, last_post_id and last_poster for a forum (redirect topics are not included) 
     355// Update posts, topics, last_post, last_post_id and last_poster for a forum 
    356356// 
    357357function update_forum($forum_id) 
     
    359359        global $db; 
    360360 
    361         $result = $db->query('SELECT COUNT(id), SUM(num_replies) FROM '.$db->prefix.'topics WHERE moved_to IS NULL AND forum_id='.$forum_id) or error('Unable to fetch forum topic count', __FILE__, __LINE__, $db->error()); 
     361        $result = $db->query('SELECT COUNT(id), SUM(num_replies) FROM '.$db->prefix.'topics WHERE forum_id='.$forum_id) or error('Unable to fetch forum topic count', __FILE__, __LINE__, $db->error()); 
    362362        list($num_topics, $num_posts) = $db->fetch_row($result); 
    363363 
     
    372372        } 
    373373        else    // There are no topics 
    374                 $db->query('UPDATE '.$db->prefix.'forums SET num_topics=0, num_posts=0, last_post=NULL, last_post_id=NULL, last_poster=NULL WHERE id='.$forum_id) or error('Unable to update last_post/last_post_id/last_poster', __FILE__, __LINE__, $db->error()); 
     374                $db->query('UPDATE '.$db->prefix.'forums SET num_topics='.$num_topics.', num_posts='.$num_posts.', last_post=NULL, last_post_id=NULL, last_poster=NULL WHERE id='.$forum_id) or error('Unable to update last_post/last_post_id/last_poster', __FILE__, __LINE__, $db->error()); 
    375375} 
    376376