|
From: Paul S. O. <ps...@us...> - 2002-04-05 19:49:00
|
Update of /cvsroot/phpbb/phpBB2/includes
In directory usw-pr-cvs1:/tmp/cvs-serv18294/includes
Modified Files:
Tag: phpBB-2_0_0
functions_post.php
Log Message:
Wasn't decrementing topic reply counter when deleting anything other than first or last post in a topic
Index: functions_post.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/functions_post.php,v
retrieving revision 1.9
retrieving revision 1.9.2.1
diff -C2 -r1.9 -r1.9.2.1
*** functions_post.php 3 Apr 2002 14:38:56 -0000 1.9
--- functions_post.php 5 Apr 2002 19:48:56 -0000 1.9.2.1
***************
*** 23,27 ****
if ( !defined('IN_PHPBB') )
{
! die("Hacking attempt");
}
--- 23,27 ----
if ( !defined('IN_PHPBB') )
{
! die('Hacking attempt');
}
***************
*** 381,385 ****
global $db;
! $sign = ( $mode == 'delete' ) ? "- 1" : "+ 1";
$forum_update_sql = "forum_posts = forum_posts $sign";
$topic_update_sql = '';
--- 381,385 ----
global $db;
! $sign = ( $mode == 'delete' ) ? '- 1' : '+ 1';
$forum_update_sql = "forum_posts = forum_posts $sign";
$topic_update_sql = '';
***************
*** 396,400 ****
{
! $topic_update_sql = "topic_replies = topic_replies - 1";
$sql = "SELECT MAX(post_id) AS post_id
--- 396,400 ----
{
! $topic_update_sql .= "topic_replies = topic_replies - 1";
$sql = "SELECT MAX(post_id) AS post_id
***************
*** 440,445 ****
if ( $row = $db->sql_fetchrow($result) )
{
! $topic_update_sql = 'topic_replies = topic_replies - 1, topic_first_post_id = ' . $row['post_id'];
}
}
}
--- 440,449 ----
if ( $row = $db->sql_fetchrow($result) )
{
! $topic_update_sql .= 'topic_replies = topic_replies - 1, topic_first_post_id = ' . $row['post_id'];
}
+ }
+ else
+ {
+ $topic_update_sql .= 'topic_replies = topic_replies - 1';
}
}
|