From 9d2989b9272e89904a0b9a6a3a3376dc793a3ed1 Mon Sep 17 00:00:00 2001 From: Ludovic Arnaud Date: Thu, 13 Mar 2003 01:12:52 +0000 Subject: [PATCH] MCP updates. The resync function can now resync 'topic_reported' and 'topic_approved' flags git-svn-id: file:///svn/phpbb/trunk@3645 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/mcp.php | 806 ++++++++++++++++------ phpBB/templates/subSilver/mcp_forum.html | 5 +- phpBB/templates/subSilver/mcp_header.html | 23 +- phpBB/templates/subSilver/mcp_move.html | 19 +- phpBB/templates/subSilver/mcp_queue.html | 50 ++ phpBB/templates/subSilver/mcp_topic.html | 43 +- 6 files changed, 714 insertions(+), 232 deletions(-) create mode 100644 phpBB/templates/subSilver/mcp_queue.html diff --git a/phpBB/mcp.php b/phpBB/mcp.php index 7df646c6a9..47d78d4a85 100644 --- a/phpBB/mcp.php +++ b/phpBB/mcp.php @@ -23,6 +23,7 @@ // // * Plug-in based? // * Add session_id checks for all Moderator ops +// * Tab based system // * Front page: // * Select box listing all forums to which user has moderator rights // * Five(?) most recent Moderator log entries (for relevant forum/s) @@ -34,6 +35,10 @@ // * Topic view: // * As current(?) plus differing colours for Approved/Unapproved topics/posts // * When moving topics to forum for which Mod doesn't have Mod rights set for Mod approval +// * Split topic: +// * As current but need better way of listing all posts +// * Merge topics: +// * Similar to split(?) but reverse // * Find duplicates: // * List supiciously similar posts across forum/s // * "Ban" user/s: @@ -52,7 +57,6 @@ $user->setup(); $auth->acl($user->data); // End session management - // temp temp temp very_temporary_lang_strings(); // temp temp temp @@ -65,7 +69,6 @@ $topic_id = (!empty($_REQUEST['t'])) ? intval($_REQUEST['t']) : ''; $post_id = (!empty($_REQUEST['p'])) ? intval($_REQUEST['p']) : ''; $start = (!empty($_REQUEST['start'])) ? intval($_REQUEST['start']) : 0; - // // Check if user did or did not confirm // If they did not, forward them to the last page they were on @@ -74,15 +77,15 @@ if (isset($_POST['cancel'])) { if ($topic_id > 0) { - $redirect = "viewtopic.$phpEx$SID&t=$topic_id&start=$start"; + $redirect = ($quickmod) ? "viewtopic.$phpEx$SID&t=$topic_id&start=$start" : "mcp.$phpEx$SID&t=$topic_id&start=$start"; } elseif ($forum_id > 0) { - $redirect = "viewforum.$phpEx$SID&f=$forum_id&start=$start"; + $redirect = ($quickmod) ? "viewforum.$phpEx$SID&t=$forum_id&start=$start" : "mcp.$phpEx$SID&t=$forum_id&start=$start"; } else { - $redirect = "index.$phpEx$SID"; + $redirect = ($quickmod) ? "index.$phpEx$SID" : "mcp.$phpEx$SID"; } redirect($redirect); @@ -103,7 +106,7 @@ $quickmod = (!empty($_REQUEST['quickmod'])) ? TRUE : FALSE; $subject = (!empty($_REQUEST['subject'])) ? $_REQUEST['subject'] : ''; -$post_modes = array('move', 'delete_topics', 'lock', 'unlock', 'merge_posts', 'delete_posts', 'split_all', 'split_beyond', 'select_topic', 'resync'); +$post_modes = array('approve', 'move', 'delete_topics', 'lock', 'unlock', 'merge_posts', 'delete_posts', 'split_all', 'split_beyond', 'select_topic', 'resync'); foreach ($post_modes as $post_mode) { if (isset($_POST[$post_mode])) @@ -154,6 +157,12 @@ $return_mode = '

' . sprintf($user->lang['RETURN_MCP'], '', ''); -if ($forum_id) +if ($forum_id && $forum_data[$forum_id]['forum_postable'] && $auth->acl_gets('m_', 'a_', $forum_id)) { $tabs['forum_view'] = $mcp_url . '&mode=forum_view'; } -if ($topic_id) +if ($topic_id && $auth->acl_gets('m_delete', 'm_split', 'm_merge', 'm_approve', 'a_', $forum_id)) { $tabs['topic_view'] = $mcp_url . '&mode=topic_view' . $url_extra; } -if ($post_id) +if ($post_id && $auth->acl_gets('m_', 'a_', $forum_id)) { $tabs['post_details'] = $mcp_url . '&mode=post_details'; } -if (!$forum_info['forum_postable']) +if ($forum_id > 0 && !$forum_info['forum_postable']) { if ($mode) { - trigger_error('Line : ' . __LINE__ . '

' . $user->lang['FORUM_NOT_POSTABLE'] . $return_mcp); + trigger_error($user->lang['FORUM_NOT_POSTABLE'] . $return_mcp); } else { @@ -429,6 +438,7 @@ switch ($mode) $tabs[$mode] = $mcp_url . '&=' . $mode . $url_extra; break; } + // Get the current tab from the mode // TODO: find a better way to handle this $tabs_mode = array( @@ -454,17 +464,16 @@ foreach ($tabs as $tab_name => $tab_link) } // -// Do major work... +// Do major work ... (<= being the 1-billion dollars man) // // Current modes: +// - set_* Change topic type // - resync Resyncs topics // - delete_posts Delete posts, displays confirmation if unconfirmed // - delete_topics Delete topics, displays confirmation // - select_topic Forward the user to forum view to select a destination topic for the merge // - merge Topic view, only displays the Merge button // - split Topic view, only displays the split buttons -// - split_all Actually split selected topic -// - split_beyond Actually split selected topic // - delete Topic view, only displays the Delete button // - topic_view Topic view, similar to viewtopic.php // - forum_view Forum view, similar to viewforum.php @@ -472,6 +481,8 @@ foreach ($tabs as $tab_name => $tab_link) // - lock, unlock Lock or unlock topic(s). No confirmation. Used for quickmod. // - merge_posts Actually merge posts to selected topic. Untested yet. // - ip Displays poster's ip and other ips the user has posted from. (imported straight from 2.0.x) +// - split_all Actually split selected topic +// - split_beyond Actually split selected topic // // TODO: // - post_details Displays post details. Has quick links to (un)approve post. @@ -484,42 +495,197 @@ foreach ($tabs as $tab_name => $tab_link) switch ($mode) { - case 'resync': - resync('topic', 'topic_id', $topic_id_list); + case 'set_announce': + case 'set_sticky': + case 'set_normal': + $topic_type = constant('POST_' . strtoupper(preg_replace('/set_([a-z]+)/', '\1', $mode))); + $sql = 'UPDATE ' . TOPICS_TABLE . " + SET topic_type = $topic_type + WHERE topic_id IN (" . implode(', ', $topic_id_list) . ')'; + $db->sql_query($sql); + + $return_forum = sprintf($user->lang['RETURN_FORUM'], "", ''); + $return_topic = sprintf($user->lang['RETURN_TOPIC'], "", ''); + + $template->assign_vars(array( + 'META' => "" + )); + + add_log('mod', $forum_id, $topic_id, $mode); + + trigger_error($user->lang['TOPIC_TYPE_CHANGED'] . '

' . $return_topic . '

' . $return_forum); + break; + + case 'disapprove': + break; + + case 'approve': + case 'unapprove': + $value = ($mode == 'approve') ? 1 : 0; + + if (count($post_id_list)) + { + $log_mode = 'log_post_approved'; + + $sql = 'UPDATE ' . POSTS_TABLE . " + SET post_approved = $value + WHERE post_id IN (" . implode(', ', $post_id_list) . ')'; + $db->sql_query($sql); + + if (count($post_id_list) == 1) + { + $lang_str = ($mode == 'approve') ? 'POST_APPROVED' : 'POST_UNAPPROVED'; + } + else + { + $lang_str = ($mode == 'approve') ? 'POSTS_APPROVED' : 'POSTS_UNAPPROVED'; + } + + $redirect_page = "viewtopic.$phpEx$SID&t=$topic_id&start=$start"; + $l_redirect = sprintf($user->lang['RETURN_TOPIC'], '', ''); + } + elseif (count($topic_id_list)) + { + $log_mode = 'log_topic_approved'; + + $sql = 'UPDATE ' . TOPICS_TABLE . " + SET topic_approved = $value + WHERE topic_id IN (" . implode(', ', $topic_id_list) . ')'; + $db->sql_query($sql); + + if (count($topic_id_list) == 1) + { + $lang_str = ($mode == 'approve') ? 'TOPIC_APPROVED' : 'TOPIC_UNAPPROVED'; + } + else + { + $lang_str = ($mode == 'approve') ? 'TOPICS_APPROVED' : 'TOPICS_UNAPPROVED'; + } + + $redirect_page = "viewforum.$phpEx$SID&f=$forum_id&start=$start"; + $l_redirect = sprintf($user->lang['RETURN_FORUM'], '', ''); + } + + resync('approved', 'topic_id', $topic_id_list); + + $template->assign_vars(array( + 'META' => '') + ); + + foreach ($topic_id_list as $topic_id) + { + add_log('mod', $forum_id, $topic_id, $log_mode); + } + trigger_error($user->lang[$lang_str] . '

' . $l_redirect . $return_mcp); + break; + + case 'mod_queue': + $forum_nav = ($forum_id) ? TRUE : FALSE; + + mcp_header('mcp_queue.html', $forum_nav, 'mod_queue'); + + $sql = 'SELECT p.post_id, p.post_subject, p.post_time, p.poster_id, p.post_username, u.username, t.topic_id, t.topic_title, t.topic_first_post_id, f.forum_id, f.forum_name + FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f, ' . USERS_TABLE . ' u + WHERE p.forum_id = f.forum_id + AND p.topic_id = t.topic_id + AND p.poster_id = u.user_id + AND p.post_approved = 0 + ' . (($forum_id > 0) ? " AND p.forum_id = $forum_id" : '') . ' + ORDER BY t.topic_approved ASC'; + + $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start); + + if (!$row = $db->sql_fetchrow($result)) + { + + } + else + { + $header = ''; + + do + { + if ($row['poster_id'] == ANONYMOUS) + { + $author = ($row['post_username']) ? $row['post_username'] : $user->lang['Guest']; + } + else + { + $author = '' . $row['username'] . ''; + } + + $posts_header = FALSE; + $topics_header = FALSE; + if ($row['post_id'] == $row['topic_first_post_id'] && $header != 'topics') + { + $header = 'topics'; + $topics_header = TRUE; + } + elseif ($header != 'posts') + { + $header = 'posts'; + $posts_header = TRUE; + } + + $template->assign_block_vars('postrow', array( + 'S_POSTS_HEADER' => $posts_header, + 'S_TOPICS_HEADER' => $topics_header, + + 'U_POST_DETAILS' => $mcp_url . '&mode=post_details', + 'FORUM' => '' . $row['forum_name'] . '', + 'TOPIC' => '' . $row['topic_title'] . '', + 'AUTHOR' => $author, + 'SUBJECT' => '' . (($row['post_subject']) ? $row['post_subject'] : $user->lang['NO_SUBJECT']) . '', + 'POST_TIME' => $user->format_date($row['post_time']), + 'S_CHECKBOX' => '' + )); + } + while ($row = $db->sql_fetchrow($result)); + } + break; + + case 'resync': $redirect_page = "mcp.$phpEx$SID&f=$forum_id"; $l_redirect = sprintf($user->lang['RETURN_MCP'], '', ''); + if (!count($topic_id_list)) + { + trigger_error($user->lang['NO_TOPIC_SELECTED'] . '

' . $l_redirect); + } + + resync('topic', 'topic_id', $topic_id_list); + $template->assign_vars(array( 'META' => '') ); $msg = (count($topic_id_list) == 1) ? $user->lang['TOPIC_RESYNCHRONISED'] : $user->lang['TOPICS_RESYNCHRONISED']; - trigger_error('Line : ' . __LINE__ . '

' . $msg . '

' . $l_redirect); + trigger_error($msg . '

' . $l_redirect); break; case 'delete_posts': // TODO: what happens if the user deletes the first post of the topic? Currently, the topic is resync'ed normally and topic time/topic author are updated by the new first post + $redirect_page = "mcp.$phpEx$SID&f=$forum_id"; + $l_redirect = sprintf($user->lang['RETURN_MCP'], '', ''); + if (!count($post_id_list)) { - trigger_error('Line : ' . __LINE__ . '

' . $user->lang['None_selected']); + trigger_error($user->lang['NO_POST_SELECTED'] . '

' . $l_redirect); } if ($confirm) { delete_posts('post_id', $post_id_list); - $redirect_page = "mcp.$phpEx$SID&f=$forum_id"; - $l_redirect = sprintf($user->lang['RETURN_MCP'], '', ''); - $template->assign_vars(array( 'META' => '') ); $msg = (count($post_id_list) == 1) ? $user->lang['POST_REMOVED'] : $user->lang['POSTS_REMOVED']; - trigger_error('Line : ' . __LINE__ . '

' . $msg . '

' . $l_redirect); + trigger_error($msg . '

' . $l_redirect); } // Not confirmed, show confirmation message @@ -545,31 +711,31 @@ switch ($mode) break; case 'delete_topics': - if (!$topic_id_list) + if ($quickmod) { - trigger_error('Line : ' . __LINE__ . '

' . $user->lang['None_selected']); + $redirect_page = "viewforum.$phpEx$SID&f=$forum_id&start=$start"; + $l_redirect = sprintf($user->lang['RETURN_FORUM'], '', ''); + } + else + { + $redirect_page = "mcp.$phpEx$SID&f=$forum_id&start=$start"; + $l_redirect = sprintf($user->lang['RETURN_MCP'], '', ''); + } + + if (!count($topic_id_list)) + { + trigger_error($user->lang['NO_TOPIC_SELECTED'] . '

' . $l_redirect); } if ($confirm) { delete_topics('topic_id', $topic_id_list); - if ($quickmod) - { - $redirect_page = ""; - $l_redirect = sprintf($user->lang['RETURN_FORUM'], '', ''); - } - else - { - $redirect_page = "mcp.$phpEx$SID&f=$forum_id"; - $l_redirect = sprintf($user->lang['RETURN_MCP'], '', ''); - } - $template->assign_vars(array( 'META' => '') ); - trigger_error('Line : ' . __LINE__ . '

' . $user->lang['Topics_Removed'] . '

' . $l_redirect); + trigger_error($user->lang['TOPICS_REMOVED'] . '

' . $l_redirect); } // Not confirmed, show confirmation message @@ -602,6 +768,15 @@ switch ($mode) $posts_per_page = (isset($_REQUEST['posts_per_page'])) ? intval($_REQUEST['posts_per_page']) : $config['posts_per_page']; +/* + // Temp fix for merge: display all posts after the topic has been selected to avoid any confusion + if ($to_topic_id) + { + $sort_days = 0; + $posts_per_page = 0; + } +*/ + // Following section altered for consistency with viewforum, viewtopic, etc. // Post ordering options $limit_days = array(0 => $user->lang['ALL_POSTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 364 => $user->lang['1_YEAR']); @@ -641,11 +816,10 @@ switch ($mode) AND p.poster_id = u.user_id $limit_posts_time ORDER BY $sort_order"; - - $start = ($posts_per_page == 0) ? 0 : $start; $result = $db->sql_query_limit($sql, $posts_per_page, $start); $i = 0; + $has_unapproved_posts = FALSE; while ($row = $db->sql_fetchrow($result)) { $poster = (!empty($row['username'])) ? $row['username'] : ((!$row['post_username']) ? $user->lang['GUEST'] : $row['post_username']); @@ -670,6 +844,11 @@ switch ($mode) $checked = (in_array(intval($row['post_id']), $selected_post_ids)) ? 'checked="checked" ' : ''; $s_checkbox = ($row['post_id'] == $topic_info['topic_first_post_id'] && $mode == 'split') ? ' ' : ''; + if (!$row['post_approved']) + { + $has_unapproved_posts = TRUE; + } + $template->assign_block_vars('postrow', array( 'POSTER_NAME' => $poster, 'POST_DATE' => $user->format_date($row['post_time']), @@ -678,10 +857,12 @@ switch ($mode) 'POST_ID' => $row['post_id'], 'S_CHECKBOX' => $s_checkbox, - 'S_ROW_COUNT' => $i++, 'S_DISPLAY_MODES' => ($i % 10 == 0) ? TRUE : FALSE, + 'S_ROW_COUNT' => $i++, + 'S_POST_UNAPPROVED' => ($row['post_approved']) ? FALSE : TRUE, - 'U_POST_DETAILS' => $mcp_url . '&p=' . $row['post_id'] . '&mode=post_details' + 'U_POST_DETAILS' => $mcp_url . '&p=' . $row['post_id'] . '&mode=post_details', + 'U_APPROVE' => "mcp.$phpEx$SID&mode=approve&p=" . $row['post_id'] )); } @@ -709,23 +890,24 @@ switch ($mode) } } - // Minor change to order selects for consistency with viewforum, viewtopic - Paul $template->assign_vars(array( 'TOPIC_TITLE' => $topic_info['topic_title'], 'U_VIEW_TOPIC' => "viewtopic.$phpEx$SID&t=$topic_id", 'TO_TOPIC_ID' => ($to_topic_id) ? $to_topic_id : '', - 'TO_TOPIC_EXPLAIN' => ($to_topic_id) ? sprintf($user->lang['Topic_number_is'], $to_topic_id, '' . htmlspecialchars($topic_data[$to_topic_id]['topic_title']) . '') : '', + 'TO_TOPIC_INFO' => ($to_topic_id) ? sprintf($user->lang['TOPIC_NUMBER_IS'], $to_topic_id, '' . htmlspecialchars($topic_data[$to_topic_id]['topic_title']) . '') : '', 'SPLIT_SUBJECT' => $subject, - 'POSTS_PER_PAGE' => $posts_per_page, + 'UNAPPROVED_IMG' => $user->img('icon_warning', 'POST_NOT_BEEN_APPROVED', FALSE, TRUE), + 'S_FORM_ACTION' => "mcp.$phpEx$SID&mode=$mode&t=$topic_id&start=$start", 'S_FORUM_SELECT' => '', 'S_CAN_SPLIT' => ($auth->acl_gets('m_split', 'a_', $forum_id) &&($mode == 'topic_view' || $mode == 'split')) ? TRUE : FALSE, 'S_CAN_MERGE' => ($auth->acl_gets('m_merge', 'a_', $forum_id) &&($mode == 'topic_view' || $mode == 'merge')) ? TRUE : FALSE, 'S_CAN_DELETE' => ($auth->acl_gets('m_delete', 'a_', $forum_id) &&($mode == 'topic_view' || $mode == 'delete')) ? TRUE : FALSE, + 'S_CAN_APPROVE' => ($has_unapproved_posts && $auth->acl_gets('m_approve', 'a_', $forum_id) && $mode == 'topic_view') ? TRUE : FALSE, 'S_SHOW_TOPIC_ICONS'=> (!empty($s_topic_icons)) ? TRUE : FALSE, 'S_SELECT_SORT_DIR' => $s_sort_dir, @@ -752,7 +934,7 @@ switch ($mode) if (!$row = $db->sql_fetchrow($result)) { - trigger_error('Line : ' . __LINE__ . '

' . 'Topic_post_not_exist'); + trigger_error('Topic_post_not_exist'); } else { @@ -788,44 +970,46 @@ switch ($mode) break; case 'move': + $return_forum = '

' . sprintf($user->lang['RETURN_NEW_FORUM'], '', ''); + $return_move = '

' . sprintf($user->lang['RETURN_MCP'], '', ''); + + if (!count($topic_id_list)) + { + trigger_error($user->lang['NO_TOPIC_SELECTED'] . '

' . sprintf($user->lang['RETURN_MCP'], '', '')); + } + if ($to_forum_id < 1 || $to_forum_id == $forum_id) + { + $confirm = FALSE; + } + if ($confirm) { - $return_move = '

' . sprintf($user->lang['RETURN_MCP'], '', ''); - - if (!$to_forum_id) + if (!$forum_data[$to_forum_id]['forum_postable']) { - trigger_error('Line : ' . __LINE__ . '

' . $user->lang['FORUM_NOT_EXIST'] . $return_move); + trigger_error($user->lang['FORUM_NOT_POSTABLE'] . $return_move); } - $result = $db->sql_query('SELECT forum_id, forum_postable FROM ' . FORUMS_TABLE . ' WHERE forum_id = ' . $to_forum_id); - $row = $db->sql_fetchrow($result); + move_topics($topic_id_list, $to_forum_id); - if ($to_forum_id != $forum_id) + if (!empty($_POST['move_leave_shadow'])) { - if (!$row['forum_postable']) - { - trigger_error('Line : ' . __LINE__ . '

' . $user->lang['FORUM_NOT_POSTABLE'] . $return_move); - } + $shadow = $topic_info; + $shadow['topic_status'] = ITEM_MOVED; + $shadow['topic_moved_id'] = $topic_info['topic_id']; + unset($shadow['topic_id']); - move_topics($topic_id_list, $to_forum_id); - - if (!empty($_POST['move_leave_shadow'])) - { - $shadow = $topic_info; - $shadow['topic_status'] = ITEM_MOVED; - $shadow['topic_moved_id'] = $topic_info['topic_id']; - unset($shadow['topic_id']); - - $db->sql_query('INSERT INTO ' . TOPICS_TABLE . ' ' . $db->sql_build_array('INSERT', $shadow)); - } + $db->sql_query('INSERT INTO ' . TOPICS_TABLE . ' ' . $db->sql_build_array('INSERT', $shadow)); } - trigger_error('Line : ' . __LINE__ . '

' . 'done'); + + add_log('mod', $to_forum_id, $topic_id, 'topic_moved', $forum_id, $to_forum_id); + trigger_error($user->lang['TOPICS_MOVED'] . $return_forum . $return_mcp); } foreach ($topic_data as $row) { $template->assign_block_vars('topiclist', array( - 'TOPIC_TITLE' => $row['topic_title'] + 'TOPIC_TITLE' => $row['topic_title'], + 'U_TOPIC_LINK' => 'viewtopic.' . $phpEx . $SID . '&t=' . $row['topic_id'] )); } @@ -836,8 +1020,9 @@ switch ($mode) } $template->assign_vars(array( - 'S_HIDDEN_FIELDS' => $s_hidden_fields, - 'S_FORUM_SELECT' => make_forum_select(0, $forum_id) + 'S_MCP_ACTION' => "mcp.$phpEx$SID&start=$start", + 'S_HIDDEN_FIELDS' => $s_hidden_fields, + 'S_FORUM_SELECT' => make_forum_select() )); mcp_header('mcp_move.html'); @@ -845,53 +1030,82 @@ switch ($mode) case 'lock': case 'unlock': + if (count($topic_id_list) == 1) + { + $message = ($mode == 'lock') ? $user->lang['TOPIC_LOCKED'] : $user->lang['TOPIC_UNLOCKED']; + } + else + { + $message = ($mode == 'lock') ? $user->lang['TOPICS_LOCKED'] : $user->lang['TOPICS_UNLOCKED']; + } + + if (isset($_GET['quickmod'])) + { + $redirect_page = "viewtopic.$phpEx$SID&t=$topic_id&start=$start"; + $l_redirect = sprintf($user->lang['RETURN_TOPIC'], '', ''); + } + else + { + $redirect_page = $mcp_url . '&mode=forum_view&start=' . $start; + $l_redirect = sprintf($user->lang['RETURN_MCP'], '', ''); + } + + if (!count($topic_id_list)) + { + trigger_error($user->lang['NO_TOPIC_SELECTED'] . '

' . $l_redirect); + } + $sql = 'UPDATE ' . TOPICS_TABLE . ' SET topic_status = ' . (($mode == 'lock') ? ITEM_LOCKED : ITEM_UNLOCKED) . ' WHERE topic_id IN (' . implode(', ', $topic_id_list) . ') AND topic_moved_id = 0'; $db->sql_query($sql); - add_log('mod', $forum_id, $topic_id, $mode); - - $message = (($mode == 'lock') ? $user->lang['Topics_Locked'] : $user->lang['Topics_Unlocked']) . '

'; - if (isset($_GET['quickmod'])) - { - $redirect_page = "viewtopic.$phpEx$SID&t=$topic_id&start=$start"; - $message .= sprintf($user->lang['RETURN_TOPIC'], '', ''); - } - else - { - $redirect_page = $mcp_url . '&mode=forum_view'; - $message .= sprintf($user->lang['RETURN_MCP'], '', ''); - } - - $message .= '

' . sprintf($user->lang['RETURN_FORUM'], "", ''); + $message .= '

' . $l_redirect . '

' . sprintf($user->lang['RETURN_FORUM'], "", ''); $template->assign_vars(array( 'META' => '' )); - trigger_error('Line : ' . __LINE__ . '

' . $message); + foreach ($topic_id_list as $topic_id) + { + add_log('mod', $forum_id, $topic_id, $mode); + } + trigger_error($message); break; case 'merge_posts': + if (!count($post_id_list)) + { + trigger_error($user->lang['NO_POST_SELECTED'] . '

' . sprintf($user->lang['RETURN_MCP'], '', '')); + } $return_url = '

' . sprintf($user->lang['RETURN_TOPIC'], '', ''); move_posts($post_id_list, $to_topic_id); - trigger_error('Line : ' . __LINE__ . '

' . $user->lang['Posts_merged'] . $return_url . $return_mcp); + add_log('mod', $to_forum_id, $to_topic_id, 'log_post_merged', $topic_id); + trigger_error($user->lang['POSTS_MERGED'] . $return_url . $return_mcp); break; case 'split_all': case 'split_beyond': $return_split = '

' . sprintf($user->lang['RETURN_MCP'], '', ''); + if (!count($post_id_list)) + { + trigger_error($user->lang['NO_POST_SELECTED'] . $return_split); + } + elseif (in_array($topic_info['topic_first_post_id'], $post_id_list)) + { + trigger_error($user->lang['CANNOT_SPLIT_FIRST_POST'] . $return_split); + } + if (!$subject) { - trigger_error('Line : ' . __LINE__ . '

' . $user->lang['EMPTY_SUBJECT'] . $return_split); + trigger_error($user->lang['EMPTY_SUBJECT'] . $return_split); } if ($to_forum_id <= 0) { - trigger_error('Line : ' . __LINE__ . '

' . $user->lang['SELECT_DESTINATION_FORUM'] . $return_split); + trigger_error($user->lang['SELECT_DESTINATION_FORUM'] . $return_split); } if ($mode == 'split_beyond') @@ -925,26 +1139,22 @@ switch ($mode) $total_posts = $topic_info['topic_replies'] + 1; } - // if needed, join the users table - if ($sort_order{0} == 'u') - { - $sql = 'SELECT p.post_id - FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u - WHERE p.topic_id = $topic_id - AND p.poster_id = u.user_id - $limit_posts_time - ORDER BY $sort_order"; - } - else - { - $sql = 'SELECT p.post_id - FROM ' . POSTS_TABLE . " p - WHERE p.topic_id = $topic_id - $limit_posts_time - ORDER BY $sort_order"; - } - $result = $db->sql_query_limit($sql, 0, $start); + $sql = 'SELECT p.post_id + FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u + WHERE p.topic_id = $topic_id + AND p.poster_id = u.user_id + $limit_posts_time + ORDER BY $sort_order + LIMIT $start, -1"; + $result = $db->sql_query($sql); +/* + $sql = 'SELECT post_id + FROM ' . POSTS_TABLE . " + WHERE topic_id = $topic_id + AND post_id >= $post_id"; + $result = $db->sql_query($sql); +*/ $post_id_list = array(); while ($row = $db->sql_fetchrow($result)) { @@ -952,9 +1162,9 @@ switch ($mode) } } - if (empty($post_id_list)) + if (!count($post_id_list)) { - trigger_error('Line : ' . __LINE__ . '

' . $user->lang['None_selected'] . $return_split); + trigger_error($user->lang['NO_POST_SELECTED'] . $return_split); } $icon_id = (!empty($_POST['icon'])) ? intval($_POST['icon']) : 0; @@ -966,8 +1176,8 @@ switch ($mode) move_posts($post_id_list, $to_topic_id); $return_url = '

' . sprintf($user->lang['RETURN_TOPIC'], '', ''); - $return_url .= '

' . sprintf($user->lang['CLICK_GO_NEW_TOPIC'], '', ''); - trigger_error('Line : ' . __LINE__ . '

' . $user->lang['TOPIC_SPLIT'] . $return_url . $return_mcp); + $return_url .= '

' . sprintf($user->lang['RETURN_NEW_TOPIC'], '', ''); + trigger_error($user->lang['TOPIC_SPLIT'] . $return_url . $return_mcp); break; case 'ip': @@ -977,7 +1187,7 @@ switch ($mode) if (!$post_id) { - trigger_error('Line : ' . __LINE__ . '

' . 'No_such_post'); + trigger_error('No_such_post'); } $ip_this_post = $post_info['poster_ip']; @@ -1061,7 +1271,13 @@ switch ($mode) $db->sql_freeresult($result); break; + case 'select_topic': +/* $post_id_str = short_id_list($post_id_list); + redirect(str_replace('&', '&', $mcp_url) . '&mode=forum_view&post_id_list=' . $post_id_str); + break; +*/ + case 'forum_view': mcp_header('mcp_forum.html', TRUE); @@ -1075,7 +1291,7 @@ switch ($mode) 'U_VIEW_FORUM' => "viewforum.$phpEx$SID&f=$forum_id", 'S_HIDDEN_FIELDS' => '', - 'S_MCP_ACTION' => "mcp.$phpEx$SID" + 'S_MCP_ACTION' => "mcp.$phpEx$SID&start=$start" )); // Define censored word matches @@ -1105,10 +1321,10 @@ switch ($mode) { $folder_img = $user->img('folder_announce', 'Announcement'); } - elseif ($row['topic_type'] == POST_STICKY) + else if ($row['topic_type'] == POST_STICKY) { $folder_img = $user->img('folder_sticky', 'Sticky'); - } + } else { $folder_img = $user->img('folder', 'No_new_posts'); @@ -1119,11 +1335,11 @@ switch ($mode) { $topic_type = $user->lang['Topic_Announcement'] . ' '; } - elseif ($row['topic_type'] == POST_STICKY) + else if ($row['topic_type'] == POST_STICKY) { $topic_type = $user->lang['Topic_Sticky'] . ' '; } - elseif ($row['topic_status'] == ITEM_MOVED) + else if ($row['topic_status'] == ITEM_MOVED) { $topic_type = $user->lang['Topic_Moved'] . ' '; } @@ -1145,7 +1361,7 @@ switch ($mode) } $template->assign_block_vars('topicrow', array( - 'U_VIEW_TOPIC' => "mcp.$phpEx$SID&p=$post_id&t=" . $row['topic_id'] . '&mode=topic_view', + 'U_VIEW_TOPIC' => $mcp_url . '&t=' . $row['topic_id'] . '&mode=topic_view', 'S_SELECT_TOPIC' => ($mode == 'select_topic' && $row['topic_id'] != $topic_id) ? TRUE : FALSE, 'U_SELECT_TOPIC' => $mcp_url . '&mode=merge&to_topic_id=' . $row['topic_id'] . $url_extra, @@ -1162,8 +1378,8 @@ switch ($mode) $template->assign_vars(array( 'PAGINATION' => generate_pagination("mcp.$phpEx$SID&f=$forum_id", $forum_info['forum_topics'], $config['topics_per_page'], $start), - 'PAGE_NUMBER' => on_page($forum_info['forum_topics'], $config['topics_per_page'], $start) - )); + 'PAGE_NUMBER' => on_page($forum_info['forum_topics'], $config['topics_per_page'], $start)) + ); break; case 'front': @@ -1180,7 +1396,7 @@ include($phpbb_root_path . 'includes/page_tail.' . $phpEx); function mcp_header($template_name, $forum_nav = FALSE, $jump_mode = 'forum_view') { global $phpbb_root_path, $phpEx, $SID, $template, $auth, $user, $db, $config; - global $forum_id, $forum_info, $url_extra; + global $forum_id, $forum_info; $forum_id = (!empty($forum_id)) ? $forum_id : FALSE; $extra_form_fields = array( @@ -1188,10 +1404,9 @@ function mcp_header($template_name, $forum_nav = FALSE, $jump_mode = 'forum_view ); // NOTE: this will stop working if the jumpbox method is changed to POST - // 20030306 - NOTE{2}: according to latest checkins, it has been changed to POST ;) if (!empty($_GET['post_id_list'])) { -// $extra_form_fields['post_id_list'] = $_GET['post_id_list']; + $extra_form_fields['post_id_list'] = $_GET['post_id_list']; } $page_title = sprintf($user->lang['MCP'], '', ''); @@ -1201,7 +1416,7 @@ function mcp_header($template_name, $forum_nav = FALSE, $jump_mode = 'forum_view 'body' => $template_name )); - make_jumpbox('mcp.' . $phpEx . $SID . $url_extra, $forum_id, $extra_form_fields); + make_jumpbox('mcp.' . $phpEx, $forum_id, $extra_form_fields); if ($forum_nav) { @@ -1278,7 +1493,7 @@ function move_posts($post_ids, $topic_id, $auto_sync = TRUE) $result = $db->sql_query($sql); if (!$row = $db->sql_fetchrow($result)) { - trigger_error('Line : ' . __LINE__ . '

' . 'Topic_post_not_exist'); + trigger_error('Topic_post_not_exist'); } $sql = 'UPDATE ' . POSTS_TABLE . ' @@ -1394,46 +1609,148 @@ function delete_posts($where_type, $where_ids, $auto_sync = TRUE) // sync('topic', 'forum_id', array(2, 3)); <= resynch topics from forum #2 and #3 // sync('topic'); <= resynch all topics // +// Modes: +// - 'topic', 'forum': resync post count, topic count, first/last post data and topic_approved flag +// - 'approved': resync the topic_approved flag +// - 'reported': resync the topic_reported flag using phpbb_posts.post_reported data +// + /* NOTES: -Queries are kinda tricky. - -- subforums: we have to be able to get post/topic counts including subforums, hence the join -** UPDATE: I removed these joins because they cause too much load on large forums. The new logic may be slightly slower on small forums but is way more scalable. +1- This function will replace sync() in functions_admin.php asap ;) +2- Queries are kinda tricky. - empty topics/forums: we have to be able to resync empty topics as well as empty forums therefore we have to use a LEFT join because a full join would only return results greater than 0 ** UPDATE: not anymore needed when sync'ing forums, I'm considering the removal of the join used when sync'ing topics if possible. -- approved posts and topics: I do not like to put the "*_approved = 1" condition in the left join condition but if it's put as a WHERE condition it won't return any row for empty forums. If it causes any problem it could be replaced with a group condition like "GROUP BY p.post_approved" - */ -function resync($type, $where_type = '', $where_ids = '', $resync_parents = FALSE) +function resync($mode, $where_type = '', $where_ids = '', $resync_parents = FALSE) { global $db, $dbms; - switch ($where_type) + if (is_array($where_ids)) { - case 'topic_id': - case 'forum_id': - if (is_array($where_ids)) - { - $where_ids = array_unique($where_ids); - $where_sql = 'WHERE ' . $type{0} . ".$where_type IN (" . implode(', ', $where_ids) . ')'; - } - else - { - $where_sql = 'WHERE ' . $type{0} . ".$where_type = " . intval($where_ids) . ''; - } - - $where_sql_and = $where_sql . "\n\tAND "; - break; - - default: - $where_sql = $where_sql_and = 'WHERE'; + $where_ids = array_unique($where_ids); + } + else + { + $where_ids = array($where_ids); } - switch ($type) + if ($mode == 'approved' || $mode == 'reported') { + $where_sql = "WHERE t.$where_type IN (" . implode(', ', $where_ids) . ')'; + $where_sql_and = $where_sql . "\n\tAND "; + } + else + { + if (!$where_type) + { + $where_sql = $where_sql_and = 'WHERE'; + } + else + { + $where_sql = 'WHERE ' . $mode{0} . ".$where_type IN (" . implode(', ', $where_ids) . ')'; + $where_sql_and = $where_sql . "\n\tAND "; + } + } + + switch ($mode) + { + case 'approved': + $sql = 'SELECT t.topic_id, t.topic_approved, p.post_approved + FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p + $where_sql_and p.post_id = t.topic_first_post_id"; + $result = $db->sql_query($sql); + + $topic_ids = $approved_ids = $unapproved_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + if ($row['topic_approved'] != $row['post_approved']) + { + if ($row['post_approved']) + { + $approved_ids[] = $row['topic_id']; + } + else + { + $unapproved_ids[] = $row['topic_id']; + } + } + } + + if (count($approved_ids)) + { + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET topic_approved = 1 + WHERE topic_id IN (' . implode(', ', $approved_ids) . ')'; + $db->sql_query($sql); + } + if (count($unapproved_ids)) + { + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET topic_approved = 0 + WHERE topic_id IN (' . implode(', ', $unapproved_ids) . ')'; + $db->sql_query($sql); + } + return; + break; + + case 'reported': + $sql = "SELECT t.topic_id, t.topic_reported, p.post_reported, COUNT(p.post_id) AS total + FROM " . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p + $where_sql_and p.topic_id = t.topic_id + GROUP BY p.topic_id, p.post_reported"; + $result = $db->sql_query($sql); + + $topic_ids = $status = $status_real = $reported_ids = $unreported_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + if (!isset($status[$row['topic_id']])) + { + $topic_ids[] = $row['topic_id']; + $status[$row['topic_id']] = $row['topic_reported']; + $status_real[$row['topic_id']] = 0; + } + if ($row['total'] > 0 && $row['post_reported']) + { + $status_real[$row['topic_id']] = 1; + } + } + + foreach ($topic_ids as $i => $topic_id) + { + if ($status[$topic_id] != $status_real[$topic_id]) + { + if ($status_real[$topic_id]) + { + $reported_ids[] = $topic_id; + } + else + { + $unreported_ids[] = $topic_id; + } + } + } + + if (count($reported_ids)) + { + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET topic_reported = 1 + WHERE topic_id IN (' . implode(', ', $reported_ids) . ')'; + $db->sql_query($sql); + } + if (count($unreported_ids)) + { + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET topic_reported = 0 + WHERE topic_id IN (' . implode(', ', $unreported_ids) . ')'; + $db->sql_query($sql); + } + + return; + break; + case 'forum': if ($resync_parents) { @@ -1510,7 +1827,7 @@ function resync($type, $where_type = '', $where_ids = '', $resync_parents = FALS $last_post_id[$row['forum_id']] = intval($row['last_post_id']); } - // 3° Do the math + // 4° Do the math foreach ($subforum_list as $forum_id => $subforums) { foreach ($subforums as $subforum_id) @@ -1527,7 +1844,7 @@ function resync($type, $where_type = '', $where_ids = '', $resync_parents = FALS } } - // 4° Retrieve last_post infos + // 5° Retrieve last_post infos foreach ($forum_data as $forum_id => $data) { if ($data['last_post_id']) @@ -1607,53 +1924,43 @@ function resync($type, $where_type = '', $where_ids = '', $resync_parents = FALS break; case 'topic': - $topic_data = $post_ids = $delete_ids = $resync_forums = array(); + $topic_data = $post_ids = $approved_ids = $unapproved_ids = $resync_forums = array(); - switch ($dbms) - { - default: - $sql = 'SELECT t.*, COUNT(p.post_id) AS total_posts, MIN(p.post_id) AS first_post_id, MAX(p.post_id) AS last_post_id - FROM ' . TOPICS_TABLE . ' t - LEFT JOIN ' . POSTS_TABLE . " p ON p.topic_id = t.topic_id - AND p.post_approved = 1 - $where_sql - GROUP BY t.topic_id"; - } + $sql = 'SELECT t.*, COUNT(p.post_id) AS total_posts, MIN(p.post_id) AS first_post_id, MAX(p.post_id) AS last_post_id + FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p + $where_sql_and p.topic_id = t.topic_id + GROUP BY p.topic_id, p.post_approved"; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { - $row['total_posts'] = intval($row['total_posts']); - $row['first_post_id'] = intval($row['first_post_id']); - $row['last_post_id'] = intval($row['last_post_id']); - $row['replies'] = $row['total_posts'] - 1; - $topic_data[$row['topic_id']] = $row; + if ($row['post_approved']) + { + $row['total_posts'] = intval($row['total_posts']); + $row['first_post_id'] = intval($row['first_post_id']); + $row['last_post_id'] = intval($row['last_post_id']); + $row['replies'] = $row['total_posts'] - 1; - if (!$row['total_posts']) - { - $delete_ids[] = $row['topic_id']; + $post_ids[$row['last_post_id']] = $row['last_post_id']; } - else + + if (!isset($topic_data[$row['topic_id']])) { - $post_ids[] = $row['last_post_id']; - if ($row['first_post_id'] != $row['last_post_id']) - { - $post_ids[] = $row['first_post_id']; - } + $topic_data[$row['topic_id']] = $row; } + + $post_ids[$row['first_post_id']] = $row['first_post_id']; } - if (count($delete_ids)) - { -// delete_topics('topic_id', $delete_ids); - } if (!count($post_ids)) { // If we get there, topic ids were invalid or topics did not contain any posts + + delete_topics($where_type, $where_ids); return; } - $sql = 'SELECT p.post_id, p.topic_id, p.poster_id, p.post_username, p.post_time, u.username + $sql = 'SELECT p.post_id, p.topic_id, p.post_approved, p.poster_id, p.post_username, p.post_time, u.username FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u WHERE p.post_id IN (' . implode(', ', $post_ids) . ') AND u.user_id = p.poster_id'; @@ -1662,6 +1969,17 @@ function resync($type, $where_type = '', $where_ids = '', $resync_parents = FALS { if ($row['post_id'] == $topic_data[$row['topic_id']]['first_post_id']) { + if ($topic_data[$row['topic_id']]['topic_approved'] != $row['post_approved']) + { + if ($row['post_approved']) + { + $approved_ids[] = $row['topic_id']; + } + else + { + $unapproved_ids[] = $row['topic_id']; + } + } $topic_data[$row['topic_id']]['time'] = $row['post_time']; $topic_data[$row['topic_id']]['poster'] = $row['poster_id']; $topic_data[$row['topic_id']]['first_poster_name'] = ($row['poster_id'] == ANONYMOUS) ? $row['post_username'] : $row['username']; @@ -1674,6 +1992,21 @@ function resync($type, $where_type = '', $where_ids = '', $resync_parents = FALS } } + if (count($approved_ids)) + { + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET topic_approved = 1 + WHERE topic_id IN (' . implode(', ', $approved_ids) . ')'; + $db->sql_query($sql); + } + if (count($unapproved_ids)) + { + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET topic_approved = 0 + WHERE topic_id IN (' . implode(', ', $unapproved_ids) . ')'; + $db->sql_query($sql); + } + $fieldnames = array('time', 'replies', 'poster', 'first_post_id', 'first_poster_name', 'last_post_id', 'last_post_time', 'last_poster_id', 'last_poster_name'); foreach ($topic_data as $topic_id => $row) @@ -1791,24 +2124,29 @@ function very_temporary_lang_strings() global $user; $lang = array( 'FORUM_NOT_POSTABLE' => 'This forum is not postable', - 'SELECTED_TOPICS' => 'You selected the following topic(s)', + 'FORUM_NOT_EXIST' => 'The forum you selected does not exist', 'TOPIC_NOT_EXIST' => 'The topic you selected does not exist', - 'Posts_merged' => 'The selected posts have been merged', 'SELECT_TOPIC' => 'Select topic', - 'Topic_number_is' => 'Topic #%d is %s', - 'POST_REMOVED' => 'The selected post has been successfully removed from the database.', - 'POSTS_REMOVED' => 'The selected posts have been successfully removed from the database.', - 'TOPIC_MOVED' => 'The selected topic has been successfully moved.', - 'TOPICS_MOVED' => 'The selected topics have been successfully moved.', + 'TOPIC_NUMBER_IS' => 'Topic #%d is %s', + 'POST_DETAILS' => 'Post details', + 'CONFIRM_DELETE_POSTS' => 'Are you sure you want to delete these posts?', + 'POST_REMOVED' => 'The selected post has been successfully removed from the database', + 'POSTS_REMOVED' => 'The selected posts have been successfully removed from the database', + + 'RESYNC' => 'Resync', 'TOPIC_RESYNCHRONISED' => 'The selected topic has been resynchronised', 'TOPICS_RESYNCHRONISED' => 'The selected topics have been resynchronised', - 'RESYNC' => 'Resync', + 'SELECT_DESTINATION_FORUM' => 'Please select a forum for destination', - 'TOPIC_SPLIT' => 'The selected topic has been split successfully', - 'CLICK_GO_NEW_TOPIC' => 'Click %sHere%s to go to the new topic', - 'POST_DETAILS' => 'Post details', + 'SELECTED_TOPICS' => 'You selected the following topic(s)', + 'LEAVE_SHADOW' => 'Leave a shadow topic in the old forum', + 'TOPIC_MOVED' => 'The selected topic has been successfully moved.', + 'TOPICS_MOVED' => 'The selected topics have been successfully moved.', + + 'RETURN_NEW_TOPIC' => 'Click %sHere%s to go to the new topic', + 'RETURN_NEW_FORUM' => 'Click %sHere%s to go to the destination forum', 'DISPLAY_OPTIONS' => 'Display options', 'POSTS_PER_PAGE' => 'Posts per page', @@ -1818,6 +2156,7 @@ function very_temporary_lang_strings() 'MERGE_TOPIC_EXPLAIN' => 'Using the form below you can merge selected posts into another topic. These posts will not be reordered and will appear as if the users posted them to the new topic. Please enter the destination topic id or click on the "Select" button to search for one', 'MERGE_TOPIC_ID' => 'Destination topic id', 'MERGE_POSTS' => 'Merge posts', + 'POSTS_MERGED' => 'The selected posts have been merged', 'SPLIT_TOPIC' => 'Split topic', 'SPLIT_TOPIC_EXPLAIN' => 'Using the form below you can split a topic in two, either by selecting the posts individually or by splitting at a selected post', @@ -1825,13 +2164,54 @@ function very_temporary_lang_strings() 'SPLIT_FORUM' => 'Forum for new topic', 'SPLIT_POSTS' => 'Split selected posts', 'SPLIT_AFTER' => 'Split from selected post', + 'TOPIC_SPLIT' => 'The selected topic has been split successfully', + 'CANNOT_SPLIT_FIRST_POST' => 'You cannot split the first post of a topic', 'DELETE_POSTS' => 'Delete posts', + 'APPROVE_POSTS' => 'Approve posts', + 'POST_APPROVED' => 'The selected post has been approved', + 'POSTS_APPROVED' => 'The selected posts have been approved', + 'POST_UNAPPROVED' => 'The selected post has been unapproved', + 'POSTS_UNAPPROVED' => 'The selected posts have been unapproved', + 'TOPIC_APPROVED' => 'The selected topic has been approved', + 'TOPICS_APPROVED' => 'The selected topics have been approved', + 'TOPIC_UNAPPROVED' => 'The selected topic has been unapproved', + 'TOPICS_UNAPPROVED' => 'The selected topics have been unapproved', + 'MOVE' => 'Move', + 'LOCK' => 'Lock', 'UNLOCK' => 'Unlock', + 'TOPIC_LOCKED' => 'The selected topic has been locked', + 'TOPICS_LOCKED' => 'The selected topics have been locked', + 'TOPIC_UNLOCKED' => 'The selected topic has been unlocked', + 'TOPICS_UNLOCKED' => 'The selected topics have been unlocked', - 'NOT_ALLOWED' => 'You are not allowed to perform this action.' + 'NOT_ALLOWED' => 'You are not allowed to perform this action.', + 'TOPIC_TYPE_CHANGED' => 'Topic type successfully changed', + + 'NO_TOPIC_SELECTED' => 'You must select at least one topic to perform this action', + 'NO_POST_SELECTED' => 'You must select at least one post to perform this action', + 'NO_SUBJECT' => '<No subject>', + + 'MOD_QUEUE' => 'Moderation queue', + 'QUEUE_EMPTY' => 'There is no post awaiting for approval', + 'FORUM_QUEUE_EMPTY' => 'There is no post awaiting for approval in this forum', + + 'log_topic_locked' => 'Locked topic', + 'log_topic_unlocked' => 'Unlocked topic', + 'log_topic_moved' => 'Moved topic from forum #%s', + 'log_topic_split' => 'Split topic from topic #%s', + 'log_topic_deleted' => 'Deleted topic', + 'log_topic_approved' => 'Approved topic', + 'log_topic_unapproved' => 'Unapproved topic', + 'log_post_approved' => 'Approved post', + 'log_post_unapproved' => 'Unapproved post', + 'log_post_deleted' => 'Deleted posts', + 'log_post_merged' => 'Merged posts from topic #%s', + 'log_set_announce' => 'Topic type changed to Announcement', + 'log_set_sticky' => 'Topic type changed to Sticky', + 'log_set_normal' => 'Topic type changed to Regular' ); $user->lang = array_merge($user->lang, $lang); @@ -1847,6 +2227,34 @@ function very_temporary_lang_strings() 'merge' => 'Merge topic', 'split' => 'Split topic' ); + + $user->lang['report_reasons'] = array( + 'warez' => 'The post contains links to illegal or pirated software', + 'sex' => 'The post contains nudity or something similar', + 'off_topic' => 'Typically any of Pit\'t or TC\'s posts ^ ^' + ); } + + + + + + + + + + + + + + + + + + + + + + ?> \ No newline at end of file diff --git a/phpBB/templates/subSilver/mcp_forum.html b/phpBB/templates/subSilver/mcp_forum.html index b457427e8f..48e0396874 100644 --- a/phpBB/templates/subSilver/mcp_forum.html +++ b/phpBB/templates/subSilver/mcp_forum.html @@ -1,7 +1,6 @@ -
- + @@ -49,7 +48,7 @@
 
- +
{S_TIMEZONE}
{PAGINATION}
{L_MARK_ALL} :: {L_UNMARK_ALL}
{PAGINATION}
diff --git a/phpBB/templates/subSilver/mcp_header.html b/phpBB/templates/subSilver/mcp_header.html index 915c9b86c4..81e92133d5 100644 --- a/phpBB/templates/subSilver/mcp_header.html +++ b/phpBB/templates/subSilver/mcp_header.html @@ -1,14 +1,25 @@ + + - - - - - - + + + + + diff --git a/phpBB/templates/subSilver/mcp_move.html b/phpBB/templates/subSilver/mcp_move.html index 252c5da549..92b0228db7 100644 --- a/phpBB/templates/subSilver/mcp_move.html +++ b/phpBB/templates/subSilver/mcp_move.html @@ -1,6 +1,6 @@ - +
{FORUM_NAME}
{TOPIC_TITLE}{TOPIC_TITLE}
{FORUM_NAME}
@@ -8,7 +8,7 @@
- + - - - - @@ -85,13 +103,14 @@ -
{MESSAGE_TITLE}{L_MOVE}
@@ -18,22 +18,17 @@
-
- {L_SELECTED_TOPICS}

+
+ {L_SELECTED_TOPICS}
 
{L_MOVE_TO_FORUM}  

- {L_LEAVE_SHADOW}
-
- {MESSAGE_TEXT}

+
{L_SELECT_DESTINATION_FORUM}  

+ {L_LEAVE_SHADOW}

{S_HIDDEN_FIELDS} diff --git a/phpBB/templates/subSilver/mcp_queue.html b/phpBB/templates/subSilver/mcp_queue.html new file mode 100644 index 0000000000..cc82e91440 --- /dev/null +++ b/phpBB/templates/subSilver/mcp_queue.html @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 {L_FORUM}  {L_TOPIC}  {L_SUBJECT}  {L_AUTHOR}  {L_POST_TIME}  {L_SELECT} 
{L_TOPICS}
{L_POSTS}
{postrow.FORUM}{postrow.TOPIC}{postrow.SUBJECT}{postrow.AUTHOR}{postrow.POST_TIME}{postrow.S_CHECKBOX}
{L_FORUM_QUEUE_EMPTY}{L_QUEUE_EMPTY}
+ + + + + + +
{L_MARK_ALL} :: {L_UNMARK_ALL}
{PAGINATION}
+ + + + + +
+ + \ No newline at end of file diff --git a/phpBB/templates/subSilver/mcp_topic.html b/phpBB/templates/subSilver/mcp_topic.html index 1fe03defde..21cc9f93c4 100644 --- a/phpBB/templates/subSilver/mcp_topic.html +++ b/phpBB/templates/subSilver/mcp_topic.html @@ -1,6 +1,6 @@ -
+
@@ -35,8 +35,8 @@ - - + + @@ -46,6 +46,9 @@ + + + @@ -55,8 +58,9 @@ @@ -73,7 +77,21 @@ {postrow.POST_DATE}    {L_POST_SUBJECT}: {postrow.POST_SUBJECT} - + + + + + + + + + +
{L_SPLIT_TOPIC}{L_MERGE_TOPIC_EXPLAIN}
{L_MERGE_TOPIC_ID}
{TO_TOPIC_EXPLAIN}
{L_MERGE_TOPIC_ID}
{TO_TOPIC_INFO}
{L_POSTS_PER_PAGE}
{L_POSTS_PER_PAGE_EXPLAIN}
{L_DISPLAY_POSTS}: {S_SELECT_SORT_DAYS} {L_SORT_BY} {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} 
{L_AUTHOR} {L_MESSAGE}
-    +       +        

{postrow.MESSAGE}

+ + + + +
{UNAPPROVED_IMG} {L_POST_NOT_BEEN_APPROVED}

{postrow.MESSAGE}
{postrow.S_CHECKBOX}
{L_DISPLAY_POSTS}: {S_SELECT_SORT_DAYS} {L_SORT_BY} {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} 
- - - - - -
{S_TIMEZONE}
{PAGINATION}
+ + + + + +
{L_MARK_ALL} :: {L_UNMARK_ALL}
{PAGINATION}
+ + \ No newline at end of file