diff options
| author | Meik Sievertsen <acydburn@phpbb.com> | 2006-11-15 15:35:50 +0000 |
|---|---|---|
| committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-11-15 15:35:50 +0000 |
| commit | 548cc2c10b56cc9e5c71c2f87356947939abe888 (patch) | |
| tree | 82a2ceac1eb474aad83281f5d5b4fe94b0ad4d92 /phpBB/includes/functions_admin.php | |
| parent | 979e36077fa6ae9bbee81bacaaef029aa13c6df0 (diff) | |
| download | forums-548cc2c10b56cc9e5c71c2f87356947939abe888.tar forums-548cc2c10b56cc9e5c71c2f87356947939abe888.tar.gz forums-548cc2c10b56cc9e5c71c2f87356947939abe888.tar.bz2 forums-548cc2c10b56cc9e5c71c2f87356947939abe888.tar.xz forums-548cc2c10b56cc9e5c71c2f87356947939abe888.zip | |
- fixes for the following bugs:
#5326
#5318
#5304
#5290
#5288
#5278
#5276
#5272
#5266
- also fixed the "Call-time pass-by-reference" bug #5252
- within this step changed the normalize calls to require references.
- added captcha size variables to the class scope (suggestion was posted at area51)
git-svn-id: file:///svn/phpbb/trunk@6584 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_admin.php')
| -rw-r--r-- | phpBB/includes/functions_admin.php | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index c85802dafb..1655c56eec 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -482,6 +482,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true) { global $db, $config; + $approved_topics = 0; $forum_ids = $topic_ids = array(); if (is_array($where_ids)) @@ -502,7 +503,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true) 'posts' => delete_posts($where_type, $where_ids, false, true) ); - $sql = 'SELECT topic_id, forum_id + $sql = 'SELECT topic_id, forum_id, topic_approved FROM ' . TOPICS_TABLE . ' WHERE ' . $db->sql_in_set($where_type, $where_ids); $result = $db->sql_query($sql); @@ -511,6 +512,11 @@ function delete_topics($where_type, $where_ids, $auto_sync = true) { $forum_ids[] = $row['forum_id']; $topic_ids[] = $row['topic_id']; + + if ($row['topic_approved']) + { + $approved_topics++; + } } $db->sql_freeresult($result); @@ -545,7 +551,10 @@ function delete_topics($where_type, $where_ids, $auto_sync = true) sync('topic_reported', $where_type, $where_ids); } - set_config('num_topics', $config['num_topics'] - sizeof($return['topics']), true); + if ($approved_topics) + { + set_config('num_topics', $config['num_topics'] - $approved_topics, true); + } return $return; } @@ -571,9 +580,10 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = return false; } + $approved_posts = 0; $post_ids = $topic_ids = $forum_ids = $post_counts = array(); - $sql = 'SELECT post_id, poster_id, post_postcount, topic_id, forum_id + $sql = 'SELECT post_id, poster_id, post_approved, post_postcount, topic_id, forum_id FROM ' . POSTS_TABLE . ' WHERE ' . $db->sql_in_set($where_type, array_map('intval', $where_ids)); $result = $db->sql_query($sql); @@ -589,6 +599,11 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = { $post_counts[$row['poster_id']] = (!empty($post_counts[$row['poster_id']])) ? $post_counts[$row['poster_id']] + 1 : 1; } + + if ($row['post_approved']) + { + $approved_posts++; + } } $db->sql_freeresult($result); @@ -658,7 +673,10 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = sync('forum', 'forum_id', $forum_ids, true); } - set_config('num_posts', $config['num_posts'] - sizeof($post_ids), true); + if ($approved_posts) + { + set_config('num_posts', $config['num_posts'] - $approved_posts, true); + } return sizeof($post_ids); } |
