diff options
author | Nils Adermann <naderman@naderman.de> | 2007-01-27 16:04:58 +0000 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2007-01-27 16:04:58 +0000 |
commit | aa8ebc7bf3126e21b07fffffb50ac49fc7215fad (patch) | |
tree | 76680ebd31a4163a77a09319b71d91f048bc2c00 /phpBB/includes/mcp/mcp_topic.php | |
parent | 14e209a487abc134812147907ef4e03d2850a767 (diff) | |
download | forums-aa8ebc7bf3126e21b07fffffb50ac49fc7215fad.tar forums-aa8ebc7bf3126e21b07fffffb50ac49fc7215fad.tar.gz forums-aa8ebc7bf3126e21b07fffffb50ac49fc7215fad.tar.bz2 forums-aa8ebc7bf3126e21b07fffffb50ac49fc7215fad.tar.xz forums-aa8ebc7bf3126e21b07fffffb50ac49fc7215fad.zip |
- introducing read/unread images in the MCP, if you view something through the MCP it will not update the "read" status of a post/topic/forum [includes Bug #6796]
git-svn-id: file:///svn/phpbb/trunk@6936 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/mcp/mcp_topic.php')
-rw-r--r-- | phpBB/includes/mcp/mcp_topic.php | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index 09b3f6f314..716b7a1529 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -21,7 +21,7 @@ function mcp_topic_view($id, $mode, $action) $user->add_lang('viewtopic'); $topic_id = request_var('t', 0); - $topic_info = get_topic_data(array($topic_id)); + $topic_info = get_topic_data(array($topic_id), false, true); if (!sizeof($topic_info)) { @@ -118,6 +118,20 @@ function mcp_topic_view($id, $mode, $action) $bbcode = new bbcode(base64_encode($bbcode_bitfield)); } + $topic_tracking_info = array(); + + // Get topic tracking info + if ($config['load_db_lastread']) + { + $tmp_topic_data = array($topic_id => $topic_info); + $topic_tracking_info = get_topic_tracking($topic_info['forum_id'], $topic_id, $tmp_topic_data, array($topic_info['forum_id'] => $topic_info['forum_mark_time'])); + unset($tmp_topic_data); + } + else + { + $topic_tracking_info = get_complete_topic_tracking($topic_info['forum_id'], $topic_id); + } + foreach ($rowset as $i => $row) { $has_unapproved_posts = false; @@ -138,6 +152,8 @@ function mcp_topic_view($id, $mode, $action) $has_unapproved_posts = true; } + $post_unread = (isset($topic_tracking_info[$topic_id]) && $row['post_time'] > $topic_tracking_info[$topic_id]) ? true : false; + $template->assign_block_vars('postrow', array( 'POST_AUTHOR_FULL' => get_username_string('full', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), 'POST_AUTHOR_COLOUR' => get_username_string('colour', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), @@ -150,7 +166,7 @@ function mcp_topic_view($id, $mode, $action) 'POST_ID' => $row['post_id'], 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $topic_id) . '">', '</a>'), - 'MINI_POST_IMG' => ($row['post_time'] > $user->data['user_lastvisit'] && $user->data['is_registered']) ? $user->img('icon_post_target_unread', $user->lang['NEW_POST']) : $user->img('icon_post_target', $user->lang['POST']), + 'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'NEW_POST') : $user->img('icon_post_target', 'POST'), 'S_POST_REPORTED' => ($row['post_reported']) ? true : false, 'S_POST_UNAPPROVED' => ($row['post_approved']) ? false : true, |