diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-05-28 19:15:24 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-05-28 19:15:24 +0000 |
commit | 19a36ed364ffdc4da784a253baa8aa2a8ac6845a (patch) | |
tree | a355181dc26b47abb2c34228fe32a92fd40df28d /phpBB/includes/mcp | |
parent | ebf4f4ec8e787153e16cc6cec6fc5fefadc97107 (diff) | |
download | forums-19a36ed364ffdc4da784a253baa8aa2a8ac6845a.tar forums-19a36ed364ffdc4da784a253baa8aa2a8ac6845a.tar.gz forums-19a36ed364ffdc4da784a253baa8aa2a8ac6845a.tar.bz2 forums-19a36ed364ffdc4da784a253baa8aa2a8ac6845a.tar.xz forums-19a36ed364ffdc4da784a253baa8aa2a8ac6845a.zip |
- adjusted coding guidelines
- fixed custom bbcode {TEXT} token
- added unapproved item/info for unapproved posts in a topic
git-svn-id: file:///svn/phpbb/trunk@5982 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/mcp')
-rw-r--r-- | phpBB/includes/mcp/mcp_forum.php | 19 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_post.php | 7 |
2 files changed, 15 insertions, 11 deletions
diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index 0d07f3f0f6..994784e2ac 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -107,11 +107,6 @@ function mcp_forum_view($id, $mode, $action, $forum_info) { $topic_title = ''; - if ($auth->acl_get('m_approve', $row['forum_id'])) - { - $row['topic_replies'] = $row['topic_replies_real']; - } - if ($row['topic_status'] == ITEM_LOCKED) { $folder_img = 'folder_locked'; @@ -165,12 +160,16 @@ function mcp_forum_view($id, $mode, $action, $forum_info) $topic_title = censor_text($row['topic_title']); + $topic_unapproved = (!$row['topic_approved'] && $auth->acl_gets('m_approve', $row['forum_id'])) ? true : false; + $posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_gets('m_approve', $row['forum_id'])) ? true : false; + $u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? $url . '&i=queue&mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . '&t=' . $row['topic_id'] : ''; + $template->assign_block_vars('topicrow', array( 'U_VIEW_TOPIC' => "{$phpbb_root_path}mcp.$phpEx$SID&i=$id&f=$forum_id&t={$row['topic_id']}&mode=topic_view", 'S_SELECT_TOPIC' => ($action == 'merge_select' && $row['topic_id'] != $topic_id) ? true : false, 'U_SELECT_TOPIC' => $url . "&i=$id&mode=topic_view&action=merge&to_topic_id=" . $row['topic_id'] . $selected_ids, - 'U_MCP_QUEUE' => $url . '&i=queue&mode=approve_details&t=' . $row['topic_id'], + 'U_MCP_QUEUE' => $u_mcp_queue, 'U_MCP_REPORT' => "{$phpbb_root_path}mcp.$phpEx$SID&i=main&mode=topic_view&t={$row['topic_id']}&action=reports", 'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $row['forum_id']) && $row['topic_attachment']) ? $user->img('icon_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', @@ -179,16 +178,18 @@ function mcp_forum_view($id, $mode, $action, $forum_info) 'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '', 'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '', 'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '', + 'UNAPPROVED_IMG' => ($topic_unapproved || $posts_unapproved) ? $user->img('icon_unapproved', ($topic_unapproved) ? 'TOPIC_UNAPPROVED' : 'POSTS_UNAPPROVED') : '', 'TOPIC_TYPE' => $topic_type, 'TOPIC_TITLE' => $topic_title, - 'REPLIES' => $row['topic_replies'], + 'REPLIES' => ($auth->acl_get('m_approve', $row['forum_id'])) ? $row['topic_replies_real'] : $row['topic_replies'], 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), 'TOPIC_ID' => $row['topic_id'], 'S_TOPIC_CHECKED' => ($topic_id_list && in_array($row['topic_id'], $topic_id_list)) ? 'checked="checked" ' : '', - 'S_TOPIC_REPORTED' => ($row['topic_reported']) ? true : false, - 'S_TOPIC_UNAPPROVED'=> ($row['topic_approved']) ? false : true) + 'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_gets('m_report', $row['forum_id'])) ? true : false, + 'S_TOPIC_UNAPPROVED' => $topic_unapproved, + 'S_POSTS_UNAPPROVED' => $posts_unapproved) ); } unset($topic_rows); diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php index 106af1e2ed..f2fef8af6e 100644 --- a/phpBB/includes/mcp/mcp_post.php +++ b/phpBB/includes/mcp/mcp_post.php @@ -312,7 +312,7 @@ function mcp_post_details($id, $mode, $action) */ function change_poster(&$post_info, $userdata) { - global $auth, $db; + global $auth, $db, $config; if (empty($userdata) || $userdata['user_id'] == $post_info['user_id']) { @@ -383,6 +383,9 @@ function change_poster(&$post_info, $userdata) // Do not change the poster_id within the attachments table, since they were still posted by the original user + $from_username = $post_info['username']; + $to_username = $userdata['username']; + // Renew post info $post_info = get_post_data(array($post_id)); @@ -394,7 +397,7 @@ function change_poster(&$post_info, $userdata) $post_info = $post_info[$post_id]; // Now add log entry - add_log('mod', $post_info['forum_id'], $post_info['topic_id'], 'LOG_MCP_CHANGE_POSTER', $post_info['topic_title'], $post_info['username'], $userdata['username']); + add_log('mod', $post_info['forum_id'], $post_info['topic_id'], 'LOG_MCP_CHANGE_POSTER', $post_info['topic_title'], $from_username, $to_username); } ?>
\ No newline at end of file |