mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
Some debug code removed, minor bugfixes.
git-svn-id: file:///svn/phpbb/trunk@3605 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
9e9d126a6a
commit
04e9ebb824
1 changed files with 36 additions and 90 deletions
108
phpBB/mcp.php
108
phpBB/mcp.php
|
@ -23,7 +23,6 @@
|
||||||
//
|
//
|
||||||
// * Plug-in based?
|
// * Plug-in based?
|
||||||
// * Add session_id checks for all Moderator ops
|
// * Add session_id checks for all Moderator ops
|
||||||
// * Tab based system
|
|
||||||
// * Front page:
|
// * Front page:
|
||||||
// * Select box listing all forums to which user has moderator rights
|
// * Select box listing all forums to which user has moderator rights
|
||||||
// * Five(?) most recent Moderator log entries (for relevant forum/s)
|
// * Five(?) most recent Moderator log entries (for relevant forum/s)
|
||||||
|
@ -35,10 +34,6 @@
|
||||||
// * Topic view:
|
// * Topic view:
|
||||||
// * As current(?) plus differing colours for Approved/Unapproved topics/posts
|
// * 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
|
// * 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:
|
// * Find duplicates:
|
||||||
// * List supiciously similar posts across forum/s
|
// * List supiciously similar posts across forum/s
|
||||||
// * "Ban" user/s:
|
// * "Ban" user/s:
|
||||||
|
@ -58,15 +53,6 @@ $auth->acl($user->data);
|
||||||
// End session management
|
// End session management
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
$sql = 'SELECT auth_option_id, auth_value FROM phpbb_auth_options';
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
while ($row=$db->sql_fetchrow($result))
|
|
||||||
{
|
|
||||||
echo "$row[auth_option_id] $row[auth_value] => " . $auth->acl_get($row['auth_value'], 2) . "<br/>";
|
|
||||||
}
|
|
||||||
/**/
|
|
||||||
|
|
||||||
// temp temp temp
|
// temp temp temp
|
||||||
very_temporary_lang_strings();
|
very_temporary_lang_strings();
|
||||||
// temp temp temp
|
// temp temp temp
|
||||||
|
@ -468,7 +454,7 @@ foreach ($tabs as $tab_name => $tab_link)
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Do major work ... (<= being the 1-billion dollars man)
|
// Do major work...
|
||||||
//
|
//
|
||||||
// Current modes:
|
// Current modes:
|
||||||
// - resync Resyncs topics
|
// - resync Resyncs topics
|
||||||
|
@ -477,6 +463,8 @@ foreach ($tabs as $tab_name => $tab_link)
|
||||||
// - select_topic Forward the user to forum view to select a destination topic for the merge
|
// - select_topic Forward the user to forum view to select a destination topic for the merge
|
||||||
// - merge Topic view, only displays the Merge button
|
// - merge Topic view, only displays the Merge button
|
||||||
// - split Topic view, only displays the split buttons
|
// - 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
|
// - delete Topic view, only displays the Delete button
|
||||||
// - topic_view Topic view, similar to viewtopic.php
|
// - topic_view Topic view, similar to viewtopic.php
|
||||||
// - forum_view Forum view, similar to viewforum.php
|
// - forum_view Forum view, similar to viewforum.php
|
||||||
|
@ -486,8 +474,6 @@ foreach ($tabs as $tab_name => $tab_link)
|
||||||
// - ip Displays poster's ip and other ips the user has posted from. (imported straight from 2.0.x)
|
// - ip Displays poster's ip and other ips the user has posted from. (imported straight from 2.0.x)
|
||||||
//
|
//
|
||||||
// TODO:
|
// TODO:
|
||||||
// - split_all Actually split selected topic
|
|
||||||
// - split_beyond Actually split selected topic
|
|
||||||
// - post_details Displays post details. Has quick links to (un)approve post.
|
// - post_details Displays post details. Has quick links to (un)approve post.
|
||||||
// - mod_queue Displays a list or unapproved posts and/or topics. I haven't designed the interface yet but it will have to be able to filter/order them by type (posts/topics), by timestamp or by forum.
|
// - mod_queue Displays a list or unapproved posts and/or topics. I haven't designed the interface yet but it will have to be able to filter/order them by type (posts/topics), by timestamp or by forum.
|
||||||
// - post_reports Displays a list of reported posts. No interface yet, must be able to order them by priority(?), type, timestamp or forum. Action: view all (default), read, delete.
|
// - post_reports Displays a list of reported posts. No interface yet, must be able to order them by priority(?), type, timestamp or forum. Action: view all (default), read, delete.
|
||||||
|
@ -495,7 +481,6 @@ foreach ($tabs as $tab_name => $tab_link)
|
||||||
// - notes Displays moderators notes for current forum or for all forums the user is a moderator of. Actions: view all (default), read, add, delete, edit(?).
|
// - notes Displays moderators notes for current forum or for all forums the user is a moderator of. Actions: view all (default), read, add, delete, edit(?).
|
||||||
// - a hell lot of other things
|
// - a hell lot of other things
|
||||||
//
|
//
|
||||||
// TODO: add needed acl checks for each mode.
|
|
||||||
|
|
||||||
switch ($mode)
|
switch ($mode)
|
||||||
{
|
{
|
||||||
|
@ -617,15 +602,6 @@ switch ($mode)
|
||||||
|
|
||||||
$posts_per_page = (isset($_REQUEST['posts_per_page'])) ? intval($_REQUEST['posts_per_page']) : $config['posts_per_page'];
|
$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.
|
// Following section altered for consistency with viewforum, viewtopic, etc.
|
||||||
// Post ordering options
|
// 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']);
|
$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']);
|
||||||
|
@ -665,8 +641,7 @@ switch ($mode)
|
||||||
AND p.poster_id = u.user_id
|
AND p.poster_id = u.user_id
|
||||||
$limit_posts_time
|
$limit_posts_time
|
||||||
ORDER BY $sort_order";
|
ORDER BY $sort_order";
|
||||||
// $result = $db->sql_query_limit($sql, $posts_per_page, $start);
|
$result = $db->sql_query_limit($sql, $posts_per_page, $start);
|
||||||
$result = $db->sql_query_limit($sql, $start, $posts_per_page);
|
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
|
@ -948,22 +923,26 @@ switch ($mode)
|
||||||
$total_posts = $topic_info['topic_replies'] + 1;
|
$total_posts = $topic_info['topic_replies'] + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if needed, join the users table
|
||||||
|
if ($sort_order{0} == 'u')
|
||||||
|
{
|
||||||
$sql = 'SELECT p.post_id
|
$sql = 'SELECT p.post_id
|
||||||
FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u
|
FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u
|
||||||
WHERE p.topic_id = $topic_id
|
WHERE p.topic_id = $topic_id
|
||||||
AND p.poster_id = u.user_id
|
AND p.poster_id = u.user_id
|
||||||
$limit_posts_time
|
$limit_posts_time
|
||||||
ORDER BY $sort_order
|
ORDER BY $sort_order";
|
||||||
LIMIT $start, -1";
|
}
|
||||||
$result = $db->sql_query($sql);
|
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, -1, $start);
|
||||||
|
|
||||||
/*
|
|
||||||
$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();
|
$post_id_list = array();
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
|
@ -976,7 +955,6 @@ switch ($mode)
|
||||||
trigger_error('Line : ' . __LINE__ . '<br/><br/>' . $user->lang['None_selected'] . $return_split);
|
trigger_error('Line : ' . __LINE__ . '<br/><br/>' . $user->lang['None_selected'] . $return_split);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
$icon_id = (!empty($_POST['icon'])) ? intval($_POST['icon']) : 0;
|
$icon_id = (!empty($_POST['icon'])) ? intval($_POST['icon']) : 0;
|
||||||
$sql = 'INSERT INTO ' . TOPICS_TABLE . " (forum_id, topic_title, icon_id, topic_approved)
|
$sql = 'INSERT INTO ' . TOPICS_TABLE . " (forum_id, topic_title, icon_id, topic_approved)
|
||||||
VALUES ($to_forum_id, '" . $db->sql_escape($subject) . "', $icon_id, 1)";
|
VALUES ($to_forum_id, '" . $db->sql_escape($subject) . "', $icon_id, 1)";
|
||||||
|
@ -984,7 +962,6 @@ switch ($mode)
|
||||||
|
|
||||||
$to_topic_id = $db->sql_nextid();
|
$to_topic_id = $db->sql_nextid();
|
||||||
move_posts($post_id_list, $to_topic_id);
|
move_posts($post_id_list, $to_topic_id);
|
||||||
*/
|
|
||||||
|
|
||||||
$return_url = '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="viewtopic.' . $phpEx . $SID . '&t=' . $topic_id . '">', '</a>');
|
$return_url = '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="viewtopic.' . $phpEx . $SID . '&t=' . $topic_id . '">', '</a>');
|
||||||
$return_url .= '<br /><br />' . sprintf($user->lang['CLICK_GO_NEW_TOPIC'], '<a href="viewtopic.' . $phpEx . $SID . '&t=' . $to_topic_id . '">', '</a>');
|
$return_url .= '<br /><br />' . sprintf($user->lang['CLICK_GO_NEW_TOPIC'], '<a href="viewtopic.' . $phpEx . $SID . '&t=' . $to_topic_id . '">', '</a>');
|
||||||
|
@ -1082,13 +1059,7 @@ switch ($mode)
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case 'select_topic':
|
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':
|
case 'forum_view':
|
||||||
mcp_header('mcp_forum.html', TRUE);
|
mcp_header('mcp_forum.html', TRUE);
|
||||||
|
|
||||||
|
@ -1172,7 +1143,7 @@ switch ($mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_block_vars('topicrow', array(
|
$template->assign_block_vars('topicrow', array(
|
||||||
'U_VIEW_TOPIC' => $mcp_url . '&t=' . $row['topic_id'] . '&mode=topic_view',
|
'U_VIEW_TOPIC' => "mcp.$phpEx$SID&p=$post_id&t=" . $row['topic_id'] . '&mode=topic_view',
|
||||||
|
|
||||||
'S_SELECT_TOPIC' => ($mode == 'select_topic' && $row['topic_id'] != $topic_id) ? TRUE : FALSE,
|
'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,
|
'U_SELECT_TOPIC' => $mcp_url . '&mode=merge&to_topic_id=' . $row['topic_id'] . $url_extra,
|
||||||
|
@ -1189,8 +1160,8 @@ switch ($mode)
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'PAGINATION' => generate_pagination("mcp.$phpEx$SID&f=$forum_id", $forum_info['forum_topics'], $config['topics_per_page'], $start),
|
'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;
|
break;
|
||||||
|
|
||||||
case 'front':
|
case 'front':
|
||||||
|
@ -1207,7 +1178,7 @@ include($phpbb_root_path . 'includes/page_tail.' . $phpEx);
|
||||||
function mcp_header($template_name, $forum_nav = FALSE, $jump_mode = 'forum_view')
|
function mcp_header($template_name, $forum_nav = FALSE, $jump_mode = 'forum_view')
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx, $SID, $template, $auth, $user, $db, $config;
|
global $phpbb_root_path, $phpEx, $SID, $template, $auth, $user, $db, $config;
|
||||||
global $forum_id, $forum_info;
|
global $forum_id, $forum_info, $url_extra;
|
||||||
|
|
||||||
$forum_id = (!empty($forum_id)) ? $forum_id : FALSE;
|
$forum_id = (!empty($forum_id)) ? $forum_id : FALSE;
|
||||||
$extra_form_fields = array(
|
$extra_form_fields = array(
|
||||||
|
@ -1215,11 +1186,14 @@ 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
|
// 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']))
|
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'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$url = "mcp.$phpEx$SID" . ((!empty($_GET['post_id_list'])) ? '&post_id_list
|
||||||
|
|
||||||
$page_title = sprintf($user->lang['MCP'], '', '');
|
$page_title = sprintf($user->lang['MCP'], '', '');
|
||||||
include($phpbb_root_path . 'includes/page_header.' . $phpEx);
|
include($phpbb_root_path . 'includes/page_header.' . $phpEx);
|
||||||
|
|
||||||
|
@ -1227,7 +1201,7 @@ function mcp_header($template_name, $forum_nav = FALSE, $jump_mode = 'forum_view
|
||||||
'body' => $template_name
|
'body' => $template_name
|
||||||
));
|
));
|
||||||
|
|
||||||
make_jumpbox('mcp.' . $phpEx, $forum_id, $extra_form_fields);
|
make_jumpbox('mcp.' . $phpEx . $SID . $url_extra, $forum_id, $extra_form_fields);
|
||||||
|
|
||||||
if ($forum_nav)
|
if ($forum_nav)
|
||||||
{
|
{
|
||||||
|
@ -1873,34 +1847,6 @@ function very_temporary_lang_strings()
|
||||||
'merge' => 'Merge topic',
|
'merge' => 'Merge topic',
|
||||||
'split' => 'Split 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 ^ ^'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
Loading…
Add table
Reference in a new issue