1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-11 03:04:09 +02:00

[ticket/6712] Bump does not create new topic icon on index.

Handle the topic bumping process more properly.

PHPBB3-6712
This commit is contained in:
rxu
2010-10-18 21:25:52 +08:00
parent acabe5a013
commit 4091f873ea
2 changed files with 92 additions and 29 deletions

View File

@@ -321,35 +321,7 @@ if ($mode == 'bump')
if ($bump_time = bump_topic_allowed($forum_id, $post_data['topic_bumped'], $post_data['topic_last_post_time'], $post_data['topic_poster'], $post_data['topic_last_poster_id'])
&& check_link_hash(request_var('hash', ''), "topic_{$post_data['topic_id']}"))
{
$db->sql_transaction('begin');
$sql = 'UPDATE ' . POSTS_TABLE . "
SET post_time = $current_time
WHERE post_id = {$post_data['topic_last_post_id']}
AND topic_id = $topic_id";
$db->sql_query($sql);
$sql = 'UPDATE ' . TOPICS_TABLE . "
SET topic_last_post_time = $current_time,
topic_bumped = 1,
topic_bumper = " . $user->data['user_id'] . "
WHERE topic_id = $topic_id";
$db->sql_query($sql);
update_post_information('forum', $forum_id);
$sql = 'UPDATE ' . USERS_TABLE . "
SET user_lastpost_time = $current_time
WHERE user_id = " . $user->data['user_id'];
$db->sql_query($sql);
$db->sql_transaction('commit');
markread('post', $forum_id, $topic_id, $current_time);
add_log('mod', $forum_id, $topic_id, 'LOG_BUMP_TOPIC', $post_data['topic_title']);
$meta_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&p={$post_data['topic_last_post_id']}") . "#p{$post_data['topic_last_post_id']}";
$meta_url = bump_topic($forum_id, $topic_id, $post_data, $current_time);
meta_refresh(3, $meta_url);
$message = $user->lang['TOPIC_BUMPED'] . '<br /><br />' . sprintf($user->lang['VIEW_MESSAGE'], '<a href="' . $meta_url . '">', '</a>');