|
From: Jonathan H. <the...@us...> - 2002-05-03 19:46:37
|
Update of /cvsroot/phpbb/phpBB2/includes
In directory usw-pr-cvs1:/tmp/cvs-serv20455
Modified Files:
Tag: phpBB-2_0_0
functions_post.php
Log Message:
Ok this should fix at least one of the issue with forum's getting out of sync...
Index: functions_post.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/functions_post.php,v
retrieving revision 1.9.2.1
retrieving revision 1.9.2.2
diff -C2 -r1.9.2.1 -r1.9.2.2
*** functions_post.php 5 Apr 2002 19:48:56 -0000 1.9.2.1
--- functions_post.php 3 May 2002 19:46:34 -0000 1.9.2.2
***************
*** 525,529 ****
}
- $forum_update_sql = 'forum_posts = forum_posts - 1';
$topic_update_sql .= 'topic_replies = topic_replies - 1';
if ( $post_data['last_post'] )
--- 525,528 ----
***************
*** 531,534 ****
--- 530,534 ----
if ( $post_data['first_post'] )
{
+ $forum_update_sql .= ', forum_topics = forum_topics - 1';
$sql = "DELETE FROM " . TOPICS_TABLE . "
WHERE topic_id = $topic_id
***************
*** 574,578 ****
remove_search_post($post_id);
!
if ( $mode == 'delete' && $post_data['first_post'] && $post_data['last_post'] )
{
--- 574,593 ----
remove_search_post($post_id);
! //
! // Ok we set variables above that were intended to update the topics table
! // so let's go ahead and use it already :)
! //
! if( !empty($topic_update_sql) && !($post_data['first_post'] && $post_data['last_post']) )
! {
! $sql = 'UPDATE ' . TOPICS_TABLE . '
! SET ' . $topic_update_sql . "
! WHERE topic_id = $topic_id OR
! topic_moved_id = $topic_id";
! if ( !($db->sql_query($sql)) )
! {
! message_die(GENERAL_ERROR, 'Error in updating reply counts', '', __LINE__, __FILE__, $sql);
! }
! }
!
if ( $mode == 'delete' && $post_data['first_post'] && $post_data['last_post'] )
{
|