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_post.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_post.php')
| -rw-r--r-- | phpBB/includes/mcp/mcp_post.php | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php index 3717c8df90..67f5472134 100644 --- a/phpBB/includes/mcp/mcp_post.php +++ b/phpBB/includes/mcp/mcp_post.php @@ -22,7 +22,7 @@ function mcp_post_details($id, $mode, $action) $start = request_var('start', 0); // Get post data - $post_info = get_post_data(array($post_id)); + $post_info = get_post_data(array($post_id), false, true); if (!sizeof($post_info)) { @@ -91,6 +91,21 @@ function mcp_post_details($id, $mode, $action) // Set some vars $users_ary = $usernames_ary = array(); $post_id = $post_info['post_id']; + $topic_tracking_info = array(); + + // Get topic tracking info + if ($config['load_db_lastread']) + { + $tmp_topic_data = array($post_info['topic_id'] => $post_info); + $topic_tracking_info = get_topic_tracking($post_info['forum_id'], $post_info['topic_id'], $tmp_topic_data, array($post_info['forum_id'] => $post_info['forum_mark_time'])); + unset($tmp_topic_data); + } + else + { + $topic_tracking_info = get_complete_topic_tracking($post_info['forum_id'], $post_info['topic_id']); + } + + $post_unread = (isset($topic_tracking_info[$post_info['topic_id']]) && $post_info['post_time'] > $topic_tracking_info[$post_info['topic_id']]) ? true : false; // Process message, leave it uncensored $message = $post_info['post_text']; @@ -127,7 +142,9 @@ function mcp_post_details($id, $mode, $action) 'U_MCP_WARN_USER' => ($auth->acl_getf_global('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $post_info['user_id']) : '', 'U_VIEW_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&p=' . $post_info['post_id'] . '#p' . $post_info['post_id']), 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&t=' . $post_info['topic_id']), - + + 'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'NEW_POST') : $user->img('icon_post_target', 'POST'), + 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$post_info['forum_id']}&p=$post_id") . "#p$post_id\">", '</a>'), 'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", "f={$post_info['forum_id']}&start={$start}") . '">', '</a>'), 'REPORTED_IMG' => $user->img('icon_topic_reported', $user->lang['POST_REPORTED']), |
