Changeset 956
- Timestamp:
- 04/23/07 22:16:01 (1 year ago)
- Files:
-
- trunk/upload/include/functions.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/upload/include/functions.php
r953 r956 353 353 354 354 // 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 356 356 // 357 357 function update_forum($forum_id) … … 359 359 global $db; 360 360 361 $result = $db->query('SELECT COUNT(id), SUM(num_replies) FROM '.$db->prefix.'topics WHERE moved_to IS NULL ANDforum_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()); 362 362 list($num_topics, $num_posts) = $db->fetch_row($result); 363 363 … … 372 372 } 373 373 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()); 375 375 } 376 376
