aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/mcp
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/mcp')
-rw-r--r--phpBB/includes/mcp/info/mcp_ban.php2
-rw-r--r--phpBB/includes/mcp/info/mcp_logs.php2
-rw-r--r--phpBB/includes/mcp/info/mcp_main.php2
-rw-r--r--phpBB/includes/mcp/info/mcp_notes.php2
-rw-r--r--phpBB/includes/mcp/info/mcp_pm_reports.php2
-rw-r--r--phpBB/includes/mcp/info/mcp_queue.php2
-rw-r--r--phpBB/includes/mcp/info/mcp_reports.php2
-rw-r--r--phpBB/includes/mcp/info/mcp_warn.php2
-rw-r--r--phpBB/includes/mcp/mcp_ban.php2
-rw-r--r--phpBB/includes/mcp/mcp_forum.php21
-rw-r--r--phpBB/includes/mcp/mcp_front.php41
-rw-r--r--phpBB/includes/mcp/mcp_logs.php2
-rw-r--r--phpBB/includes/mcp/mcp_main.php213
-rw-r--r--phpBB/includes/mcp/mcp_notes.php2
-rw-r--r--phpBB/includes/mcp/mcp_pm_reports.php2
-rw-r--r--phpBB/includes/mcp/mcp_post.php2
-rw-r--r--phpBB/includes/mcp/mcp_queue.php66
-rw-r--r--phpBB/includes/mcp/mcp_reports.php13
-rw-r--r--phpBB/includes/mcp/mcp_topic.php2
-rw-r--r--phpBB/includes/mcp/mcp_warn.php2
20 files changed, 77 insertions, 307 deletions
diff --git a/phpBB/includes/mcp/info/mcp_ban.php b/phpBB/includes/mcp/info/mcp_ban.php
index 383df30498..cc5b9f50ee 100644
--- a/phpBB/includes/mcp/info/mcp_ban.php
+++ b/phpBB/includes/mcp/info/mcp_ban.php
@@ -35,5 +35,3 @@ class mcp_ban_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/info/mcp_logs.php b/phpBB/includes/mcp/info/mcp_logs.php
index fe2f9fa1d7..59a4fcb21e 100644
--- a/phpBB/includes/mcp/info/mcp_logs.php
+++ b/phpBB/includes/mcp/info/mcp_logs.php
@@ -35,5 +35,3 @@ class mcp_logs_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/info/mcp_main.php b/phpBB/includes/mcp/info/mcp_main.php
index 9755cdfc07..d8ee155f60 100644
--- a/phpBB/includes/mcp/info/mcp_main.php
+++ b/phpBB/includes/mcp/info/mcp_main.php
@@ -36,5 +36,3 @@ class mcp_main_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/info/mcp_notes.php b/phpBB/includes/mcp/info/mcp_notes.php
index afe232e5b5..0b83e77daf 100644
--- a/phpBB/includes/mcp/info/mcp_notes.php
+++ b/phpBB/includes/mcp/info/mcp_notes.php
@@ -34,5 +34,3 @@ class mcp_notes_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/info/mcp_pm_reports.php b/phpBB/includes/mcp/info/mcp_pm_reports.php
index 103f560597..c556fb62e1 100644
--- a/phpBB/includes/mcp/info/mcp_pm_reports.php
+++ b/phpBB/includes/mcp/info/mcp_pm_reports.php
@@ -35,5 +35,3 @@ class mcp_pm_reports_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/info/mcp_queue.php b/phpBB/includes/mcp/info/mcp_queue.php
index 7a256642b9..171b1d3f35 100644
--- a/phpBB/includes/mcp/info/mcp_queue.php
+++ b/phpBB/includes/mcp/info/mcp_queue.php
@@ -35,5 +35,3 @@ class mcp_queue_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/info/mcp_reports.php b/phpBB/includes/mcp/info/mcp_reports.php
index 3893ba5abb..a620e65ba1 100644
--- a/phpBB/includes/mcp/info/mcp_reports.php
+++ b/phpBB/includes/mcp/info/mcp_reports.php
@@ -35,5 +35,3 @@ class mcp_reports_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/info/mcp_warn.php b/phpBB/includes/mcp/info/mcp_warn.php
index 2b0b09f75a..a5a8b7a489 100644
--- a/phpBB/includes/mcp/info/mcp_warn.php
+++ b/phpBB/includes/mcp/info/mcp_warn.php
@@ -36,5 +36,3 @@ class mcp_warn_info
{
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/mcp_ban.php b/phpBB/includes/mcp/mcp_ban.php
index d9f5eb8f22..40f02919f9 100644
--- a/phpBB/includes/mcp/mcp_ban.php
+++ b/phpBB/includes/mcp/mcp_ban.php
@@ -215,5 +215,3 @@ class mcp_ban
}
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php
index b70601b479..f170dd68eb 100644
--- a/phpBB/includes/mcp/mcp_forum.php
+++ b/phpBB/includes/mcp/mcp_forum.php
@@ -23,6 +23,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
{
global $template, $db, $user, $auth, $cache, $module;
global $phpEx, $phpbb_root_path, $config;
+ global $request;
$user->add_lang(array('viewtopic', 'viewforum'));
@@ -34,7 +35,10 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
if ($merge_select)
{
// Fixes a "bug" that makes forum_view use the same ordering as topic_view
- unset($_POST['sk'], $_POST['sd'], $_REQUEST['sk'], $_REQUEST['sd']);
+ $request->overwrite('sk', null);
+ $request->overwrite('sd', null);
+ $request->overwrite('sk', null, phpbb_request_interface::POST);
+ $request->overwrite('sd', null, phpbb_request_interface::POST);
}
$forum_id = $forum_info['forum_id'];
@@ -146,10 +150,10 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
$read_tracking_join = $read_tracking_select = '';
}
- $sql = "SELECT t.topic_id
- FROM " . TOPICS_TABLE . " t
- WHERE t.forum_id IN($forum_id, 0)
- " . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND t.topic_approved = 1') . "
+ $sql = 'SELECT t.topic_id
+ FROM ' . TOPICS_TABLE . ' t
+ WHERE t.forum_id = ' . $forum_id . '
+ ' . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND t.topic_approved = 1') . "
$limit_time_sql
ORDER BY t.topic_type DESC, $sort_order_sql";
$result = $db->sql_query_limit($sql, $topics_per_page, $start);
@@ -184,11 +188,11 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
{
if ($config['load_db_lastread'])
{
- $topic_tracking_info = get_topic_tracking($forum_id, $topic_list, $topic_rows, array($forum_id => $forum_info['mark_time']), array());
+ $topic_tracking_info = get_topic_tracking($forum_id, $topic_list, $topic_rows, array($forum_id => $forum_info['mark_time']));
}
else
{
- $topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_list, array());
+ $topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_list);
}
}
@@ -221,6 +225,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
$topic_row = array(
'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
+ 'TOPIC_IMG_STYLE' => $folder_img,
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'),
'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '',
@@ -443,5 +448,3 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link);
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php
index af262baa29..eca67c5ac1 100644
--- a/phpBB/includes/mcp/mcp_front.php
+++ b/phpBB/includes/mcp/mcp_front.php
@@ -39,7 +39,7 @@ function mcp_front_view($id, $mode, $action)
{
$sql = 'SELECT COUNT(post_id) AS total
FROM ' . POSTS_TABLE . '
- WHERE forum_id IN (0, ' . implode(', ', $forum_list) . ')
+ WHERE ' . $db->sql_in_set('forum_id', $forum_list) . '
AND post_approved = 0';
$result = $db->sql_query($sql);
$total = (int) $db->sql_fetchfield('total');
@@ -47,8 +47,6 @@ function mcp_front_view($id, $mode, $action)
if ($total)
{
- $global_id = $forum_list[0];
-
$sql = 'SELECT forum_id, forum_name
FROM ' . FORUMS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_list);
@@ -62,7 +60,7 @@ function mcp_front_view($id, $mode, $action)
$sql = 'SELECT post_id
FROM ' . POSTS_TABLE . '
- WHERE forum_id IN (0, ' . implode(', ', $forum_list) . ')
+ WHERE ' . $db->sql_in_set('forum_id', $forum_list) . '
AND post_approved = 0
ORDER BY post_time DESC';
$result = $db->sql_query_limit($sql, 5);
@@ -91,17 +89,11 @@ function mcp_front_view($id, $mode, $action)
while ($row = $db->sql_fetchrow($result))
{
- $global_topic = ($row['forum_id']) ? false : true;
- if ($global_topic)
- {
- $row['forum_id'] = $global_id;
- }
-
$template->assign_block_vars('unapproved', array(
'U_POST_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=approve_details&amp;f=' . $row['forum_id'] . '&amp;p=' . $row['post_id']),
- 'U_MCP_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=forum_view&amp;f=' . $row['forum_id']) : '',
+ 'U_MCP_FORUM' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=forum_view&amp;f=' . $row['forum_id']),
'U_MCP_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=topic_view&amp;f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id']),
- 'U_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '',
+ 'U_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']),
'U_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id']),
'AUTHOR_FULL' => get_username_string('full', $row['poster_id'], $row['username'], $row['user_colour']),
@@ -109,7 +101,7 @@ function mcp_front_view($id, $mode, $action)
'AUTHOR_COLOUR' => get_username_string('colour', $row['poster_id'], $row['username'], $row['user_colour']),
'U_AUTHOR' => get_username_string('profile', $row['poster_id'], $row['username'], $row['user_colour']),
- 'FORUM_NAME' => (!$global_topic) ? $forum_names[$row['forum_id']] : $user->lang['GLOBAL_ANNOUNCEMENT'],
+ 'FORUM_NAME' => $forum_names[$row['forum_id']],
'POST_ID' => $row['post_id'],
'TOPIC_TITLE' => $row['topic_title'],
'SUBJECT' => ($row['post_subject']) ? $row['post_subject'] : $user->lang['NO_SUBJECT'],
@@ -159,15 +151,13 @@ function mcp_front_view($id, $mode, $action)
WHERE r.post_id = p.post_id
AND r.pm_id = 0
AND r.report_closed = 0
- AND p.forum_id IN (0, ' . implode(', ', $forum_list) . ')';
+ AND ' . $db->sql_in_set('p.forum_id', $forum_list);
$result = $db->sql_query($sql);
$total = (int) $db->sql_fetchfield('total');
$db->sql_freeresult($result);
if ($total)
{
- $global_id = $forum_list[0];
-
$sql = $db->sql_build_query('SELECT', array(
'SELECT' => 'r.report_time, p.post_id, p.post_subject, p.post_time, u.username, u.username_clean, u.user_colour, u.user_id, u2.username as author_name, u2.username_clean as author_name_clean, u2.user_colour as author_colour, u2.user_id as author_id, t.topic_id, t.topic_title, f.forum_id, f.forum_name',
@@ -193,7 +183,7 @@ function mcp_front_view($id, $mode, $action)
AND p.topic_id = t.topic_id
AND r.user_id = u.user_id
AND p.poster_id = u2.user_id
- AND p.forum_id IN (0, ' . implode(', ', $forum_list) . ')',
+ AND ' . $db->sql_in_set('p.forum_id', $forum_list),
'ORDER_BY' => 'p.post_time DESC'
));
@@ -201,17 +191,11 @@ function mcp_front_view($id, $mode, $action)
while ($row = $db->sql_fetchrow($result))
{
- $global_topic = ($row['forum_id']) ? false : true;
- if ($global_topic)
- {
- $row['forum_id'] = $global_id;
- }
-
$template->assign_block_vars('report', array(
'U_POST_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . '&amp;p=' . $row['post_id'] . "&amp;i=reports&amp;mode=report_details"),
- 'U_MCP_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . "&amp;i=$id&amp;mode=forum_view") : '',
+ 'U_MCP_FORUM' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . "&amp;i=$id&amp;mode=forum_view"),
'U_MCP_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id'] . "&amp;i=$id&amp;mode=topic_view"),
- 'U_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '',
+ 'U_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']),
'U_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id']),
'REPORTER_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
@@ -224,7 +208,7 @@ function mcp_front_view($id, $mode, $action)
'AUTHOR_COLOUR' => get_username_string('colour', $row['author_id'], $row['author_name'], $row['author_colour']),
'U_AUTHOR' => get_username_string('profile', $row['author_id'], $row['author_name'], $row['author_colour']),
- 'FORUM_NAME' => (!$global_topic) ? $row['forum_name'] : $user->lang['GLOBAL_ANNOUNCEMENT'],
+ 'FORUM_NAME' => $row['forum_name'],
'TOPIC_TITLE' => $row['topic_title'],
'SUBJECT' => ($row['post_subject']) ? $row['post_subject'] : $user->lang['NO_SUBJECT'],
'REPORT_TIME' => $user->format_date($row['report_time']),
@@ -347,9 +331,6 @@ function mcp_front_view($id, $mode, $action)
if (!empty($forum_list))
{
- // Add forum_id 0 for global announcements
- $forum_list[] = 0;
-
$log_count = false;
$log = array();
view_log('mod', $log, $log_count, 5, 0, $forum_list);
@@ -376,5 +357,3 @@ function mcp_front_view($id, $mode, $action)
$template->assign_var('S_MCP_ACTION', append_sid("{$phpbb_root_path}mcp.$phpEx"));
make_jumpbox(append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=forum_view'), 0, false, 'm_', true);
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php
index 73ff72c177..dc05ba4110 100644
--- a/phpBB/includes/mcp/mcp_logs.php
+++ b/phpBB/includes/mcp/mcp_logs.php
@@ -214,5 +214,3 @@ class mcp_logs
}
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php
index ad10a52705..6c6c5a5532 100644
--- a/phpBB/includes/mcp/mcp_main.php
+++ b/phpBB/includes/mcp/mcp_main.php
@@ -333,131 +333,22 @@ function change_topic_type($action, $topic_ids)
if (confirm_box(true))
{
- if ($new_topic_type != POST_GLOBAL)
+ $sql = 'UPDATE ' . TOPICS_TABLE . "
+ SET topic_type = $new_topic_type
+ WHERE " . $db->sql_in_set('topic_id', $topic_ids);
+ $db->sql_query($sql);
+
+ if (($new_topic_type == POST_GLOBAL) && sizeof($topic_ids))
{
+ // Delete topic shadows for global announcements
+ $sql = 'DELETE FROM ' . TOPICS_TABLE . '
+ WHERE ' . $db->sql_in_set('topic_moved_id', $topic_ids);
+ $db->sql_query($sql);
+
$sql = 'UPDATE ' . TOPICS_TABLE . "
SET topic_type = $new_topic_type
- WHERE " . $db->sql_in_set('topic_id', $topic_ids) . '
- AND forum_id <> 0';
+ WHERE " . $db->sql_in_set('topic_id', $topic_ids);
$db->sql_query($sql);
-
- // Reset forum id if a global topic is within the array
- $to_forum_id = request_var('to_forum_id', 0);
-
- if ($to_forum_id)
- {
- $sql = 'UPDATE ' . TOPICS_TABLE . "
- SET topic_type = $new_topic_type, forum_id = $to_forum_id
- WHERE " . $db->sql_in_set('topic_id', $topic_ids) . '
- AND forum_id = 0';
- $db->sql_query($sql);
-
- // Update forum_ids for all posts
- $sql = 'UPDATE ' . POSTS_TABLE . "
- SET forum_id = $to_forum_id
- WHERE " . $db->sql_in_set('topic_id', $topic_ids) . '
- AND forum_id = 0';
- $db->sql_query($sql);
-
- // Do a little forum sync stuff
- $sql = 'SELECT SUM(t.topic_replies + t.topic_approved) as topic_posts, COUNT(t.topic_approved) as topics_authed
- FROM ' . TOPICS_TABLE . ' t
- WHERE ' . $db->sql_in_set('t.topic_id', $topic_ids);
- $result = $db->sql_query($sql);
- $row_data = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- $sync_sql = array();
-
- if ($row_data['topic_posts'])
- {
- $sync_sql[$to_forum_id][] = 'forum_posts = forum_posts + ' . (int) $row_data['topic_posts'];
- }
-
- if ($row_data['topics_authed'])
- {
- $sync_sql[$to_forum_id][] = 'forum_topics = forum_topics + ' . (int) $row_data['topics_authed'];
- }
-
- $sync_sql[$to_forum_id][] = 'forum_topics_real = forum_topics_real + ' . (int) sizeof($topic_ids);
-
- foreach ($sync_sql as $forum_id_key => $array)
- {
- $sql = 'UPDATE ' . FORUMS_TABLE . '
- SET ' . implode(', ', $array) . '
- WHERE forum_id = ' . $forum_id_key;
- $db->sql_query($sql);
- }
-
- sync('forum', 'forum_id', $to_forum_id);
- }
- }
- else
- {
- // Get away with those topics already being a global announcement by re-calculating $topic_ids
- $sql = 'SELECT topic_id
- FROM ' . TOPICS_TABLE . '
- WHERE ' . $db->sql_in_set('topic_id', $topic_ids) . '
- AND forum_id <> 0';
- $result = $db->sql_query($sql);
-
- $topic_ids = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $topic_ids[] = $row['topic_id'];
- }
- $db->sql_freeresult($result);
-
- if (sizeof($topic_ids))
- {
- // Delete topic shadows for global announcements
- $sql = 'DELETE FROM ' . TOPICS_TABLE . '
- WHERE ' . $db->sql_in_set('topic_moved_id', $topic_ids);
- $db->sql_query($sql);
-
- $sql = 'UPDATE ' . TOPICS_TABLE . "
- SET topic_type = $new_topic_type, forum_id = 0
- WHERE " . $db->sql_in_set('topic_id', $topic_ids);
- $db->sql_query($sql);
-
- // Update forum_ids for all posts
- $sql = 'UPDATE ' . POSTS_TABLE . '
- SET forum_id = 0
- WHERE ' . $db->sql_in_set('topic_id', $topic_ids);
- $db->sql_query($sql);
-
- // Do a little forum sync stuff
- $sql = 'SELECT SUM(t.topic_replies + t.topic_approved) as topic_posts, COUNT(t.topic_approved) as topics_authed
- FROM ' . TOPICS_TABLE . ' t
- WHERE ' . $db->sql_in_set('t.topic_id', $topic_ids);
- $result = $db->sql_query($sql);
- $row_data = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- $sync_sql = array();
-
- if ($row_data['topic_posts'])
- {
- $sync_sql[$forum_id][] = 'forum_posts = forum_posts - ' . (int) $row_data['topic_posts'];
- }
-
- if ($row_data['topics_authed'])
- {
- $sync_sql[$forum_id][] = 'forum_topics = forum_topics - ' . (int) $row_data['topics_authed'];
- }
-
- $sync_sql[$forum_id][] = 'forum_topics_real = forum_topics_real - ' . (int) sizeof($topic_ids);
-
- foreach ($sync_sql as $forum_id_key => $array)
- {
- $sql = 'UPDATE ' . FORUMS_TABLE . '
- SET ' . implode(', ', $array) . '
- WHERE forum_id = ' . $forum_id_key;
- $db->sql_query($sql);
- }
-
- sync('forum', 'forum_id', $forum_id);
- }
}
$success_msg = (sizeof($topic_ids) == 1) ? 'TOPIC_TYPE_CHANGED' : 'TOPICS_TYPE_CHANGED';
@@ -474,41 +365,7 @@ function change_topic_type($action, $topic_ids)
}
else
{
- // Global topic involved?
- $global_involved = false;
-
- if ($new_topic_type != POST_GLOBAL)
- {
- $sql = 'SELECT forum_id
- FROM ' . TOPICS_TABLE . '
- WHERE ' . $db->sql_in_set('topic_id', $topic_ids) . '
- AND forum_id = 0';
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if ($row)
- {
- $global_involved = true;
- }
- }
-
- if ($global_involved)
- {
- global $template;
-
- $template->assign_vars(array(
- 'S_FORUM_SELECT' => make_forum_select(request_var('f', $forum_id), false, false, true, true),
- 'S_CAN_LEAVE_SHADOW' => false,
- 'ADDITIONAL_MSG' => (sizeof($topic_ids) == 1) ? $user->lang['SELECT_FORUM_GLOBAL_ANNOUNCEMENT'] : $user->lang['SELECT_FORUM_GLOBAL_ANNOUNCEMENTS'])
- );
-
- confirm_box(false, $l_new_type, build_hidden_fields($s_hidden_fields), 'mcp_move.html');
- }
- else
- {
- confirm_box(false, $l_new_type, build_hidden_fields($s_hidden_fields));
- }
+ confirm_box(false, $l_new_type, build_hidden_fields($s_hidden_fields));
}
$redirect = request_var('redirect', "index.$phpEx");
@@ -532,6 +389,7 @@ function mcp_move_topic($topic_ids)
{
global $auth, $user, $db, $template;
global $phpEx, $phpbb_root_path;
+ global $request;
// Here we limit the operation to one forum only
$forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_move'), true);
@@ -585,8 +443,8 @@ function mcp_move_topic($topic_ids)
if (!$to_forum_id || $additional_msg)
{
- unset($_POST['confirm']);
- unset($_REQUEST['confirm_key']);
+ $request->overwrite('confirm', null, phpbb_request_interface::POST);
+ $request->overwrite('confirm_key', null);
}
if (confirm_box(true))
@@ -627,16 +485,13 @@ function mcp_move_topic($topic_ids)
$topic_posts_added += $topic_info['topic_replies'];
- if ($topic_info['topic_type'] != POST_GLOBAL)
- {
- $topics_removed++;
- $topic_posts_removed += $topic_info['topic_replies'];
+ $topics_removed++;
+ $topic_posts_removed += $topic_info['topic_replies'];
- if ($topic_info['topic_approved'])
- {
- $topics_authed_removed++;
- $topic_posts_removed++;
- }
+ if ($topic_info['topic_approved'])
+ {
+ $topics_authed_removed++;
+ $topic_posts_removed++;
}
}
@@ -659,6 +514,14 @@ function mcp_move_topic($topic_ids)
// Move topics, but do not resync yet
move_topics($topic_ids, $to_forum_id, false);
+ if ($request->is_set_post('move_lock_topics') && $auth->acl_get('m_lock', $to_forum_id))
+ {
+ $sql = 'UPDATE ' . TOPICS_TABLE . '
+ SET topic_status = ' . ITEM_LOCKED . '
+ WHERE ' . $db->sql_in_set('topic_id', $topic_ids);
+ $db->sql_query($sql);
+ }
+
$forum_ids = array($to_forum_id);
foreach ($topic_data as $topic_id => $row)
{
@@ -666,15 +529,6 @@ function mcp_move_topic($topic_ids)
$forum_ids[] = $row['forum_id'];
add_log('mod', $to_forum_id, $topic_id, 'LOG_MOVE', $row['forum_name'], $forum_data['forum_name']);
- // If we have moved a global announcement, we need to correct the topic type
- if ($row['topic_type'] == POST_GLOBAL)
- {
- $sql = 'UPDATE ' . TOPICS_TABLE . '
- SET topic_type = ' . POST_ANNOUNCE . '
- WHERE topic_id = ' . (int) $row['topic_id'];
- $db->sql_query($sql);
- }
-
// Leave a redirection if required and only if the topic is visible to users
if ($leave_shadow && $row['topic_approved'] && $row['topic_type'] != POST_GLOBAL)
{
@@ -756,6 +610,7 @@ function mcp_move_topic($topic_ids)
$template->assign_vars(array(
'S_FORUM_SELECT' => make_forum_select($to_forum_id, $forum_id, false, true, true, true),
'S_CAN_LEAVE_SHADOW' => true,
+ 'S_CAN_LOCK_TOPIC' => ($auth->acl_get('m_lock', $to_forum_id)) ? true : false,
'ADDITIONAL_MSG' => $additional_msg)
);
@@ -1037,8 +892,8 @@ function mcp_fork_topic($topic_ids)
if ($additional_msg)
{
- unset($_POST['confirm']);
- unset($_REQUEST['confirm_key']);
+ $request->overwrite('confirm', null, phpbb_request_interface::POST);
+ $request->overwrite('confirm_key', null);
}
if (confirm_box(true))
@@ -1314,5 +1169,3 @@ function mcp_fork_topic($topic_ids)
trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link);
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php
index 02a89c0251..dfb6ed3b68 100644
--- a/phpBB/includes/mcp/mcp_notes.php
+++ b/phpBB/includes/mcp/mcp_notes.php
@@ -247,5 +247,3 @@ class mcp_notes
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/mcp_pm_reports.php b/phpBB/includes/mcp/mcp_pm_reports.php
index 72f77fae7c..e61e8390c9 100644
--- a/phpBB/includes/mcp/mcp_pm_reports.php
+++ b/phpBB/includes/mcp/mcp_pm_reports.php
@@ -319,5 +319,3 @@ class mcp_pm_reports
}
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php
index de7f3e63ee..4e0aae1870 100644
--- a/phpBB/includes/mcp/mcp_post.php
+++ b/phpBB/includes/mcp/mcp_post.php
@@ -497,5 +497,3 @@ function change_poster(&$post_info, $userdata)
// Now add log entry
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
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index c419da5574..0630f55b12 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -268,13 +268,11 @@ class mcp_queue
trigger_error('NOT_MODERATOR');
}
- $global_id = $forum_list[0];
-
$forum_list = implode(', ', $forum_list);
$sql = 'SELECT SUM(forum_topics) as sum_forum_topics
- FROM ' . FORUMS_TABLE . "
- WHERE forum_id IN (0, $forum_list)";
+ FROM ' . FORUMS_TABLE . '
+ WHERE ' . $db->sql_in_set('forum_id', $forum_list);
$result = $db->sql_query($sql);
$forum_info['forum_topics'] = (int) $db->sql_fetchfield('sum_forum_topics');
$db->sql_freeresult($result);
@@ -290,7 +288,6 @@ class mcp_queue
$forum_info = $forum_info[$forum_id];
$forum_list = $forum_id;
- $global_id = $forum_id;
}
$forum_options = '<option value="0"' . (($forum_id == 0) ? ' selected="selected"' : '') . '>' . $user->lang['ALL_FORUMS'] . '</option>';
@@ -312,10 +309,10 @@ class mcp_queue
if ($mode == 'unapproved_posts')
{
$sql = 'SELECT p.post_id
- FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t' . (($sort_order_sql[0] == 'u') ? ', ' . USERS_TABLE . ' u' : '') . "
- WHERE p.forum_id IN (0, $forum_list)
+ FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t' . (($sort_order_sql[0] == 'u') ? ', ' . USERS_TABLE . ' u' : '') . '
+ WHERE ' . $db->sql_in_set('p.forum_id', $forum_list) . '
AND p.post_approved = 0
- " . (($sort_order_sql[0] == 'u') ? 'AND u.user_id = p.poster_id' : '') . '
+ ' . (($sort_order_sql[0] == 'u') ? 'AND u.user_id = p.poster_id' : '') . '
' . (($topic_id) ? 'AND p.topic_id = ' . $topic_id : '') . "
AND t.topic_id = p.topic_id
AND t.topic_first_post_id <> p.post_id
@@ -345,10 +342,7 @@ class mcp_queue
$post_data = $rowset = array();
while ($row = $db->sql_fetchrow($result))
{
- if ($row['forum_id'])
- {
- $forum_names[] = $row['forum_id'];
- }
+ $forum_names[] = $row['forum_id'];
$post_data[$row['post_id']] = $row;
}
$db->sql_freeresult($result);
@@ -368,7 +362,7 @@ class mcp_queue
{
$sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, t.topic_title AS post_subject, t.topic_time AS post_time, t.topic_poster AS poster_id, t.topic_first_post_id AS post_id, t.topic_first_poster_name AS username, t.topic_first_poster_colour AS user_colour
FROM ' . TOPICS_TABLE . " t
- WHERE forum_id IN (0, $forum_list)
+ WHERE " . $db->sql_in_set('forum_id', $forum_list) . "
AND topic_approved = 0
$limit_time_sql
ORDER BY $sort_order_sql";
@@ -377,10 +371,7 @@ class mcp_queue
$rowset = array();
while ($row = $db->sql_fetchrow($result))
{
- if ($row['forum_id'])
- {
- $forum_names[] = $row['forum_id'];
- }
+ $forum_names[] = $row['forum_id'];
$rowset[] = $row;
}
$db->sql_freeresult($result);
@@ -404,12 +395,6 @@ class mcp_queue
foreach ($rowset as $row)
{
- $global_topic = ($row['forum_id']) ? false : true;
- if ($global_topic)
- {
- $row['forum_id'] = $global_id;
- }
-
if (empty($row['post_username']))
{
$row['post_username'] = $user->lang['GUEST'];
@@ -417,7 +402,7 @@ class mcp_queue
$template->assign_block_vars('postrow', array(
'U_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id']),
- 'U_VIEWFORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '',
+ 'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']),
'U_VIEWPOST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;p=' . $row['post_id']) . (($mode == 'unapproved_posts') ? '#p' . $row['post_id'] : ''),
'U_VIEW_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&amp;start=$start&amp;mode=approve_details&amp;f={$row['forum_id']}&amp;p={$row['post_id']}" . (($mode == 'unapproved_topics') ? "&amp;t={$row['topic_id']}" : '')),
@@ -427,7 +412,7 @@ class mcp_queue
'U_POST_AUTHOR' => get_username_string('profile', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
'POST_ID' => $row['post_id'],
- 'FORUM_NAME' => (!$global_topic) ? $forum_names[$row['forum_id']] : $user->lang['GLOBAL_ANNOUNCEMENT'],
+ 'FORUM_NAME' => $forum_names[$row['forum_id']],
'POST_SUBJECT' => ($row['post_subject'] != '') ? $row['post_subject'] : $user->lang['NO_SUBJECT'],
'TOPIC_TITLE' => $row['topic_title'],
'POST_TIME' => $user->format_date($row['post_time']))
@@ -504,11 +489,7 @@ function approve_post($post_id_list, $id, $mode)
}
$topic_id_list[$post_data['topic_id']] = 1;
-
- if ($post_data['forum_id'])
- {
- $forum_id_list[$post_data['forum_id']] = 1;
- }
+ $forum_id_list[$post_data['forum_id']] = 1;
// User post update (we do not care about topic or post, since user posts are strictly connected to posts)
// But we care about forums where post counts get not increased. ;)
@@ -520,10 +501,7 @@ function approve_post($post_id_list, $id, $mode)
// Topic or Post. ;)
if ($post_data['topic_first_post_id'] == $post_id)
{
- if ($post_data['forum_id'])
- {
- $total_topics++;
- }
+ $total_topics++;
$topic_approve_sql[] = $post_data['topic_id'];
$approve_log[] = array(
@@ -543,16 +521,13 @@ function approve_post($post_id_list, $id, $mode)
);
}
- if ($post_data['forum_id'])
- {
- $total_posts++;
+ $total_posts++;
- // Increment by topic_replies if we approve a topic...
- // This works because we do not adjust the topic_replies when re-approving a topic after an edit.
- if ($post_data['topic_first_post_id'] == $post_id && $post_data['topic_replies'])
- {
- $total_posts += $post_data['topic_replies'];
- }
+ // Increment by topic_replies if we approve a topic...
+ // This works because we do not adjust the topic_replies when re-approving a topic after an edit.
+ if ($post_data['topic_first_post_id'] == $post_id && $post_data['topic_replies'])
+ {
+ $total_posts += $post_data['topic_replies'];
}
$post_approve_sql[] = $post_id;
@@ -744,6 +719,7 @@ function disapprove_post($post_id_list, $id, $mode)
{
global $db, $template, $user, $config;
global $phpEx, $phpbb_root_path;
+ global $request;
if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve')))
{
@@ -778,7 +754,7 @@ function disapprove_post($post_id_list, $id, $mode)
if (!$row || (!$reason && strtolower($row['reason_title']) == 'other'))
{
$additional_msg = $user->lang['NO_REASON_DISAPPROVAL'];
- unset($_POST['confirm']);
+ $request->overwrite('confirm', null, phpbb_request_interface::POST);
}
else
{
@@ -992,5 +968,3 @@ function disapprove_post($post_id_list, $id, $mode)
trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], "<a href=\"$redirect\">", '</a>'));
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php
index 39d9fbd4af..a7275382e6 100644
--- a/phpBB/includes/mcp/mcp_reports.php
+++ b/phpBB/includes/mcp/mcp_reports.php
@@ -312,7 +312,6 @@ class mcp_reports
$forum_info = $forum_info[$forum_id];
$forum_list = array($forum_id);
- $global_id = $forum_id;
}
$forum_list[] = 0;
@@ -382,14 +381,8 @@ class mcp_reports
$report_data = $rowset = array();
while ($row = $db->sql_fetchrow($result))
{
- $global_topic = ($row['forum_id']) ? false : true;
- if ($global_topic)
- {
- $row['forum_id'] = $global_id;
- }
-
$template->assign_block_vars('postrow', array(
- 'U_VIEWFORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '',
+ 'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']),
'U_VIEWPOST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;p=' . $row['post_id']) . '#p' . $row['post_id'],
'U_VIEW_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=reports&amp;start=$start&amp;mode=report_details&amp;f={$row['forum_id']}&amp;r={$row['report_id']}"),
@@ -403,7 +396,7 @@ class mcp_reports
'REPORTER' => get_username_string('username', $row['reporter_id'], $row['reporter_name'], $row['reporter_colour']),
'U_REPORTER' => get_username_string('profile', $row['reporter_id'], $row['reporter_name'], $row['reporter_colour']),
- 'FORUM_NAME' => (!$global_topic) ? $forum_data[$row['forum_id']]['forum_name'] : $user->lang['GLOBAL_ANNOUNCEMENT'],
+ 'FORUM_NAME' => $forum_data[$row['forum_id']]['forum_name'],
'POST_ID' => $row['post_id'],
'POST_SUBJECT' => ($row['post_subject']) ? $row['post_subject'] : $user->lang['NO_SUBJECT'],
'POST_TIME' => $user->format_date($row['post_time']),
@@ -723,5 +716,3 @@ function close_report($report_id_list, $mode, $action, $pm = false)
trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_forum . $return_topic . sprintf($user->lang['RETURN_PAGE'], "<a href=\"$redirect\">", '</a>'));
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php
index 76cd9beb92..8a8ef11289 100644
--- a/phpBB/includes/mcp/mcp_topic.php
+++ b/phpBB/includes/mcp/mcp_topic.php
@@ -638,5 +638,3 @@ function merge_posts($topic_id, $to_topic_id)
trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link);
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php
index 63e5b19155..9339389ea4 100644
--- a/phpBB/includes/mcp/mcp_warn.php
+++ b/phpBB/includes/mcp/mcp_warn.php
@@ -507,5 +507,3 @@ function add_warning($user_row, $warning, $send_pm = true, $post_id = 0)
add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_USER_WARNING', $user_row['username']);
}
-
-?> \ No newline at end of file