1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-06 15:45:34 +02:00

- removed unnecessary urlencode of highlight words

various mcp_main updates:
- generally make all the tools work again (mode/action changes)
- tidy up urls
- restructured quickmod code to use actions (we don't want too many module entries)


git-svn-id: file:///svn/phpbb/trunk@5526 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Nils Adermann 2006-02-05 01:40:45 +00:00
parent b09c5f6a25
commit db145d79b3
14 changed files with 377 additions and 488 deletions

View File

@ -1869,11 +1869,11 @@ function cache_moderators()
*/
function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id = 0, $topic_id = 0, $user_id = 0, $limit_days = 0, $sort_by = 'l.log_time DESC')
{
global $db, $user, $auth, $phpEx, $SID;
global $db, $user, $auth, $phpEx, $SID, $phpbb_root_path;
$topic_id_list = $is_auth = $is_mod = array();
$profile_url = (defined('IN_ADMIN')) ? "index.$phpEx$SID&i=users&mode=overview" : "memberlist.$phpEx$SID&mode=viewprofile";
$profile_url = (defined('IN_ADMIN')) ? "{$phpbb_root_path}index.$phpEx$SID&i=users&mode=overview" : "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile";
switch ($mode)
{
@ -1937,7 +1937,7 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
$log[$i]['time'] = $row['log_time'];
$log[$i]['forum_id'] = $row['forum_id'];
$log[$i]['topic_id'] = $row['topic_id'];
$log[$i]['viewforum'] = ($row['forum_id'] && $auth->acl_get('f_read', $row['forum_id'])) ? ((defined('IN_ADMIN')) ? '../' : '') . "viewforum.$phpEx$SID&f=" . $row['forum_id'] : '';
$log[$i]['viewforum'] = ($row['forum_id'] && $auth->acl_get('f_read', $row['forum_id'])) ? "{$phpbb_root_path}viewforum.$phpEx$SID&f=" . $row['forum_id'] : '';
$log[$i]['action'] = (isset($user->lang[$row['log_operation']])) ? $user->lang[$row['log_operation']] : '{' . ucfirst(str_replace('_', ' ', $row['log_operation'])) . '}';
@ -1992,8 +1992,8 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
foreach ($log as $key => $row)
{
$log[$key]['viewtopic'] = (isset($is_auth[$row['topic_id']])) ? ((defined('IN_ADMIN')) ? '../' : '') . "viewtopic.$phpEx$SID&f=" . $is_auth[$row['topic_id']] . '&t=' . $row['topic_id'] : '';
$log[$key]['viewlogs'] = (isset($is_mod[$row['topic_id']])) ? ((defined('IN_ADMIN')) ? '../' : '') . "mcp.$phpEx$SID&mode=logs&action=topic_logs&t=" . $row['topic_id'] : '';
$log[$key]['viewtopic'] = (isset($is_auth[$row['topic_id']])) ? "{$phpbb_root_path}viewtopic.$phpEx$SID&f=" . $is_auth[$row['topic_id']] . '&t=' . $row['topic_id'] : '';
$log[$key]['viewlogs'] = (isset($is_mod[$row['topic_id']])) ? "{$phpbb_root_path}mcp.$phpEx$SID&i=logs&mode=topic_logs&t=" . $row['topic_id'] : '';
}
}

View File

@ -11,11 +11,13 @@
/**
* MCP Forum View
*/
function mcp_forum_view($id, $mode, $action, $url, $forum_info)
function mcp_forum_view($id, $mode, $action, $forum_info)
{
global $template, $db, $user, $auth, $cache;
global $SID, $phpEx, $phpbb_root_path, $config;
$url = "{$phpbb_root_path}mcp.$phpEx$SID" . extra_url();
if ($action == 'merge_select')
{
// Fixes a "bug" that makes forum_view use the same ordering as topic_view
@ -33,14 +35,7 @@ function mcp_forum_view($id, $mode, $action, $url, $forum_info)
{
$topic_ids = request_var('topic_id_list', array(0));
if (!sizeof($topic_ids))
{
$template->assign_var('MESSAGE', $user->lang['NO_TOPIC_SELECTED']);
}
else
{
mcp_resync_topics($topic_ids);
}
mcp_resync_topics($topic_ids);
}
$selected_ids = '';
@ -52,7 +47,7 @@ function mcp_forum_view($id, $mode, $action, $url, $forum_info)
}
}
make_jumpbox($url . "&action=$action&mode=$mode", $forum_id . (($action == 'merge_select') ? $selected_ids : ''), false, 'm_');
make_jumpbox($url . "&i=$id&action=$action&mode=$mode", $forum_id . (($action == 'merge_select') ? $selected_ids : ''), false, 'm_');
$topics_per_page = ($forum_info['forum_topics_per_page']) ? $forum_info['forum_topics_per_page'] : $config['topics_per_page'];
@ -62,6 +57,7 @@ function mcp_forum_view($id, $mode, $action, $url, $forum_info)
$template->assign_vars(array(
'FORUM_NAME' => $forum_info['forum_name'],
'FORUM_DESCRIPTION' => $forum_info['forum_desc'],
'REPORTED_IMG' => $user->img('icon_reported', 'TOPIC_REPORTED'),
'UNAPPROVED_IMG' => $user->img('icon_unapproved', 'TOPIC_UNAPPROVED'),
@ -73,10 +69,12 @@ function mcp_forum_view($id, $mode, $action, $url, $forum_info)
'S_CAN_SYNC' => $auth->acl_get('m_', $forum_id),
'S_CAN_APPROVE' => $auth->acl_get('m_approve', $forum_id),
'U_VIEW_FORUM' => "viewforum.$phpEx$SID&f=" . $forum_id,
'S_MCP_ACTION' => $url . "&action=$action&mode=$mode&start=$start" . (($action == 'merge_select') ? $selected_ids : ''),
'U_VIEW_FORUM' => "{$phpbb_root_path}viewforum.$phpEx$SID&f=" . $forum_id,
'U_VIEW_FORUM_LOGS' => ($auth->acl_gets('a_', 'm_', $forum_id)) ? "{$phpbb_root_path}mcp.$phpEx$SID&i=logs&mode=forum_logs&f=" . $forum_id : '',
'PAGINATION' => generate_pagination($url . "&action=$action&mode=$mode" . (($action == 'merge_select') ? $selected_ids : ''), $forum_topics, $topics_per_page, $start),
'S_MCP_ACTION' => $url . "&i=$id&action=$action&mode=$mode&start=$start" . (($action == 'merge_select') ? $selected_ids : ''),
'PAGINATION' => generate_pagination($url . "&i=$id&action=$action&mode=$mode" . (($action == 'merge_select') ? $selected_ids : ''), $forum_topics, $topics_per_page, $start),
'PAGE_NUMBER' => on_page($forum_topics, $topics_per_page, $start),
'TOTAL' => $forum_topics)
);
@ -178,14 +176,14 @@ function mcp_forum_view($id, $mode, $action, $url, $forum_info)
}
$topic_title = censor_text($row['topic_title']);
$template->assign_block_vars('topicrow', array(
'U_VIEW_TOPIC' => "mcp.$phpEx$SID&f=$forum_id&t={$row['topic_id']}&mode=topic_view",
'U_VIEW_TOPIC' => "{$phpbb_root_path}mcp.$phpEx$SID&i=$id&f=$forum_id&t={$row['topic_id']}&mode=topic_view",
'S_SELECT_TOPIC' => ($action == 'merge_select' && $row['topic_id'] != $topic_id) ? true : false,
'U_SELECT_TOPIC' => $url . '&mode=topic_view&action=merge&to_topic_id=' . $row['topic_id'] . $selected_ids,
'U_SELECT_TOPIC' => $url . "&i=$id&mode=topic_view&action=merge&to_topic_id=" . $row['topic_id'] . $selected_ids,
'U_MCP_QUEUE' => $url . '&i=queue&mode=approve_details&t=' . $row['topic_id'],
'U_MCP_REPORT' => "mcp.$phpEx$SID&i=main&mode=topic_view&t={$row['topic_id']}&action=reports",
'U_MCP_REPORT' => "{$phpbb_root_path}mcp.$phpEx$SID&i=main&mode=topic_view&t={$row['topic_id']}&action=reports",
'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $row['forum_id']) && $row['topic_attachment']) ? $user->img('icon_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
@ -222,10 +220,10 @@ function mcp_resync_topics($topic_ids)
if (!sizeof($topic_ids))
{
$template->assign_var('MESSAGE', $user->lang['NO_TOPIC_SELECTED']);
trigger_error($user->lang['NO_TOPIC_SELECTED']);
return;
}
// Sync everything and perform extra checks separately
sync('topic_reported', 'topic_id', $topic_ids, false, true);
sync('topic_attachment', 'topic_id', $topic_ids, false, true);
@ -243,7 +241,11 @@ function mcp_resync_topics($topic_ids)
}
$msg = (sizeof($topic_ids) == 1) ? $user->lang['TOPIC_RESYNC_SUCCESS'] : $user->lang['TOPICS_RESYNC_SUCCESS'];
$template->assign_var('MESSAGE', $msg);
$redirect = request_var('redirect', $user->data['session_page']);
meta_refresh(2, $redirect);
trigger_error($msg . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
return;
}

View File

@ -11,11 +11,13 @@
/**
* MCP Front Panel
*/
function mcp_front_view($id, $mode, $action, $url)
function mcp_front_view($id, $mode, $action)
{
global $SID, $phpEx, $phpbb_root_path, $config;
global $template, $db, $user, $auth;
$url = "{$phpbb_root_path}mcp.$phpEx$SID" . extra_url();
// Latest 5 unapproved
$forum_list = get_forum_list('m_approve');
$post_list = array();
@ -39,8 +41,8 @@ function mcp_front_view($id, $mode, $action, $url)
$sql = 'SELECT forum_id, forum_name
FROM ' . FORUMS_TABLE . '
WHERE forum_id IN (' . implode(', ', $forum_list) . ')';
$result = $db->sql_query_limit($sql);
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$forum_names[$row['forum_id']] = $row['forum_name'];
@ -69,19 +71,19 @@ function mcp_front_view($id, $mode, $action, $url)
while ($row = $db->sql_fetchrow($result))
{
$template->assign_block_vars('unapproved', array(
'U_POST_DETAILS'=> $url . '&amp;p=' . $row['post_id'] . '&amp;mode=post_details',
'U_MCP_FORUM' => ($row['forum_id']) ? $url . '&amp;f=' . $row['forum_id'] . '&amp;mode=forum_view' : '',
'U_MCP_TOPIC' => $url . '&amp;t=' . $row['topic_id'] . '&amp;mode=topic_view',
'U_FORUM' => ($row['forum_id']) ? 'viewforum.' . $phpEx . $SID . '&amp;f=' . $row['forum_id'] : '',
'U_TOPIC' => $phpbb_root_path . 'viewtopic.' . $phpEx . $SID . '&amp;f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . '&amp;t=' . $row['topic_id'],
'U_AUTHOR' => ($row['poster_id'] == ANONYMOUS) ? '' : 'memberlist.' . $phpEx . $SID . '&amp;mode=viewprofile&amp;u=' . $row['poster_id'],
'U_POST_DETAILS'=> $url . '&amp;i=main&amp;mode=post_details&amp;p=' . $row['post_id'],
'U_MCP_FORUM' => ($row['forum_id']) ? $url . '&amp;i=main&amp;mode=forum_view&amp;f=' . $row['forum_id'] : '',
'U_MCP_TOPIC' => $url . '&amp;i=main&amp;mode=topic_view&amp;t=' . $row['topic_id'],
'U_FORUM' => ($row['forum_id']) ? "{$phpbb_root_path}viewforum.$phpEx$SID&amp;f=" . $row['forum_id'] : '',
'U_TOPIC' => $phpbb_root_path . "{$phpbb_root_path}viewtopic.$phpEx$SID&amp;f=" . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . '&amp;t=' . $row['topic_id'],
'U_AUTHOR' => ($row['poster_id'] == ANONYMOUS) ? '' : "{$phpbb_root_path}memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u=" . $row['poster_id'],
'FORUM_NAME' => ($row['forum_id']) ? $forum_names[$row['forum_id']] : $user->lang['GLOBAL_ANNOUNCEMENT'],
'TOPIC_TITLE' => $row['topic_title'],
'AUTHOR' => ($row['poster_id'] == ANONYMOUS) ? (($row['post_username']) ? $row['post_username'] : $user->lang['GUEST']) : $row['username'],
'SUBJECT' => ($row['post_subject']) ? $row['post_subject'] : $user->lang['NO_SUBJECT'],
'POST_TIME' => $user->format_date($row['post_time']))
);
);
}
}
@ -103,7 +105,7 @@ function mcp_front_view($id, $mode, $action, $url)
// Latest 5 reported
$forum_list = get_forum_list('m_');
$template->assign_var('S_SHOW_REPORTS', (!empty($forum_list)) ? true : false);
if (!empty($forum_list))
{
@ -134,16 +136,16 @@ function mcp_front_view($id, $mode, $action, $url)
'U_POST_DETAILS'=> $url . '&amp;p=' . $row['post_id'] . '&amp;mode=post_details',
'U_MCP_FORUM' => ($row['forum_id']) ? $url . '&amp;f=' . $row['forum_id'] . '&amp;mode=forum_view' : '',
'U_MCP_TOPIC' => $url . '&amp;t=' . $row['topic_id'] . '&amp;mode=topic_view',
'U_FORUM' => ($row['forum_id']) ? 'viewforum.' . $phpEx . $SID . '&amp;f=' . $row['forum_id'] : '',
'U_TOPIC' => 'viewtopic.' . $phpEx . $SID . '&amp;f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id'],
'U_REPORTER' => ($row['user_id'] == ANONYMOUS) ? '' : 'memberlist.' . $phpEx . $SID . '&amp;mode=viewprofile&amp;u=' . $row['user_id'],
'U_FORUM' => ($row['forum_id']) ? "{$phpbb_root_path}viewforum.$phpEx$SID&amp;f=" . $row['forum_id'] : '',
'U_TOPIC' => "{$phpbb_root_path}viewtopic.$phpEx$SID&amp;f=" . $row['forum_id'] . '&amp;t=' . $row['topic_id'],
'U_REPORTER' => ($row['user_id'] == ANONYMOUS) ? '' : "{$phpbb_root_path}memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u=" . $row['user_id'],
'FORUM_NAME' => ($row['forum_id']) ? $row['forum_name'] : $user->lang['POST_GLOBAL'],
'TOPIC_TITLE' => $row['topic_title'],
'REPORTER' => ($row['user_id'] == ANONYMOUS) ? $user->lang['GUEST'] : $row['username'],
'SUBJECT' => ($row['post_subject']) ? $row['post_subject'] : $user->lang['NO_SUBJECT'],
'REPORT_TIME' => $user->format_date($row['report_time']))
);
);
}
}

View File

@ -17,7 +17,7 @@ class mcp_main
{
var $p_master;
function mcp_main(&$p_master)
{
$this->p_master = &$p_master;
@ -25,30 +25,24 @@ class mcp_main
function main($id, $mode)
{
global $auth, $db, $user, $template;
global $auth, $db, $user, $template, $action;
global $config, $phpbb_root_path, $phpEx, $SID;
$action = request_var('action', '');
$quickmod = request_var('quickmod', '');
if (is_array($action))
{
list($action, ) = each($action);
}
$quickmod = ($mode == 'quickmod') ? true : false;
switch ($mode)
switch ($action)
{
case 'lock':
case 'unlock':
$topic_ids = (!$quickmod) ? request_var('topic_id_list', array(0)) : array(request_var('t', 0));
if (!sizeof($topic_ids))
{
trigger_error('NO_TOPIC_SELECTED');
}
lock_unlock($mode, $topic_ids);
break;
lock_unlock($action, $topic_ids);
break;
case 'lock_post':
case 'unlock_post':
@ -60,65 +54,62 @@ class mcp_main
trigger_error('NO_POST_SELECTED');
}
lock_unlock($mode, $post_ids);
break;
lock_unlock($action, $post_ids);
break;
case 'make_announce':
case 'make_sticky':
case 'make_global':
case 'make_normal':
$topic_ids = (!$quickmod) ? request_var('topic_id_list', array(0)) : array(request_var('t', 0));
if (!sizeof($topic_ids))
{
trigger_error('NO_TOPIC_SELECTED');
}
change_topic_type($mode, $topic_ids);
break;
change_topic_type($action, $topic_ids);
break;
case 'move':
$user->add_lang('viewtopic');
$topic_ids = (!$quickmod) ? request_var('topic_id_list', array(0)) : array(request_var('t', 0));
if (!sizeof($topic_ids))
{
trigger_error('NO_TOPIC_SELECTED');
}
mcp_move_topic($topic_ids);
break;
break;
case 'fork':
$user->add_lang('viewtopic');
$topic_ids = (!$quickmod) ? request_var('topic_id_list', array(0)) : array(request_var('t', 0));
if (!sizeof($topic_ids))
{
trigger_error('NO_TOPIC_SELECTED');
}
mcp_fork_topic($topic_ids);
break;
break;
case 'delete_topic':
$user->add_lang('viewtopic');
$topic_ids = (!$quickmod) ? request_var('topic_id_list', array(0)) : array(request_var('t', 0));
if (!sizeof($topic_ids))
{
trigger_error('NO_TOPIC_SELECTED');
}
mcp_delete_topic($topic_ids);
break;
break;
case 'delete_post':
$user->add_lang('posting');
@ -131,19 +122,22 @@ class mcp_main
}
mcp_delete_post($post_ids);
break;
break;
}
switch ($mode)
{
case 'front':
include($phpbb_root_path . 'includes/mcp/mcp_front.' . $phpEx);
mcp_front_view($id, $mode, $action, $url);
mcp_front_view($id, $mode, $action);
$this->tpl_name = 'mcp_front';
break;
break;
case 'forum_view':
include($phpbb_root_path . 'includes/mcp/mcp_forum.' . $phpEx);
$user->add_lang('viewforum');
$forum_id = request_var('f', 0);
@ -152,32 +146,32 @@ class mcp_main
if (!sizeof($forum_info))
{
$this->mcp_main('mcp', 'front', $url);
exit;
$this->main('main', 'front');
return;
}
$forum_info = $forum_info[$forum_id];
mcp_forum_view($id, $mode, $action, $url, $forum_info);
mcp_forum_view($id, $mode, $action, $forum_info);
$this->tpl_name = 'mcp_forum';
break;
break;
case 'topic_view':
include($phpbb_root_path . 'includes/mcp/mcp_topic.' . $phpEx);
mcp_topic_view($id, $mode, $action, $url);
mcp_topic_view($id, $mode, $action);
$this->tpl_name = 'mcp_topic';
break;
break;
case 'post_details':
include($phpbb_root_path . 'includes/mcp/mcp_post.' . $phpEx);
mcp_post_details($id, $mode, $action, $url);
mcp_post_details($id, $mode, $action);
$this->tpl_name = 'mcp_post';
break;
break;
default:
trigger_error("Unknown mode: $mode");
@ -188,11 +182,11 @@ class mcp_main
/**
* Lock/Unlock Topic/Post
*/
function lock_unlock($mode, $ids)
function lock_unlock($action, $ids)
{
global $auth, $user, $db, $SID, $phpEx, $phpbb_root_path;
if ($mode == 'lock' || $mode == 'unlock')
if ($action == 'lock' || $action == 'unlock')
{
$table = TOPICS_TABLE;
$sql_id = 'topic_id';
@ -206,17 +200,17 @@ function lock_unlock($mode, $ids)
$set_id = 'post_edit_locked';
$l_prefix = 'POST';
}
if (!($forum_id = check_ids($ids, $table, $sql_id, 'm_lock')))
{
return;
}
$redirect = request_var('redirect', $user->data['session_page']);
$s_hidden_fields = build_hidden_fields(array(
$sql_id . '_list' => $ids,
'mode' => $mode,
'action' => $action,
'redirect' => $redirect)
);
$success_msg = '';
@ -224,22 +218,22 @@ function lock_unlock($mode, $ids)
if (confirm_box(true))
{
$sql = "UPDATE $table
SET $set_id = " . (($mode == 'lock' || $mode == 'lock_post') ? ITEM_LOCKED : ITEM_UNLOCKED) . "
SET $set_id = " . (($action == 'lock' || $action == 'lock_post') ? ITEM_LOCKED : ITEM_UNLOCKED) . "
WHERE $sql_id IN (" . implode(', ', $ids) . ")";
$db->sql_query($sql);
$data = ($mode == 'lock' || $mode == 'unlock') ? get_topic_data($ids) : get_post_data($ids);
$data = ($action == 'lock' || $action == 'unlock') ? get_topic_data($ids) : get_post_data($ids);
foreach ($data as $id => $row)
{
add_log('mod', $forum_id, $row['topic_id'], 'LOG_' . strtoupper($mode), $row['topic_title']);
add_log('mod', $forum_id, $row['topic_id'], 'LOG_' . strtoupper($action), $row['topic_title']);
}
$success_msg = $l_prefix . ((sizeof($ids) == 1) ? '' : 'S') . '_' . (($mode == 'lock' || $mode == 'lock_post') ? 'LOCKED' : 'UNLOCKED') . '_SUCCESS';
$success_msg = $l_prefix . ((sizeof($ids) == 1) ? '' : 'S') . '_' . (($action == 'lock' || $action == 'lock_post') ? 'LOCKED' : 'UNLOCKED') . '_SUCCESS';
}
else
{
confirm_box(false, strtoupper($mode) . '_' . $l_prefix . ((sizeof($ids) == 1) ? '' : 'S'), $s_hidden_fields);
confirm_box(false, strtoupper($action) . '_' . $l_prefix . ((sizeof($ids) == 1) ? '' : 'S'), $s_hidden_fields);
}
$redirect = request_var('redirect', "index.$phpEx$SID");
@ -263,7 +257,7 @@ function lock_unlock($mode, $ids)
/**
* Change Topic Type
*/
function change_topic_type($mode, $topic_ids)
function change_topic_type($action, $topic_ids)
{
global $auth, $user, $db, $SID, $phpEx, $phpbb_root_path;
@ -272,28 +266,31 @@ function change_topic_type($mode, $topic_ids)
return;
}
switch ($mode)
switch ($action)
{
case 'make_announce':
$new_topic_type = POST_ANNOUNCE;
$check_acl = 'f_announce';
$l_new_type = (sizeof($topic_ids) == 1) ? 'MCP_MAKE_ANNOUNCEMENT' : 'MCP_MAKE_ANNOUNCEMENTS';
break;
break;
case 'make_global':
$new_topic_type = POST_GLOBAL;
$check_acl = 'f_announce';
$l_new_type = (sizeof($topic_ids) == 1) ? 'MCP_MAKE_GLOBAL' : 'MCP_MAKE_GLOBALS';
break;
break;
case 'make_sticky':
$new_topic_type = POST_STICKY;
$check_acl = 'f_sticky';
$l_new_type = (sizeof($topic_ids) == 1) ? 'MCP_MAKE_STICKY' : 'MCP_MAKE_STICKIES';
break;
break;
default:
$new_topic_type = POST_NORMAL;
$check_acl = '';
$l_new_type = (sizeof($topic_ids) == 1) ? 'MCP_MAKE_NORMAL' : 'MCP_MAKE_NORMALS';
break;
break;
}
$redirect = request_var('redirect', $user->data['session_page']);
@ -301,7 +298,7 @@ function change_topic_type($mode, $topic_ids)
$s_hidden_fields = build_hidden_fields(array(
'topic_id_list' => $topic_ids,
'f' => $forum_id,
'mode' => $mode,
'action' => $action,
'redirect' => $redirect)
);
$success_msg = '';
@ -378,7 +375,7 @@ function mcp_move_topic($topic_ids)
{
return;
}
$to_forum_id = request_var('to_forum_id', 0);
$redirect = request_var('redirect', $user->data['session_page']);
$additional_msg = $success_msg = '';
@ -386,7 +383,7 @@ function mcp_move_topic($topic_ids)
$s_hidden_fields = build_hidden_fields(array(
'topic_id_list' => $topic_ids,
'f' => $forum_id,
'mode' => 'move',
'action' => 'move',
'redirect' => $redirect)
);
@ -401,7 +398,7 @@ function mcp_move_topic($topic_ids)
else
{
$forum_data = $forum_data[$to_forum_id];
if ($forum_data['forum_type'] != FORUM_POST)
{
$additional_msg = $user->lang['FORUM_NOT_POSTABLE'];
@ -421,7 +418,7 @@ function mcp_move_topic($topic_ids)
{
unset($_POST['confirm']);
}
if (confirm_box(true))
{
$topic_data = get_topic_data($topic_ids);
@ -473,7 +470,7 @@ function mcp_move_topic($topic_ids)
);
$db->sql_query('INSERT INTO ' . TOPICS_TABLE . $db->sql_build_array('INSERT', $shadow));
// $next_id = $db->sql_nextid();
// Mark Shadow topic read
// markread('topic', $row['forum_id'], $next_id);
@ -511,7 +508,7 @@ function mcp_move_topic($topic_ids)
else
{
meta_refresh(3, $redirect);
$message = $user->lang[$success_msg];
$message .= '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>');
$message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], "<a href=\"{$phpbb_root_path}viewforum.$phpEx$SID&amp;f=$forum_id\">", '</a>');
@ -538,7 +535,7 @@ function mcp_delete_topic($topic_ids)
$s_hidden_fields = build_hidden_fields(array(
'topic_id_list' => $topic_ids,
'f' => $forum_id,
'mode' => 'delete_topic',
'action' => 'delete_topic',
'redirect' => $redirect)
);
$success_msg = '';
@ -598,7 +595,7 @@ function mcp_delete_post($post_ids)
$s_hidden_fields = build_hidden_fields(array(
'post_id_list' => $post_ids,
'f' => $forum_id,
'mode' => 'delete_post',
'action' => 'delete_post',
'redirect' => $redirect)
);
$success_msg = '';
@ -623,7 +620,7 @@ function mcp_delete_post($post_ids)
$db->sql_freeresult($result);
$post_data = get_post_data($post_ids);
foreach ($post_data as $id => $row)
{
add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_DELETE_POST', $row['post_subject']);
@ -631,7 +628,7 @@ function mcp_delete_post($post_ids)
// Now delete the posts, topics and forums are automatically resync'ed
delete_posts('post_id', $post_ids);
$sql = 'SELECT COUNT(topic_id) AS topics_left
FROM ' . TOPICS_TABLE . '
WHERE topic_id IN (' . implode(', ', $topic_id_list) . ')';
@ -711,7 +708,7 @@ function mcp_fork_topic($topic_ids)
{
return;
}
$to_forum_id = request_var('to_forum_id', 0);
$redirect = request_var('redirect', $user->data['session_page']);
$additional_msg = $success_msg = '';
@ -719,7 +716,7 @@ function mcp_fork_topic($topic_ids)
$s_hidden_fields = build_hidden_fields(array(
'topic_id_list' => $topic_ids,
'f' => $forum_id,
'mode' => 'fork',
'action' => 'fork',
'redirect' => $redirect)
);
@ -738,7 +735,7 @@ function mcp_fork_topic($topic_ids)
else
{
$forum_data = $forum_data[$to_forum_id];
if ($forum_data['forum_type'] != FORUM_POST)
{
$additional_msg = $user->lang['FORUM_NOT_POSTABLE'];
@ -754,11 +751,11 @@ function mcp_fork_topic($topic_ids)
{
unset($_POST['confirm']);
}
if (confirm_box(true))
{
$topic_data = get_topic_data($topic_ids);
$total_posts = 0;
$new_topic_id_list = array();
foreach ($topic_data as $topic_id => $topic_row)
@ -801,8 +798,8 @@ function mcp_fork_topic($topic_ids)
{
$poll_rows = array();
$sql = 'SELECT *
FROM ' . POLL_OPTIONS_TABLE . "
$sql = 'SELECT *
FROM ' . POLL_OPTIONS_TABLE . "
WHERE topic_id = $topic_id";
$result = $db->sql_query($sql);
@ -819,7 +816,7 @@ function mcp_fork_topic($topic_ids)
WHERE topic_id = $topic_id
ORDER BY post_id ASC";
$result = $db->sql_query($sql);
$post_rows = array();
while ($row = $db->sql_fetchrow($result))
{
@ -875,7 +872,7 @@ function mcp_fork_topic($topic_ids)
AND topic_id = $topic_id
AND in_message = 0";
$result = $db->sql_query($sql);
while ($attach_row = $db->sql_fetchrow($result))
{
$sql_ary = array(
@ -893,7 +890,7 @@ function mcp_fork_topic($topic_ids)
'filetime' => (int) $attach_row['filetime'],
'thumbnail' => (int) $attach_row['thumbnail']
);
$db->sql_query('INSERT INTO ' . ATTACHMENTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
}
$db->sql_freeresult($result);
@ -962,10 +959,10 @@ class mcp_main_info
'title' => 'MCP_MAIN',
'version' => '1.0.0',
'modes' => array(
'front' => array('title' => 'MCP_MAIN_FRONT', 'auth' => ''),
'forum_view' => array('title' => 'MCP_MAIN_FORUM_VIEW', 'auth' => 'acl_m_,$id'),
'topic_view' => array('title' => 'MCP_MAIN_TOPIC_VIEW', 'auth' => 'acl_m_,$id'),
'front' => array('title' => 'MCP_MAIN_FRONT', 'auth' => ''),
'post_details' => array('title' => 'MCP_MAIN_POST_DETAILS', 'auth' => 'acl_m_,$id'),
'topic_view' => array('title' => 'MCP_MAIN_TOPIC_VIEW', 'auth' => 'acl_m_,$id'),
),
);
}

View File

@ -11,7 +11,7 @@
/**
* Handling actions in post details screen
*/
function mcp_post_details($id, $mode, $action, $url)
function mcp_post_details($id, $mode, $action)
{
global $SID, $phpEx, $phpbb_root_path, $config;
global $template, $db, $user, $auth;
@ -30,135 +30,55 @@ function mcp_post_details($id, $mode, $action, $url)
}
$post_info = $post_info[$post_id];
$url = "{$phpbb_root_path}mcp.$phpEx$SID" . extra_url();
switch ($action)
{
case 'chgposter_search':
case 'chgposter':
$username = request_var('username', '');
if ($username)
$sql = 'SELECT user_id
FROM ' . USERS_TABLE . '
WHERE username = \'' . $db->sql_escape($username) . '\'';
$result = $db->sql_query($sql);
if (!($row = $db->sql_fetchrow($result)))
{
$users_ary = array();
if (strpos($username, '*') === false)
{
$username = "*$username*";
}
$username = str_replace('*', '%', str_replace('%', '\%', $username));
$sql = 'SELECT user_id, username
FROM ' . USERS_TABLE . "
WHERE username LIKE '" . $db->sql_escape($username) . "'
AND user_type NOT IN (" . USER_INACTIVE . ', ' . USER_IGNORE . ')
AND user_id <> ' . $post_info['user_id'];
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$users_ary[strtolower($row['username'])] = $row;
}
$user_select = '';
ksort($users_ary);
foreach ($users_ary as $row)
{
$user_select .= '<option value="' . $row['user_id'] . '">' . $row['username'] . "</option>\n";
}
trigger_error($user->lang['NO_USER']);
}
$new_user = $row['user_id'];
if (!$user_select)
if ($auth->acl_get('m_', $post_info['forum_id']))
{
$template->assign_var('MESSAGE', $user->lang['NO_MATCHES_FOUND']);
change_poster($post_info, $new_user);
}
break;
$template->assign_vars(array(
'S_USER_SELECT' => $user_select,
'SEARCH_USERNAME' => request_var('username', ''))
);
break;
case 'chgposter':
case 'chgposter_ip':
$new_user = request_var('u', 0);
if ($new_user && $auth->acl_get('m_', $post_info['forum_id']) && $new_user != $post_info['user_id'])
$sql = 'SELECT user_id
FROM ' . USERS_TABLE . '
WHERE user_id = ' . $new_user;
$result = $db->sql_query($sql);
if (!($row = $db->sql_fetchrow($result)))
{
$sql = 'UPDATE ' . POSTS_TABLE . "
SET poster_id = $new_user
WHERE post_id = $post_id";
$db->sql_query($sql);
if ($post_info['topic_last_post_id'] == $post_info['post_id'] || $post_info['forum_last_post_id'] == $post_info['post_id'])
{
sync('topic', 'topic_id', $post_info['topic_id'], false, false);
sync('forum', 'forum_id', $post_info['forum_id'], false, false);
}
// Renew post info
$post_info = get_post_data(array($post_id));
if (!sizeof($post_info))
{
trigger_error($user->lang['POST_NOT_EXIST']);
}
$post_info = $post_info[$post_id];
}
break;
case 'del_marked':
case 'del_all':
case 'add_feedback':
$deletemark = ($action == 'del_marked') ? true : false;
$deleteall = ($action == 'del_all') ? true : false;
$marked = request_var('marknote', 0);
$usernote = request_var('usernote', '');
if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs'))
{
$where_sql = '';
if ($deletemark && $marked)
{
$sql_in = array();
foreach ($marked as $mark)
{
$sql_in[] = $mark;
}
$where_sql = ' AND log_id IN (' . implode(', ', $sql_in) . ')';
unset($sql_in);
}
$sql = 'DELETE FROM ' . LOG_TABLE . '
WHERE log_type = ' . LOG_USERS . "
$where_sql";
$db->sql_query($sql);
add_log('admin', 'LOG_USERS_CLEAR');
$msg = ($deletemark) ? 'MARKED_DELETED' : 'ALL_DELETED';
$redirect = "$url&amp;i=$id&amp;mode=post_details";
meta_refresh(2, $redirect);
trigger_error($user->lang[$msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
trigger_error($user->lang['NO_USER']);
}
if ($usernote && $action == 'add_feedback')
if ($auth->acl_get('m_', $post_info['forum_id']))
{
add_log('admin', 'LOG_USER_FEEDBACK', $post_info['username']);
add_log('user', $post_info['user_id'], 'LOG_USER_GENERAL', $usernote);
$redirect = "$url&amp;i=$id&amp;mode=post_details";
meta_refresh(2, $redirect);
trigger_error($user->lang['USER_FEEDBACK_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
change_poster($post_info, $new_user);
}
break;
default:
break;
}
// Set some vars
$users_ary = array();
$post_id = $post_info['post_id'];
$poster = ($post_info['user_colour']) ? '<span style="color:#' . $post_info['user_colour'] . '">' . $post_info['username'] . '</span>' : $post_info['username'];
// Process message, leave it uncensored
@ -184,17 +104,17 @@ function mcp_post_details($id, $mode, $action, $url)
'S_POST_REPORTED' => $post_info['post_reported'],
'S_POST_UNAPPROVED' => !$post_info['post_approved'],
'S_POST_LOCKED' => $post_info['post_edit_locked'],
'S_USER_WARNINGS' => ($post_info['user_warnings']) ? true : false,
'S_SHOW_USER_NOTES' => true,
'S_USER_NOTES' => $auth->acl_gets('m_', 'a_') ? true : false,
'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false,
'U_VIEW_PROFILE' => "memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u=" . $post_info['user_id'],
// 'U_MCP_USERNOTES' => "mcp.$phpEx$SID&amp;i=notes&amp;mode=user_notes&amp;u=" . $post_info['user_id'],
// 'U_MCP_WARNINGS' => "mcp.$phpEx$SID&amp;i=warnings&amp;mode=view_user&amp;u=" . $post_info['user_id'],
'U_FIND_MEMBER' => "{$phpbb_root_path}memberlist.$phpEx$SID&amp;mode=searchuser&amp;form=mcp_chgposter&amp;field=username",
'U_VIEW_PROFILE' => "{$phpbb_root_path}memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u=" . $post_info['user_id'],
'U_MCP_USER_NOTES' => $auth->acl_gets('m_', 'a_') ? "{$phpbb_root_path}mcp.$phpEx$SID&amp;i=notes&amp;mode=user_notes&amp;u=" . $post_info['user_id'] : '',
'U_MCP_WARN_USER' => "{$phpbb_root_path}mcp.$phpEx$SID&amp;i=warn&amp;mode=warn_user&amp;u=" . $post_info['user_id'],
'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? "{$phpbb_root_path}posting.$phpEx$SID&amp;mode=edit&amp;f={$post_info['forum_id']}&amp;p={$post_info['post_id']}" : '',
'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], "<a href=\"viewtopic.$phpEx$SID&amp;p=$post_id#$post_id\">", '</a>'),
'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], "<a href=\"viewforum.$phpEx$SID&amp;f={$post_info['forum_id']}&amp;start={$start}\">", '</a>'),
'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], "<a href=\"{$phpbb_root_path}viewtopic.$phpEx$SID&amp;p=$post_id#$post_id\">", '</a>'),
'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], "<a href=\"{$phpbb_root_path}viewforum.$phpEx$SID&amp;f={$post_info['forum_id']}&amp;start={$start}\">", '</a>'),
'REPORTED_IMG' => $user->img('icon_reported', $user->lang['POST_REPORTED']),
'UNAPPROVED_IMG' => $user->img('icon_unapproved', $user->lang['POST_UNAPPROVED']),
'EDIT_IMG' => $user->img('btn_edit', $user->lang['EDIT_POST']),
@ -231,7 +151,7 @@ function mcp_post_details($id, $mode, $action, $url)
// Get Reports
if ($auth->acl_get('m_', $post_info['forum_id']))
{
$sql = 'SELECT r.*, re.*, u.user_id, u.username
$sql = 'SELECT r.*, re.*, u.user_id, u.username
FROM ' . REPORTS_TABLE . ' r, ' . USERS_TABLE . ' u, ' . REASONS_TABLE . " re
WHERE r.post_id = $post_id
AND r.reason_id = re.reason_id
@ -250,7 +170,7 @@ function mcp_post_details($id, $mode, $action, $url)
'REASON_TITLE' => $user->lang['report_reasons']['TITLE'][strtoupper($row['reason_name'])],
'REASON_DESC' => $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_name'])],
'REPORTER' => ($row['user_id'] != ANONYMOUS) ? $row['username'] : $user->lang['GUEST'],
'U_REPORTER' => ($row['user_id'] != ANONYMOUS) ? "memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u={$row['user_id']}" : '',
'U_REPORTER' => ($row['user_id'] != ANONYMOUS) ? "{$phpbb_root_path}memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u={$row['user_id']}" : '',
'USER_NOTIFY' => ($row['user_notify']) ? true : false,
'REPORT_TIME' => $user->format_date($row['report_time']),
'REPORT_TEXT' => str_replace("\n", '<br />', trim($row['report_text'])))
@ -260,7 +180,7 @@ function mcp_post_details($id, $mode, $action, $url)
}
$db->sql_freeresult($result);
}
// Get IP
if ($auth->acl_get('m_ip', $post_info['forum_id']))
{
@ -294,11 +214,11 @@ function mcp_post_details($id, $mode, $action, $url)
$template->assign_block_vars('userrow', array(
'USERNAME' => ($row['user_id'] == ANONYMOUS) ? $user->lang['GUEST'] : $row['username'],
'NUM_POSTS' => $row['postings'],
'NUM_POSTS' => $row['postings'],
'L_POST_S' => ($row['postings'] == 1) ? $user->lang['POST'] : $user->lang['POSTS'],
'U_PROFILE' => ($row['user_id'] == ANONYMOUS) ? '' : "memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u=" . $row['user_id'],
'U_SEARCHPOSTS' => "search.$phpEx$SID&amp;search_author=" . urlencode($row['username']) . "&amp;showresults=topics")
'U_PROFILE' => ($row['user_id'] == ANONYMOUS) ? '' : "{$phpbb_root_path}memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u=" . $row['user_id'],
'U_SEARCHPOSTS' => "{$phpbb_root_path}search.$phpEx$SID&amp;author=" . urlencode($row['username']) . "&amp;sr=topics")
);
}
$db->sql_freeresult($result);
@ -318,30 +238,58 @@ function mcp_post_details($id, $mode, $action, $url)
$template->assign_block_vars('iprow', array(
'IP' => $row['poster_ip'],
'HOSTNAME' => $hostname,
'NUM_POSTS' => $row['postings'],
'NUM_POSTS' => $row['postings'],
'L_POST_S' => ($row['postings'] == 1) ? $user->lang['POST'] : $user->lang['POSTS'],
'U_LOOKUP_IP' => ($rdns_ip_num == $row['poster_ip'] || $rdns_ip_num == 'all') ? '' : "$url&amp;i=$id&amp;mode=post_details&amp;rdns={$row['poster_ip']}#ip",
'U_WHOIS' => "mcp.$phpEx$SID&amp;i=$id&amp;mode=whois&amp;ip={$row['poster_ip']}")
'U_WHOIS' => "{$phpbb_root_path}mcp.$phpEx$SID&amp;i=$id&amp;mode=whois&amp;ip={$row['poster_ip']}")
);
}
$db->sql_freeresult($result);
// If we were not searching for a specific username fill
// the user_select box with users who have posted under
// the same IP
if ($action != 'chgposter_search')
$user_select = '';
ksort($users_ary);
foreach ($users_ary as $row)
{
$user_select = '';
ksort($users_ary);
foreach ($users_ary as $row)
{
$user_select .= '<option value="' . $row['user_id'] . '">' . $row['username'] . "</option>\n";
}
$template->assign_var('S_USER_SELECT', $user_select);
$user_select .= '<option value="' . $row['user_id'] . '">' . $row['username'] . "</option>\n";
}
$template->assign_var('S_USER_SELECT', $user_select);
}
}
/**
* Changes a post's poster_id
*/
function change_poster(&$post_info, $new_user)
{
global $auth, $db;
if ($new_user && $new_user != $post_info['user_id'])
{
$post_id = $post_info['post_id'];
$sql = 'UPDATE ' . POSTS_TABLE . "
SET poster_id = $new_user
WHERE post_id = " . $post_id;
$db->sql_query($sql);
if ($post_info['topic_last_post_id'] == $post_id || $post_info['forum_last_post_id'] == $post_id)
{
sync('topic', 'topic_id', $post_info['topic_id'], false, false);
sync('forum', 'forum_id', $post_info['forum_id'], false, false);
}
// Renew post info
$post_info = get_post_data(array($post_id));
if (!sizeof($post_info))
{
trigger_error($user->lang['POST_NOT_EXIST']);
}
$post_info = $post_info[$post_id];
}
}
?>

View File

@ -11,11 +11,13 @@
/**
* View topic in MCP
*/
function mcp_topic_view($id, $mode, $action, $url)
function mcp_topic_view($id, $mode, $action)
{
global $SID, $phpEx, $phpbb_root_path, $config;
global $template, $db, $user, $auth;
$url = "{$phpbb_root_path}mcp.$phpEx$SID" . extra_url();
$user->add_lang('viewtopic');
$topic_id = request_var('t', 0);
@ -49,8 +51,6 @@ function mcp_topic_view($id, $mode, $action, $url)
merge_posts($topic_id, $to_topic_id);
$action = 'merge';
}
$topics_per_page = ($topic_info['forum_topics_per_page']) ? $topic_info['forum_topics_per_page'] : $config['topics_per_page'];
if ($action == 'split' && !$subject)
{
@ -58,11 +58,10 @@ function mcp_topic_view($id, $mode, $action, $url)
}
// Jumpbox, sort selects and that kind of things
make_jumpbox($url . '&amp;mode=forum_view', $topic_info['forum_id'], false, 'm_');
make_jumpbox($url . "&amp;i=$id&amp;mode=forum_view", $topic_info['forum_id'], false, 'm_');
$where_sql = ($action == 'reports') ? 'WHERE post_reported = 1 AND ' : 'WHERE';
mcp_sorting('viewtopic', $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $topic_info['forum_id'], $topic_id, $where_sql);
$forum_topics = ($total == -1) ? $topic_info['forum_topics'] : $total;
$limit_time_sql = ($sort_days) ? 'AND t.topic_last_post_time >= ' . (time() - ($sort_days * 86400)) : '';
if ($total == -1)
@ -70,6 +69,10 @@ function mcp_topic_view($id, $mode, $action, $url)
$total = $topic_info['topic_replies'] + 1;
}
$posts_per_page = max(0, request_var('posts_per_page', intval($config['posts_per_page'])));
if ($posts_per_page == 0)
{
$posts_per_page = $total;
}
$sql = 'SELECT u.username, u.user_colour, p.*
FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
@ -137,9 +140,9 @@ function mcp_topic_view($id, $mode, $action, $url)
'S_CHECKBOX' => $s_checkbox,
'S_POST_REPORTED' => ($row['post_reported']) ? true : false,
'S_POST_UNAPPROVED' => ($row['post_approved']) ? false : true,
'U_POST_DETAILS' => "$url&amp;p={$row['post_id']}&amp;mode=post_details",
'U_MCP_APPROVE' => "mcp.$phpEx$SID&amp;i=queue&amp;mode=approve&amp;post_id_list[]=" . $row['post_id'])
'U_POST_DETAILS' => "$url&amp;i=$id&amp;p={$row['post_id']}&amp;mode=post_details",
'U_MCP_APPROVE' => "{$phpbb_root_path}mcp.$phpEx$SID&amp;i=queue&amp;mode=approve&amp;post_id_list[]=" . $row['post_id'])
);
unset($rowset[$i]);
@ -157,7 +160,7 @@ function mcp_topic_view($id, $mode, $action, $url)
if ($to_topic_id)
{
$to_topic_info = get_topic_data(array($to_topic_id), 'm_merge');
if (!sizeof($to_topic_info))
{
$to_topic_id = 0;
@ -166,7 +169,6 @@ function mcp_topic_view($id, $mode, $action, $url)
{
$to_topic_info = $to_topic_info[$to_topic_id];
}
if (!$to_topic_info['enable_icons'])
{
@ -177,10 +179,10 @@ function mcp_topic_view($id, $mode, $action, $url)
$template->assign_vars(array(
'TOPIC_TITLE' => $topic_info['topic_title'],
'U_VIEWTOPIC' => "viewtopic.$phpEx$SID&amp;f=" . $topic_info['forum_id'] . '&amp;t=' . $topic_info['topic_id'],
'U_VIEWTOPIC' => "{$phpbb_root_path}viewtopic.$phpEx$SID&amp;f=" . $topic_info['forum_id'] . '&amp;t=' . $topic_info['topic_id'],
'TO_TOPIC_ID' => $to_topic_id,
'TO_TOPIC_INFO' => ($to_topic_id) ? sprintf($user->lang['YOU_SELECTED_TOPIC'], $to_topic_id, '<a href="viewtopic.' . $phpEx . $SID . '&amp;f=' . $to_topic_info['forum_id'] . '&amp;t=' . $to_topic_id . '" target="_new">' . $to_topic_info['topic_title'] . '</a>') : '',
'TO_TOPIC_INFO' => ($to_topic_id) ? sprintf($user->lang['YOU_SELECTED_TOPIC'], $to_topic_id, '<a href="' . $phpbb_root_path . "viewtopic.$phpEx$SID&amp;f=" . $to_topic_info['forum_id'] . '&amp;t=' . $to_topic_id . '" target="_new">' . $to_topic_info['topic_title'] . '</a>') : '',
'SPLIT_SUBJECT' => $subject,
'POSTS_PER_PAGE' => $posts_per_page,
@ -189,7 +191,7 @@ function mcp_topic_view($id, $mode, $action, $url)
'REPORTED_IMG' => $user->img('icon_reported', 'POST_REPORTED', false, true),
'UNAPPROVED_IMG' => $user->img('icon_unapproved', 'POST_UNAPPROVED', false, true),
'S_MCP_ACTION' => "$url&amp;mode=$mode&amp;action=$action&amp;start=$start",
'S_MCP_ACTION' => "$url&amp;i=$id&amp;mode=$mode&amp;action=$action&amp;start=$start",
'S_FORUM_SELECT' => '<select name="to_forum_id">' . (($to_forum_id) ? make_forum_select($to_forum_id) : make_forum_select($topic_info['forum_id'])) . '</select>',
'S_CAN_SPLIT' => ($auth->acl_get('m_split', $topic_info['forum_id']) && $action != 'merge') ? true : false,
'S_CAN_MERGE' => ($auth->acl_get('m_merge', $topic_info['forum_id']) && $action != 'split') ? true : false,
@ -201,11 +203,13 @@ function mcp_topic_view($id, $mode, $action, $url)
'S_SHOW_TOPIC_ICONS'=> $s_topic_icons,
'S_TOPIC_ICON' => $icon_id,
'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], "<a href=\"viewtopic.$phpEx$SID&amp;f={$topic_info['forum_id']}&amp;t={$topic_info['topic_id']}&amp;start=$start\">", '</a>'),
'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], "<a href=\"viewforum.$phpEx$SID&amp;f={$topic_info['forum_id']}&amp;start=$start\">", '</a>'),
'U_SELECT_TOPIC' => "$url&amp;i=$id&amp;mode=forum_view&amp;action=merge_select",
'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], "<a href=\"{$phpbb_root_path}viewtopic.$phpEx$SID&amp;f={$topic_info['forum_id']}&amp;t={$topic_info['topic_id']}&amp;start=$start\">", '</a>'),
'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], "<a href=\"{$phpbb_root_path}viewforum.$phpEx$SID&amp;f={$topic_info['forum_id']}&amp;start=$start\">", '</a>'),
'PAGE_NUMBER' => on_page($total, $posts_per_page, $start),
'PAGINATION' => (!$posts_per_page) ? '' : generate_pagination("mcp.$phpEx$SID&amp;t=" . $topic_info['topic_id'] . "&amp;mode=$mode&amp;action=$action&amp;to_topic_id=$to_topic_id&amp;posts_per_page=$posts_per_page&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir", $total, $posts_per_page, $start),
'PAGINATION' => (!$posts_per_page) ? '' : generate_pagination("{$phpbb_root_path}mcp.$phpEx$SID&amp;i=$id&amp;t=" . $topic_info['topic_id'] . "&amp;mode=$mode&amp;action=$action&amp;to_topic_id=$to_topic_id&amp;posts_per_page=$posts_per_page&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir", $total, $posts_per_page, $start),
'TOTAL' => $total)
);
}
@ -213,18 +217,18 @@ function mcp_topic_view($id, $mode, $action, $url)
/**
* Split topic
*/
function split_topic($mode, $topic_id, $to_forum_id, $subject)
function split_topic($action, $topic_id, $to_forum_id, $subject)
{
global $db, $template, $user, $phpEx, $SID, $phpbb_root_path, $auth;
$post_id_list = request_var('post_id_list', array(0));
$start = request_var('start', 0);
if (!sizeof($post_id_list))
{
trigger_error('NO_POST_SELECTED');
}
if (!($forum_id = check_ids($post_id_list, POSTS_TABLE, 'post_id', 'm_split')))
{
return;
@ -274,11 +278,12 @@ function split_topic($mode, $topic_id, $to_forum_id, $subject)
$redirect = request_var('redirect', $user->data['session_page']);
$s_hidden_fields = build_hidden_fields(array(
'i' => 'main',
'post_id_list' => $post_id_list,
'f' => $forum_id,
'mode' => 'topic_view',
'start' => $start,
'action' => $mode,
'action' => $action,
't' => $topic_id,
'redirect' => $redirect,
'subject' => $subject,
@ -289,7 +294,7 @@ function split_topic($mode, $topic_id, $to_forum_id, $subject)
if (confirm_box(true))
{
if ($mode == 'split_beyond')
if ($action == 'split_beyond')
{
mcp_sorting('viewtopic', $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id, $topic_id);
$limit_time_sql = ($sort_days) ? 'AND t.topic_last_post_time >= ' . (time() - ($sort_days * 86400)) : '';
@ -349,7 +354,7 @@ function split_topic($mode, $topic_id, $to_forum_id, $subject)
'icon_id' => $icon_id,
'topic_approved'=> 1
);
$sql = 'INSERT INTO ' . TOPICS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
$db->sql_query($sql);
@ -357,7 +362,7 @@ function split_topic($mode, $topic_id, $to_forum_id, $subject)
move_posts($post_id_list, $to_topic_id);
// Change topic title of first post
$sql = 'UPDATE ' . POSTS_TABLE . "
$sql = 'UPDATE ' . POSTS_TABLE . "
SET post_subject = '" . $db->sql_escape($subject) . "'
WHERE post_id = {$post_id_list[0]}";
$db->sql_query($sql);
@ -365,11 +370,11 @@ function split_topic($mode, $topic_id, $to_forum_id, $subject)
$success_msg = 'TOPIC_SPLIT_SUCCESS';
// Link back to both topics
$return_link = sprintf($user->lang['RETURN_TOPIC'], '<a href="viewtopic.' . $phpEx . $SID . '&amp;f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id'] . '">', '</a>') . '<br /><br />' . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="viewtopic.' . $phpEx . $SID . '&amp;f=' . $to_forum_id . '&amp;t=' . $to_topic_id . '">', '</a>');
$return_link = sprintf($user->lang['RETURN_TOPIC'], "<a href=\"{$phpbb_root_path}viewtopic.$phpEx$SID&amp;f=" . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id'] . '">', '</a>') . '<br /><br />' . sprintf($user->lang['RETURN_NEW_TOPIC'], "<a href=\"{$phpbb_root_path}viewtopic.$phpEx$SID&amp;f=" . $to_forum_id . '&amp;t=' . $to_topic_id . '">', '</a>');
}
else
{
confirm_box(false, ($mode == 'split_all') ? 'SPLIT_TOPIC_ALL' : 'SPLIT_TOPIC_BEYOND', $s_hidden_fields);
confirm_box(false, ($action == 'split_all') ? 'SPLIT_TOPIC_ALL' : 'SPLIT_TOPIC_BEYOND', $s_hidden_fields);
}
$redirect = request_var('redirect', "index.$phpEx$SID");
@ -415,13 +420,13 @@ function merge_posts($topic_id, $to_topic_id)
$post_id_list = request_var('post_id_list', array(0));
$start = request_var('start', 0);
if (!sizeof($post_id_list))
{
$template->assign_var('MESSAGE', $user->lang['NO_POST_SELECTED']);
return;
}
if (!($forum_id = check_ids($post_id_list, POSTS_TABLE, 'post_id', 'm_merge')))
{
return;
@ -430,6 +435,7 @@ function merge_posts($topic_id, $to_topic_id)
$redirect = request_var('redirect', $user->data['session_page']);
$s_hidden_fields = build_hidden_fields(array(
'i' => 'main',
'post_id_list' => $post_id_list,
'to_topic_id' => $to_topic_id,
'mode' => 'topic_view',
@ -447,7 +453,7 @@ function merge_posts($topic_id, $to_topic_id)
move_posts($post_id_list, $to_topic_id);
add_log('mod', $to_forum_id, $to_topic_id, 'LOG_MERGE', $topic_data['topic_title']);
// Message and return links
$success_msg = 'POSTS_MERGED_SUCCESS';
@ -480,7 +486,7 @@ function merge_posts($topic_id, $to_topic_id)
}
else
{
meta_refresh(3, "viewtopic.$phpEx$SID&amp;f=$to_forum_id&amp;t=$to_topic_id");
meta_refresh(3, "{$phpbb_root_path}viewtopic.$phpEx$SID&amp;f=$to_forum_id&amp;t=$to_topic_id");
trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link);
}
}

View File

@ -441,6 +441,7 @@ $lang = array_merge($lang, array(
'VIEWING_UCP' => 'Viewing user control panel',
'VIEWS' => 'Views',
'VIEW_BOOKMARKS' => 'View bookmarks',
'VIEW_FORUM_LOGS' => 'View Logs',
'VIEW_LATEST_POST' => 'View latest post',
'VIEW_NEWEST_POST' => 'View newest post',
'VIEW_NOTES' => 'View user notes',

View File

@ -18,7 +18,7 @@ if (empty($lang) || !is_array($lang))
$lang = array();
}
// DEVELOPERS PLEASE NOTE
// DEVELOPERS PLEASE NOTE
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
@ -30,10 +30,10 @@ if (empty($lang) || !is_array($lang))
$lang = array_merge($lang, array(
'ACTION' => 'Action',
'ADD_FEEDBACK' => 'Add feedback',
'ADD_FEEDBACK_EXPLAIN' => 'If you would like to add a report on this please fill out the following form. Only use plain text; HTML, BBCode, etc. are not permitted.',
'ADD_WARNING' => 'Add warning',
'ADD_WARNING_EXPLAIN' => 'To send a warning to this user please fill out the following form. Only use plain text; HTML, BBCode, etc. are not permitted.',
'ADD_FEEDBACK' => 'Add feedback',
'ADD_FEEDBACK_EXPLAIN' => 'If you would like to add a report on this please fill out the following form. Only use plain text; HTML, BBCode, etc. are not permitted.',
'ADD_WARNING' => 'Add warning',
'ADD_WARNING_EXPLAIN' => 'To send a warning to this user please fill out the following form. Only use plain text; HTML, BBCode, etc. are not permitted.',
'ALL_ENTRIES' => 'All entries',
'ALREADY_REPORTED' => 'This post has already been reported',
'ALREADY_WARNED' => 'A warning has already been issued for this post',
@ -75,7 +75,7 @@ $lang = array_merge($lang, array(
'FORUM_STYLE' => 'Forum Style',
'GLOBAL_ANNOUNCEMENT' => 'Global Announcement',
'IP_INFO' => 'IP Information',
'LATEST_LOGS' => 'Latest 5 logged actions',
@ -112,6 +112,7 @@ $lang = array_merge($lang, array(
'LOG_USER_LOCK' => '<b>User locked own topic</b><br />&#187; %s',
'LOG_USER_MOVE_POSTS_USER' => '<b>Moved all posts to forum "%s"</b>',
'LOG_USER_REACTIVATE_USER' => '<b>Forced user account re-activation</b>',
'LOGIN_EXPLAIN_MCP' => 'To moderate this forum you must login.',
'LOGVIEW_VIEWTOPIC' => 'View Topic',
'LOGVIEW_VIEWLOGS' => 'View Topic Log',
'LOGVIEW_VIEWFORUM' => 'View Forum',
@ -201,10 +202,10 @@ $lang = array_merge($lang, array(
'POST_APPROVED_SUCCESS' => 'The selected post has been approved',
'POST_DELETED_SUCCESS' => 'The selected post has been successfully removed from the database',
'POST_DETAILS' => 'Post details',
'POST_LOCKED_SUCCESS' => 'Post locked successsfully',
'POST_LOCKED_SUCCESS' => 'Post locked successfully',
'POST_NOT_EXIST' => 'The post you requested does not exist',
'POST_REPORTED_SUCCESS' => 'This post has been successfully reported',
'POST_UNLOCKED_SUCCESS' => 'Post unlocked successsfully',
'POST_UNLOCKED_SUCCESS' => 'Post unlocked successfully',
'POST_UNRATED_SUCCESS' => 'Post unrated successfully',
'READ_USERNOTES' => 'User notes',
@ -274,7 +275,7 @@ $lang = array_merge($lang, array(
'UNLOCK_TOPIC' => 'Unlock Topic',
'UNLOCK_TOPIC_CONFIRM' => 'Are you sure you want to unlock this topic?',
'UNLOCK_TOPICS' => 'Unlock selected topics',
'UNLOCK_TOPICS_CONFIRM' => 'Are you sure you want to unlock all selected topics?',
'UNLOCK_TOPICS_CONFIRM' => 'Are you sure you want to unlock all selected topics?',
'UNRATE_POST' => 'Unrate post',
'UNRATE_POST_EXPLAIN' => 'Reset post rating',
'USER_CANNOT_POST' => 'You cannot post in this forum',

View File

@ -31,7 +31,7 @@ $module = new p_master();
// Basic parameter data
$id = request_var('i', '');
if (is_array($_REQUEST['mode']))
if (isset($_REQUEST['mode']) && is_array($_REQUEST['mode']))
{
list($mode, ) = each(request_var('mode', array('')));
}
@ -40,12 +40,6 @@ else
$mode = request_var('mode', '');
}
if (isset($_REQUEST['quick']))
{
$mode = request_var('mode2', '');
$action = '';
}
// Make sure we are using the correct module
if ($mode == 'approve' || $mode == 'disapprove')
{
@ -69,161 +63,141 @@ $action_ary = request_var('action', array('' => 0));
if (sizeof($action_ary))
{
list($action, ) = each($action);
list($action, ) = each($action_ary);
}
unset($action_ary);
if ($action == 'merge_select')
{
$mode = 'forum_view';
}
if ($mode == 'topic_logs')
{
$id = 'logs';
$quickmod = false;
}
// Topic view modes
if (in_array($mode, array('split', 'split_all', 'split_beyond', 'merge', 'merge_posts')))
$post_id = request_var('p', 0);
$topic_id = request_var('t', 0);
$forum_id = request_var('f', 0);
$user_id = request_var('u', 0);
$username = request_var('username', '');
if ($post_id)
{
$_REQUEST['action'] = $action = $mode;
$mode = 'topic_view';
$quickmod = false;
// We determine the topic and forum id here, to make sure the moderator really has moderative rights on this post
$sql = 'SELECT topic_id, forum_id
FROM ' . POSTS_TABLE . "
WHERE post_id = $post_id";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$topic_id = (int) $row['topic_id'];
$forum_id = (int) $row['forum_id'];
}
// Forum view modes
if (in_array($mode, array('resync')))
if ($topic_id && !$forum_id)
{
$_REQUEST['action'] = $action = $mode;
$mode = 'forum_view';
$quickmod = false;
$sql = 'SELECT forum_id
FROM ' . TOPICS_TABLE . "
WHERE topic_id = $topic_id";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$forum_id = (int) $row['forum_id'];
}
if (!$quickmod)
// If we do not have a forum id and the user is not a super moderator (global options are set to false, even if the user is able to moderator at least one forum
if (!$forum_id && !$auth->acl_get('m_'))
{
$post_id = request_var('p', 0);
$topic_id = request_var('t', 0);
$forum_id = request_var('f', 0);
$user_id = request_var('u', 0);
$username = request_var('username', '');
$forum_list = get_forum_list('m_');
if ($post_id)
if (!sizeof($forum_list))
{
// We determine the topic and forum id here, to make sure the moderator really has moderative rights on this post
$sql = 'SELECT topic_id, forum_id
FROM ' . POSTS_TABLE . "
WHERE post_id = $post_id";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$topic_id = (int) $row['topic_id'];
$forum_id = (int) $row['forum_id'];
trigger_error('MODULE_NOT_EXIST');
}
if ($topic_id && !$forum_id)
// We do not check all forums, only the first one should be sufficiant.
$forum_id = $forum_list[0];
}
if($forum_id)
{
$module->acl_forup_id = $forum_id;
}
// Instantiate module system and generate list of available modules
$module->list_modules('mcp');
if ($quickmod)
{
$mode = 'quickmod';
switch ($action)
{
$sql = 'SELECT forum_id
FROM ' . TOPICS_TABLE . "
WHERE topic_id = $topic_id";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
case 'lock':
case 'unlock':
case 'lock_post':
case 'unlock_post':
case 'make_sticky':
case 'make_announce':
case 'make_global':
case 'make_normal':
case 'fork':
case 'move':
case 'delete_post':
case 'delete_topic':
$module->load('mcp', 'main', 'quickmod');
exit;
$forum_id = (int) $row['forum_id'];
case 'topic_logs':
$module->set_active('logs', 'topic_logs');
break;
default:
trigger_error("$action not allowed as quickmod");
}
// If we do not have a forum id and the user is not a super moderator (global options are set to false, even if the user is able to moderator at least one forum
if (!$forum_id && !$auth->acl_get('m_'))
{
$forum_list = get_forum_list('m_');
if (!sizeof($forum_list))
{
trigger_error('MODULE_NOT_EXIST');
}
// We do not check all forums, only the first one should be sufficiant.
$forum_id = $forum_list[0];
}
if($forum_id)
{
$module->acl_forup_id = $forum_id;
}
// Instantiate module system and generate list of available modules
$module->list_modules('mcp');
}
else
{
// Select the active module
$module->set_active($id, $mode);
// Hide some of the options if we don't have the relevant information to use them
if (!$post_id)
{
$module->set_display('post_details', false);
$module->set_display('warn_post', false);
}
if (!$topic_id)
{
$module->set_display('topic_view', false);
$module->set_display('topic_logs', false);
}
if (!$forum_id)
{
$module->set_display('forum_view', false);
$module->set_display('forum_logs', false);
}
if (!$user_id && $username == '')
{
$module->set_display('user_notes', false);
$module->set_display('warn_user', false);
}
// Load and execute the relevant module
$module->load_active();
// Assign data to the template engine for the list of modules
$module->assign_tpl_vars("mcp.$phpEx$SID");
// Generate the page
page_header($user->lang['MCP_MAIN']);
$template->set_filenames(array(
'body' => $module->get_tpl_name())
);
page_footer();
}
switch ($mode)
// Hide some of the options if we don't have the relevant information to use them
if (!$post_id)
{
case 'lock':
case 'unlock':
case 'lock_post':
case 'unlock_post':
$module->load('mcp', 'main', $mode);
break;
case 'make_sticky':
case 'make_announce':
case 'make_global':
case 'make_normal':
$module->load('mcp', 'main', $mode);
break;
case 'fork':
case 'move':
$module->load('mcp', 'main', $mode);
break;
case 'delete_post':
case 'delete_topic':
$module->load('mcp', 'main', $mode);
break;
default:
trigger_error("$mode not allowed as quickmod");
$module->set_display('post_details', false);
$module->set_display('warn_post', false);
}
if (!$topic_id)
{
$module->set_display('topic_view', false);
$module->set_display('topic_logs', false);
}
if (!$forum_id)
{
$module->set_display('forum_view', false);
$module->set_display('forum_logs', false);
}
if (!$user_id && $username == '')
{
$module->set_display('user_notes', false);
$module->set_display('warn_user', false);
}
// Load and execute the relevant module
$module->load_active();
// Assign data to the template engine for the list of modules
$module->assign_tpl_vars("mcp.$phpEx$SID");
// Generate the page
page_header($user->lang['MCP_MAIN']);
$template->set_filenames(array(
'body' => $module->get_tpl_name())
);
page_footer();
/**
* Functions used to generate additional URL paramters
@ -573,7 +547,4 @@ function check_ids(&$ids, $table, $sql_id, $acl_list = false)
return $forum_id;
}
// LITTLE HELPER
//
?>

View File

@ -2,6 +2,8 @@
<!-- $Id$ -->
<!-- IF U_VIEW_FORUM_LOGS --><a href="{U_VIEW_FORUM_LOGS}">{L_VIEW_FORUM_LOGS}</a><!-- ENDIF -->
<form method="post" name="mcp" action="{S_MCP_ACTION}"><table class="tablebg" width="100%" cellspacing="1">
<tr>
<td class="cat" colspan="6" align="center"><span class="gensmall">{L_DISPLAY_TOPICS}:</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" name="sort" value="{L_GO}" /></span></td>
@ -43,7 +45,7 @@
<!-- END topicrow -->
<tr>
<td class="cat" colspan="6" align="right">
<select name="mode">
<select name="action">
<!-- IF S_CAN_DELETE --><option value="delete_topic">{L_DELETE}</option><!-- ENDIF -->
<!-- IF S_CAN_MOVE --><option value="move">{L_MOVE}</option><!-- ENDIF -->
<!-- IF S_CAN_FORK --><option value="fork">{L_FORK}</option><!-- ENDIF -->

View File

@ -67,7 +67,7 @@ function marklist(form_name, status)
<tr>
<th>{L_MESSAGE}</th>
</tr>
<tr>
<tr>
<td class="row1" align="center"><br /><span class="gen">{MESSAGE}<br /><br /><!-- BEGIN return_links -->{return_links.MESSAGE_LINK}<br /><br /><!-- END return_links --></span></td>
</tr>
</table>
@ -76,11 +76,11 @@ function marklist(form_name, status)
<!-- ENDIF -->
<!-- IF CONFIRM_MESSAGE -->
<table class="tablebg" width="100%" cellspacing="1"><form name="confirm" method="post" action="{S_CONFIRM_ACTION}"{S_FORM_ENCTYPE}>
<table class="tablebg" width="100%" cellspacing="1"><form name="confirm" method="post" action="{S_CONFIRM_ACTION}">
<tr>
<th><b>{L_PLEASE_CONFIRM}</b></th>
</tr>
<tr>
<tr>
<td class="row1" align="center"><span class="gen"><br />{CONFIRM_MESSAGE}<br /><br />{S_HIDDEN_FIELDS}<input class="btnmain" type="submit" name="confirm" value="{L_YES}" />&nbsp;&nbsp;<input class="btnlite" type="submit" name="cancel" value="{L_NO}" /><br /><br /></span></td>
</tr>
</form></table>

View File

@ -1,6 +1,6 @@
<!-- INCLUDE mcp_header.html -->
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg"><form method="post" name="mcp" action="{U_APPROVE_ACTION}">
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg"><form method="post" name="mcp_approve" action="{U_APPROVE_ACTION}">
<tr>
<th colspan="2" height="28" align="center">{L_POST_DETAILS}</th>
</tr>
@ -13,7 +13,7 @@
</tr>
<tr>
<td class="row1" width="20%"><b class="gen">{L_POSTER}: </b></td>
<td class="row2" width="80%"><span class="gen">{POSTER_NAME} &nbsp; [ <a href="{U_VIEW_PROFILE}">{L_READ_PROFILE}</a> ]</span></td>
<td class="row2" width="80%"><span class="gen">{POSTER_NAME} &nbsp; [ <a href="{U_VIEW_PROFILE}">{L_READ_PROFILE}</a><!-- IF S_USER_NOTES --> | <a href="{U_MCP_USER_NOTES}">{L_VIEW_NOTES}</a> | <a href="{U_MCP_WARN_USER}">{L_WARN_USER}</a><!-- ENDIF --> ]</span></td>
</tr>
<!-- IF S_CAN_VIEWIP -->
<tr>
@ -46,47 +46,6 @@
<!-- IF S_TOPIC_REVIEW --><!-- INCLUDE posting_topic_review.html --><!-- ENDIF -->
<!-- ELSE -->
<!-- IF S_SHOW_USER_NOTES -->
<br /><a name="usernotes"></a>
<form method="post" name="mcp" action="{U_POST_ACTION}">
<!-- IF S_USER_NOTES -->
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg">
<tr>
<th colspan="2" height="28" align="center">{L_FEEDBACK}</th>
</tr>
<!-- BEGIN usernotes -->
<!-- IF usernotes.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td<!-- IF not S_CLEAR_ALLOWED --> colspan="2"<!-- ENDIF -->><span class="gensmall">Report by: <b>{usernotes.REPORT_BY}</b> on {usernotes.REPORT_AT}</span><hr /><span class="gen">{usernotes.ACTION}</span></td>
<!-- IF S_CLEAR_ALLOWED --><td width="5%" align="center"><input type="checkbox" name="marknote[]" value="{usernotes.ID}" /></td><!-- ENDIF -->
</tr>
<!-- END usernotes -->
<!-- IF S_CLEAR_ALLOWED -->
<tr>
<td class="cat" colspan="2" align="center"><input class="btnlite" type="submit" name="action[del_marked]" value="{L_DELETE_MARKED}" />&nbsp; <input class="btnlite" type="submit" name="action[del_all]" value="{L_DELETE_ALL}" /></td>
</tr>
<!-- ENDIF -->
</table>
<br />
<!-- ENDIF -->
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg">
<tr>
<th colspan="2" height="28" align="center">{L_ADD_FEEDBACK}</th>
</tr>
<tr>
<td class="row3" align="center" colspan="2"><span class="genmed">{L_ADD_FEEDBACK_EXPLAIN}</span></td>
<tr>
<td colspan="2" class="row1" align="center"><textarea name="usernote" rows="10" cols="76"></textarea></td>
</tr>
<tr>
<td class="cat" colspan="2" align="center"><input class="btnmain" type="submit" name="action[add_feedback]" value="{L_SUBMIT}" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="{L_RESET}" /></td>
</tr>
</table>
</form>
<!-- ENDIF -->
<!-- IF S_SHOW_REPORTS -->
<br /><a name="reports"></a>
@ -125,15 +84,15 @@
</tr>
<!-- IF S_CAN_CHGPOSTER -->
<tr>
<form method="post" name="mcp" action="{U_POST_ACTION}"{S_FORM_ENCTYPE}>
<form method="post" name="mcp_chgposter" action="{U_POST_ACTION}">
<td class="row1" valign="top"><b class="gen">{L_CHANGE_POSTER}</b></td>
<td class="row2"><!-- IF S_USER_SELECT --><select name="u">{S_USER_SELECT}</select> <input type="submit" class="btnmain" name="action[chgposter]" value="{L_CONFIRM}" /><br /><!-- ENDIF --> <input class="post" type="text" name="username" value="{SEARCH_USERNAME}" /> <input class="btnlite" type="submit" value="{L_SEARCH}" name="action[chgposter_search]" /></td>
<td class="row2"><input class="post" type="text" name="username" value="" /> <input class="btnmain" type="submit" value="{L_CONFIRM}" name="action[chgposter]" /><br /><span class="gensmall">[ <a href="{U_FIND_MEMBER}" onclick="window.open('{U_FIND_MEMBER}', '_phpbbsearch', 'HEIGHT=500,resizable=yes,scrollbars=yes,WIDTH=740');return false;">{L_FIND_USERNAME}</a> ]</span><!-- IF S_USER_SELECT --><br /><select name="u">{S_USER_SELECT}</select> <input type="submit" class="btnmain" name="action[chgposter_ip]" value="{L_CONFIRM}" /><!-- ENDIF --></td>
</form>
</tr>
<!-- ENDIF -->
<!-- IF S_CAN_LOCK_POST or S_CAN_DELETE_POST -->
<tr>
<form method="post" name="mcp" action="{U_MCP_ACTION}"{S_FORM_ENCTYPE}>
<form method="post" name="mcp" action="{U_MCP_ACTION}">
<td class="row1" valign="top"><b class="gen">{L_MOD_OPTIONS}</b></td>
<td class="row2"><select name="mode"><!-- IF S_CAN_LOCK_POST --><!-- IF S_POST_LOCKED --><option value="unlock_post">{L_UNLOCK_POST} [{L_UNLOCK_POST_EXPLAIN}]</option><!-- ELSE --><option value="lock_post">{L_LOCK_POST} [{L_LOCK_POST_EXPLAIN}]</option><!-- ENDIF --><!-- ENDIF --><!-- IF S_CAN_DELETE_POST --><option value="delete_post">{L_DELETE_POST}</option><!-- ENDIF --></select> <input class="btnmain" type="submit" value="{L_SUBMIT}" /></td>
</form>

View File

@ -36,7 +36,7 @@
</tr>
<tr>
<td class="row1" nowrap="nowrap"><span class="gen">{L_MERGE_TOPIC_ID}</span></td>
<td class="row2" colspan="2"><input class="post" type="text" size="6" name="to_topic_id" value="{TO_TOPIC_ID}" /> <input class="btnlite" type="submit" name="action[merge_select]" value="{L_SELECT_TOPIC}" /></td>
<td class="row2" colspan="2"><input class="post" type="text" size="6" name="to_topic_id" value="{TO_TOPIC_ID}" /> <a href="{U_SELECT_TOPIC}">{L_SELECT_TOPIC}</a></td>
</tr>
<!-- IF TO_TOPIC_INFO -->
<tr>
@ -117,13 +117,13 @@
</tr>
<!-- END postrow -->
<tr>
<td class="cat" colspan="3" height="28" align="center"><select name="mode2"><option value="" selected="selected">{L_SELECT_ACTION}</option>
<td class="cat" colspan="3" height="28" align="center"><select name="action"><option value="" selected="selected">{L_SELECT_ACTION}</option>
<!-- IF S_CAN_APPROVE --><option value="approve">{L_APPROVE_POSTS}</option><!-- ENDIF -->
<!-- IF S_CAN_LOCK --><option value="lock_post">{L_LOCK_POST_POSTS} [ {L_LOCK_POST_EXPLAIN} ]</option><option value="unlock_post">{L_UNLOCK_POST_POSTS}</option><!-- ENDIF -->
<!-- IF S_CAN_DELETE --><option value="delete_post">{L_DELETE_POSTS}</option><!-- ENDIF -->
<!-- IF S_CAN_MERGE --><option value="merge_posts"<!-- IF MODE == 'merge' --> selected="selected"<!-- ENDIF -->>{L_MERGE_POSTS}</option><!-- ENDIF -->
<!-- IF S_CAN_SPLIT --><option value="split_all"<!-- IF MODE == 'split' --> selected="selected"<!-- ENDIF -->>{L_SPLIT_POSTS}</option><option value="split_beyond">{L_SPLIT_AFTER}</option><!-- ENDIF -->
</select>&nbsp;<input class="btnmain" type="submit" name="quick" value="{L_SUBMIT}"></form></td>
</select>&nbsp;<input class="btnmain" type="submit" name="mcp_topic_submit" value="{L_SUBMIT}"></form></td>
</tr>
</table>
</form>

View File

@ -338,7 +338,7 @@ if ($hilit_words)
{
if (trim($word))
{
$highlight_match .= (($highlight_match != '') ? '|' : '') . str_replace('\*', '\w*?', preg_quote(urlencode($word), '#'));
$highlight_match .= (($highlight_match != '') ? '|' : '') . str_replace('*', '\w*?', preg_quote($word, '#'));
}
}
@ -486,7 +486,7 @@ $template->assign_vars(array(
'S_SELECT_SORT_KEY' => $s_sort_key,
'S_SELECT_SORT_DAYS' => $s_limit_days,
'S_TOPIC_ACTION' => "{$phpbb_root_path}viewtopic.$phpEx$SID&amp;f=$forum_id&amp;t=$topic_id&amp;start=$start",
'S_TOPIC_MOD' => ($topic_mod != '') ? '<select name="mode">' . $topic_mod . '</select>' : '',
'S_TOPIC_MOD' => ($topic_mod != '') ? '<select name="action">' . $topic_mod . '</select>' : '',
'S_MOD_ACTION' => "{$phpbb_root_path}mcp.$phpEx?sid=" . $user->session_id . "&amp;t=$topic_id&amp;f=$forum_id&amp;quickmod=1",
'S_DISPLAY_SEARCHBOX' => ($auth->acl_get('f_search', $forum_id)) ? true : false,