diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-05-27 16:24:21 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-05-27 16:24:21 +0000 |
commit | ce4445f74a28eaee02c8d90c1a04a759cf88a9c3 (patch) | |
tree | fc3af067265d1df62ec14ae912fa5333a535b789 /phpBB/includes/functions_posting.php | |
parent | b51b978854adf0e5cd902f01cd2da9f34f19429d (diff) | |
download | forums-ce4445f74a28eaee02c8d90c1a04a759cf88a9c3.tar forums-ce4445f74a28eaee02c8d90c1a04a759cf88a9c3.tar.gz forums-ce4445f74a28eaee02c8d90c1a04a759cf88a9c3.tar.bz2 forums-ce4445f74a28eaee02c8d90c1a04a759cf88a9c3.tar.xz forums-ce4445f74a28eaee02c8d90c1a04a759cf88a9c3.zip |
- remove description from profile fields
- added disclaimer about DEBUG_EXTRA to the ACP (i think this is needed - some idiots might think it is wise to have this enabled on a production board. :) We *may* let it there for the Betas though, but it will be removed during the RC's)
- some bugfixes
git-svn-id: file:///svn/phpbb/trunk@5973 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_posting.php')
-rw-r--r-- | phpBB/includes/functions_posting.php | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 9d642457a4..b4b44b8c16 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1118,7 +1118,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data) $db->sql_transaction(); - if (!delete_posts('post_id', array($post_id), false)) + if (!delete_posts('post_id', array($post_id), false, false)) { // Try to delete topic, we may had an previous error causing inconsistency if ($post_mode = 'delete_topic') @@ -1252,6 +1252,27 @@ function delete_post($forum_id, $topic_id, $post_id, &$data) $db->sql_transaction('commit'); + // Adjust posted info for this user by looking for a post by him/her within this topic... + if ($post_mode != 'delete_topic' && $config['load_db_track'] && $user->data['is_registered']) + { + $sql = 'SELECT poster_id + FROM ' . POSTS_TABLE . ' + WHERE topic_id = ' . $topic_id . ' + AND poster_id = ' . $user->data['user_id']; + $result = $db->sql_query_limit($sql, 1); + $poster_id = (int) $db->sql_fetchfield('poster_id'); + $db->sql_freeresult($result); + + // The user is not having any more posts within this topic + if (!$poster_id) + { + $sql = 'DELETE FROM ' . TOPICS_POSTED_TABLE . ' + WHERE topic_id = ' . $topic_id . ' + AND user_id = ' . $user->data['user_id']; + $db->sql_query($sql); + } + } + return $next_post_id; } |