1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-01 14:30:32 +02:00

ok, this one is rather large... the most important change:

re-introduce append_sid: old style continues to work, not a performance hog as it was in 2.0.x -> structure is different

apart from this, code cleanage, bug fixing, etc.


git-svn-id: file:///svn/phpbb/trunk@6015 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2006-06-06 20:53:46 +00:00
parent 2c8afb820e
commit dd9ad539fd
148 changed files with 5142 additions and 3975 deletions

View File

@@ -18,7 +18,7 @@ class mcp_ban
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
global $SID, $phpbb_root_path, $phpEx;
global $phpbb_root_path, $phpEx;
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
@@ -103,7 +103,7 @@ class mcp_ban
'S_USERNAME_BAN' => ($mode == 'user') ? true : false,
'U_ACTION' => $this->u_action,
'U_FIND_USER' => $phpbb_root_path . "memberlist.$phpEx$SID&mode=searchuser&form=mcp_ban&field=ban",
'U_FIND_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp_ban&field=ban'),
)
);
}

View File

@@ -14,9 +14,9 @@
function mcp_forum_view($id, $mode, $action, $forum_info)
{
global $template, $db, $user, $auth, $cache;
global $SID, $phpEx, $phpbb_root_path, $config;
global $phpEx, $phpbb_root_path, $config;
$url = "{$phpbb_root_path}mcp.$phpEx$SID" . extra_url();
$url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . extra_url());
if ($action == 'merge_select')
{
@@ -73,8 +73,8 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
'S_CAN_SYNC' => $auth->acl_get('m_', $forum_id),
'S_CAN_APPROVE' => $auth->acl_get('m_approve', $forum_id),
'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 : '',
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id),
'U_VIEW_FORUM_LOGS' => ($auth->acl_gets('a_', 'm_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=logs&mode=forum_logs&f=' . $forum_id) : '',
'S_MCP_ACTION' => $url . "&i=$id&action=$action&mode=$mode&start=$start" . (($action == 'merge_select') ? $selected_ids : ''),
@@ -165,12 +165,12 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
$u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? $url . '&i=queue&mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . '&t=' . $row['topic_id'] : '';
$template->assign_block_vars('topicrow', array(
'U_VIEW_TOPIC' => "{$phpbb_root_path}mcp.$phpEx$SID&i=$id&f=$forum_id&t={$row['topic_id']}&mode=topic_view",
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&f=$forum_id&t={$row['topic_id']}&mode=topic_view"),
'S_SELECT_TOPIC' => ($action == 'merge_select' && $row['topic_id'] != $topic_id) ? true : false,
'U_SELECT_TOPIC' => $url . "&i=$id&mode=topic_view&action=merge&to_topic_id=" . $row['topic_id'] . $selected_ids,
'U_MCP_QUEUE' => $u_mcp_queue,
'U_MCP_REPORT' => "{$phpbb_root_path}mcp.$phpEx$SID&i=main&mode=topic_view&t={$row['topic_id']}&action=reports",
'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", '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),
@@ -200,7 +200,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
*/
function mcp_resync_topics($topic_ids)
{
global $auth, $db, $template, $phpEx, $user, $SID, $phpbb_root_path;
global $auth, $db, $template, $phpEx, $user, $phpbb_root_path;
if (!($forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', 'm_')))
{

View File

@@ -13,10 +13,10 @@
*/
function mcp_front_view($id, $mode, $action)
{
global $SID, $phpEx, $phpbb_root_path, $config;
global $phpEx, $phpbb_root_path, $config;
global $template, $db, $user, $auth;
$url = "{$phpbb_root_path}mcp.$phpEx$SID" . extra_url();
$url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . extra_url());
// Latest 5 unapproved
$forum_list = get_forum_list('m_approve');
@@ -76,9 +76,9 @@ function mcp_front_view($id, $mode, $action)
'U_POST_DETAILS'=> $url . '&i=main&mode=post_details&p=' . $row['post_id'],
'U_MCP_FORUM' => ($row['forum_id']) ? $url . '&i=main&mode=forum_view&f=' . $row['forum_id'] : '',
'U_MCP_TOPIC' => $url . '&i=main&mode=topic_view&t=' . $row['topic_id'],
'U_FORUM' => ($row['forum_id']) ? "{$phpbb_root_path}viewforum.$phpEx$SID&f=" . $row['forum_id'] : '',
'U_TOPIC' => $phpbb_root_path . "{$phpbb_root_path}viewtopic.$phpEx$SID&f=" . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . '&t=' . $row['topic_id'],
'U_AUTHOR' => ($row['poster_id'] == ANONYMOUS) ? '' : "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['poster_id'],
'U_FORUM' => ($row['forum_id']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '',
'U_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . '&t=' . $row['topic_id']),
'U_AUTHOR' => ($row['poster_id'] == ANONYMOUS) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['poster_id']),
'FORUM_NAME' => ($row['forum_id']) ? $forum_names[$row['forum_id']] : $user->lang['GLOBAL_ANNOUNCEMENT'],
'TOPIC_TITLE' => $row['topic_title'],
@@ -159,9 +159,9 @@ function mcp_front_view($id, $mode, $action)
'U_POST_DETAILS'=> $url . '&p=' . $row['post_id'] . "&i=reports&mode=report_details",
'U_MCP_FORUM' => ($row['forum_id']) ? $url . '&f=' . $row['forum_id'] . "&i=$id&mode=forum_view" : '',
'U_MCP_TOPIC' => $url . '&t=' . $row['topic_id'] . "&i=$id&mode=topic_view",
'U_FORUM' => ($row['forum_id']) ? "{$phpbb_root_path}viewforum.$phpEx$SID&f=" . $row['forum_id'] : '',
'U_TOPIC' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f=" . $row['forum_id'] . '&t=' . $row['topic_id'],
'U_REPORTER' => ($row['user_id'] == ANONYMOUS) ? '' : "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['user_id'],
'U_FORUM' => ($row['forum_id']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '',
'U_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id']),
'U_REPORTER' => ($row['user_id'] == ANONYMOUS) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']),
'FORUM_NAME' => ($row['forum_id']) ? $row['forum_name'] : $user->lang['POST_GLOBAL'],
'TOPIC_TITLE' => $row['topic_title'],

View File

@@ -26,7 +26,7 @@ class mcp_logs
function main($id, $mode)
{
global $auth, $db, $user, $template;
global $config, $phpbb_root_path, $phpEx, $SID;
global $config, $phpbb_root_path, $phpEx;
$user->add_lang('acp/common');

View File

@@ -15,8 +15,8 @@
*/
class mcp_main
{
var $p_master;
var $u_action;
function mcp_main(&$p_master)
{
@@ -26,7 +26,7 @@ class mcp_main
function main($id, $mode)
{
global $auth, $db, $user, $template, $action;
global $config, $phpbb_root_path, $phpEx, $SID;
global $config, $phpbb_root_path, $phpEx;
$quickmod = ($mode == 'quickmod') ? true : false;
@@ -175,14 +175,7 @@ class mcp_main
mcp_post_details($id, $mode, $action);
if ($action == 'whois')
{
$this->tpl_name = 'mcp_whois';
}
else
{
$this->tpl_name = 'mcp_post';
}
$this->tpl_name = ($action == 'whois') ? 'mcp_whois' : 'mcp_post';
$this->page_title = 'MCP_MAIN_POST_DETAILS';
break;
@@ -197,7 +190,7 @@ class mcp_main
*/
function lock_unlock($action, $ids)
{
global $auth, $user, $db, $SID, $phpEx, $phpbb_root_path;
global $auth, $user, $db, $phpEx, $phpbb_root_path;
if ($action == 'lock' || $action == 'unlock')
{
@@ -268,7 +261,7 @@ function lock_unlock($action, $ids)
*/
function change_topic_type($action, $topic_ids)
{
global $auth, $user, $db, $SID, $phpEx, $phpbb_root_path;
global $auth, $user, $db, $phpEx, $phpbb_root_path;
if (!($forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('f_announce', 'f_sticky', 'm_'))))
{
@@ -374,7 +367,7 @@ function change_topic_type($action, $topic_ids)
function mcp_move_topic($topic_ids)
{
global $auth, $user, $db, $template;
global $SID, $phpEx, $phpbb_root_path;
global $phpEx, $phpbb_root_path;
if (!($forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', 'm_move')))
{
@@ -508,8 +501,8 @@ function mcp_move_topic($topic_ids)
$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>');
$message .= '<br /><br />' . sprintf($user->lang['RETURN_NEW_FORUM'], "<a href=\"{$phpbb_root_path}viewforum.$phpEx$SID&amp;f=$to_forum_id\">", '</a>');
$message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id") . '">', '</a>');
$message .= '<br /><br />' . sprintf($user->lang['RETURN_NEW_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$to_forum_id") . '">', '</a>');
trigger_error($message);
}
@@ -520,7 +513,7 @@ function mcp_move_topic($topic_ids)
*/
function mcp_delete_topic($topic_ids)
{
global $auth, $user, $db, $SID, $phpEx, $phpbb_root_path;
global $auth, $user, $db, $phpEx, $phpbb_root_path;
if (!($forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', 'm_delete')))
{
@@ -566,8 +559,9 @@ function mcp_delete_topic($topic_ids)
}
else
{
meta_refresh(3, "viewforum.$phpEx$SID&amp;f=$forum_id");
trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="viewforum.' . $phpEx . $SID . '&amp;f=' . $forum_id . '">', '</a>'));
$redirect_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id);
meta_refresh(3, $redirect_url);
trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect_url . '">', '</a>'));
}
}
@@ -576,7 +570,7 @@ function mcp_delete_topic($topic_ids)
*/
function mcp_delete_post($post_ids)
{
global $auth, $user, $db, $SID, $phpEx, $phpbb_root_path;
global $auth, $user, $db, $phpEx, $phpbb_root_path;
if (!($forum_id = check_ids($post_ids, POSTS_TABLE, 'post_id', 'm_delete')))
{
@@ -641,9 +635,9 @@ function mcp_delete_post($post_ids)
$return_link = array();
if ($affected_topics == 1 && !$deleted_topics && $topic_id)
{
$return_link[] = sprintf($user->lang['RETURN_TOPIC'], "<a href=\"viewtopic.$phpEx$SID&amp;f=$forum_id&amp;t=$topic_id\">", '</a>');
$return_link[] = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id") . '">', '</a>');
}
$return_link[] = sprintf($user->lang['RETURN_FORUM'], "<a href=\"viewforum.$phpEx$SID&amp;f=$forum_id\">", '</a>');
$return_link[] = sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) . '">', '</a>');
if (sizeof($post_ids) == 1)
{
@@ -696,7 +690,7 @@ function mcp_delete_post($post_ids)
function mcp_fork_topic($topic_ids)
{
global $auth, $user, $db, $template, $config;
global $SID, $phpEx, $phpbb_root_path;
global $phpEx, $phpbb_root_path;
if (!($forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', 'm_')))
{
@@ -927,12 +921,13 @@ function mcp_fork_topic($topic_ids)
}
else
{
meta_refresh(3, "viewforum.$phpEx$SID&amp;f=$forum_id");
$return_link = sprintf($user->lang['RETURN_FORUM'], '<a href="viewforum.' . $phpEx . $SID . '&amp;f=' . $forum_id . '">', '</a>');
$redirect_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id);
meta_refresh(3, $redirect_url);
$return_link = sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect_url . '">', '</a>');
if ($forum_id != $to_forum_id)
{
$return_link .= '<br /><br />' . sprintf($user->lang['RETURN_NEW_FORUM'], '<a href="viewforum.' . $phpEx . $SID . '&amp;f=' . $to_forum_id . '">', '</a>');
$return_link .= '<br /><br />' . sprintf($user->lang['RETURN_NEW_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $to_forum_id) . '">', '</a>');
}
trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link);

View File

@@ -15,9 +15,9 @@
*/
class mcp_notes
{
var $p_master;
var $u_action;
function mcp_main(&$p_master)
{
$this->p_master = &$p_master;
@@ -26,7 +26,7 @@ class mcp_notes
function main($id, $mode)
{
global $auth, $db, $user, $template;
global $config, $phpbb_root_path, $phpEx, $SID;
global $config, $phpbb_root_path, $phpEx;
$action = request_var('action', array('' => ''));
@@ -41,10 +41,10 @@ class mcp_notes
{
case 'front':
$template->assign_vars(array(
'L_TITLE' => $user->lang['MCP_NOTES'],
'U_FIND_MEMBER' => "memberlist.$phpEx$SID&amp;mode=searchuser&amp;form=mcp&amp;field=username",
'U_POST_ACTION' => "mcp.$phpEx$SID&amp;i=notes&amp;mode=user_notes",
)
'U_FIND_MEMBER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=mcp&amp;field=username'),
'U_POST_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes'),
'L_TITLE' => $user->lang['MCP_NOTES'])
);
$this->tpl_name = 'mcp_notes_front';
@@ -53,168 +53,172 @@ class mcp_notes
case 'user_notes':
$user->add_lang('acp/common');
mcp_notes_user_view($id, $mode, $action);
$this->mcp_notes_user_view($action);
$this->tpl_name = 'mcp_notes_user';
break;
}
}
}
//
// Functions
//
function mcp_notes_user_view($id, $mode, $action)
{
global $SID, $phpEx, $phpbb_root_path, $config;
global $template, $db, $user, $auth;
$user_id = request_var('u', 0);
$username = request_var('username', '', true);
$start = request_var('start', 0);
$st = request_var('st', 0);
$sk = request_var('sk', 'b');
$sd = request_var('sd', 'd');
$sql_where = ($user_id) ? "user_id = $user_id" : "username = '" . $db->sql_escape($username) . "'";
$sql = 'SELECT * FROM ' . USERS_TABLE . " WHERE $sql_where";
$result = $db->sql_query($sql);
if (!$userrow = $db->sql_fetchrow($result))
/**
* Display user notes
*/
function mcp_notes_user_view($action)
{
trigger_error($user->lang['NO_USER']);
}
$db->sql_freeresult($result);
global $phpEx, $phpbb_root_path, $config;
global $template, $db, $user, $auth;
$user_id = $userrow['user_id'];
$user_id = request_var('u', 0);
$username = request_var('username', '', true);
$start = request_var('start', 0);
$st = request_var('st', 0);
$sk = request_var('sk', 'b');
$sd = request_var('sd', 'd');
$deletemark = ($action == 'del_marked') ? true : false;
$deleteall = ($action == 'del_all') ? true : false;
$marked = request_var('marknote', array(0));
$usernote = request_var('usernote', '', true);
$sql_where = ($user_id) ? "user_id = $user_id" : "username = '" . $db->sql_escape($username) . "'";
// Handle any actions
if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs'))
{
$where_sql = '';
if ($deletemark && $marked)
$sql = 'SELECT *
FROM ' . USERS_TABLE . "
WHERE $sql_where";
$result = $db->sql_query($sql);
$userrow = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (!$userrow)
{
$sql_in = array();
foreach ($marked as $mark)
trigger_error($user->lang['NO_USER']);
}
$user_id = $userrow['user_id'];
$deletemark = ($action == 'del_marked') ? true : false;
$deleteall = ($action == 'del_all') ? true : false;
$marked = request_var('marknote', array(0));
$usernote = request_var('usernote', '', true);
// Handle any actions
if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs'))
{
$where_sql = '';
if ($deletemark && $marked)
{
$sql_in[] = $mark;
$sql_in = array();
foreach ($marked as $mark)
{
$sql_in[] = $mark;
}
$where_sql = ' AND log_id IN (' . implode(', ', $sql_in) . ')';
unset($sql_in);
}
if ($where_sql || $deleteall)
{
$sql = 'DELETE FROM ' . LOG_TABLE . '
WHERE log_type = ' . LOG_USERS . "
AND reportee_id = $user_id
$where_sql";
$db->sql_query($sql);
add_log('admin', 'LOG_CLEAR_USER', $userrow['username']);
$msg = ($deletemark) ? 'MARKED_NOTES_DELETED' : 'ALL_NOTES_DELETED';
$redirect = $this->u_action . '&amp;u=' . $user_id;
meta_refresh(3, $redirect);
trigger_error($user->lang[$msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
}
$where_sql = ' AND log_id IN (' . implode(', ', $sql_in) . ')';
unset($sql_in);
}
if ($where_sql || $deleteall)
if ($usernote && $action == 'add_feedback')
{
$sql = 'DELETE FROM ' . LOG_TABLE . '
WHERE log_type = ' . LOG_USERS . "
AND reportee_id = $user_id
$where_sql";
$db->sql_query($sql);
add_log('admin', 'LOG_USER_FEEDBACK', $userrow['username']);
add_log('user', $user_id, 'LOG_USER_GENERAL', $usernote);
add_log('admin', 'LOG_CLEAR_USER', $userrow['username']);
$msg = ($deletemark) ? 'MARKED_NOTES_DELETED' : 'ALL_NOTES_DELETED';
$redirect = "mcp.$phpEx$SID&amp;i=$id&amp;mode=$mode&amp;u=$user_id";
meta_refresh(2, $redirect);
trigger_error($user->lang[$msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
$redirect = $this->u_action . '&amp;u=' . $user_id;
meta_refresh(3, $redirect);
trigger_error($user->lang['USER_FEEDBACK_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
}
}
if ($usernote && $action == 'add_feedback')
{
add_log('admin', 'LOG_USER_FEEDBACK', $userrow['username']);
add_log('user', $user_id, 'LOG_USER_GENERAL', $usernote);
// Generate the appropriate user information for the user we are looking at
$rank_title = $rank_img = '';
// get_user_rank($userrow['user_rank'], $userrow['user_posts'], $rank_title, $rank_img);
$redirect = "mcp.$phpEx$SID&amp;i=$id&amp;mode=$mode&amp;u=$user_id";
meta_refresh(2, $redirect);
trigger_error($user->lang['USER_FEEDBACK_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
}
// Generate the appropriate user information for the user we are looking at
$rank_title = $rank_img = '';
// get_user_rank($userrow['user_rank'], $userrow['user_posts'], $rank_title, $rank_img);
$avatar_img = '';
if (!empty($userrow['user_avatar']))
{
switch ($userrow['user_avatar_type'])
$avatar_img = '';
if (!empty($userrow['user_avatar']))
{
case AVATAR_UPLOAD:
$avatar_img = $config['avatar_path'] . '/';
switch ($userrow['user_avatar_type'])
{
case AVATAR_UPLOAD:
$avatar_img = $config['avatar_path'] . '/';
break;
case AVATAR_GALLERY:
$avatar_img = $config['avatar_gallery_path'] . '/';
case AVATAR_GALLERY:
$avatar_img = $config['avatar_gallery_path'] . '/';
break;
}
$avatar_img .= $userrow['user_avatar'];
$avatar_img = '<img src="' . $avatar_img . '" width="' . $userrow['user_avatar_width'] . '" height="' . $userrow['user_avatar_height'] . '" alt="" />';
}
$avatar_img .= $userrow['user_avatar'];
$avatar_img = '<img src="' . $avatar_img . '" width="' . $userrow['user_avatar_width'] . '" height="' . $userrow['user_avatar_height'] . '" border="0" alt="" />';
}
else
{
$avatar_img = '<img src="adm/images/no_avatar.gif" alt="" />';
}
$limit_days = array(0 => $user->lang['ALL_ENTRIES'], 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'], 365 => $user->lang['1_YEAR']);
$sort_by_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_DATE'], 'c' => $user->lang['SORT_IP'], 'd' => $user->lang['SORT_ACTION']);
$sort_by_sql = array('a' => 'l.user_id', 'b' => 'l.log_time', 'c' => 'l.log_ip', 'd' => 'l.log_operation');
$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
gen_sort_selects($limit_days, $sort_by_text, $st, $sk, $sd, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
// Define where and sort sql for use in displaying logs
$sql_where = ($st) ? (time() - ($st * 86400)) : 0;
$sql_sort = $sort_by_sql[$sk] . ' ' . (($sd == 'd') ? 'DESC' : 'ASC');
$log_data = array();
$log_count = 0;
view_log('user', $log_data, $log_count, $config['posts_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort);
if ($log_count)
{
$template->assign_var('S_USER_NOTES', true);
foreach ($log_data as $row)
else
{
$template->assign_block_vars('usernotes', array(
'REPORT_BY' => $row['username'],
'REPORT_AT' => $user->format_date($row['time']),
'ACTION' => $row['action'],
'ID' => $row['id'])
);
$avatar_img = '<img src="adm/images/no_avatar.gif" alt="" />';
}
$limit_days = array(0 => $user->lang['ALL_ENTRIES'], 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'], 365 => $user->lang['1_YEAR']);
$sort_by_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_DATE'], 'c' => $user->lang['SORT_IP'], 'd' => $user->lang['SORT_ACTION']);
$sort_by_sql = array('a' => 'l.user_id', 'b' => 'l.log_time', 'c' => 'l.log_ip', 'd' => 'l.log_operation');
$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
gen_sort_selects($limit_days, $sort_by_text, $st, $sk, $sd, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
// Define where and sort sql for use in displaying logs
$sql_where = ($st) ? (time() - ($st * 86400)) : 0;
$sql_sort = $sort_by_sql[$sk] . ' ' . (($sd == 'd') ? 'DESC' : 'ASC');
$log_data = array();
$log_count = 0;
view_log('user', $log_data, $log_count, $config['posts_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort);
if ($log_count)
{
$template->assign_var('S_USER_NOTES', true);
foreach ($log_data as $row)
{
$template->assign_block_vars('usernotes', array(
'REPORT_BY' => $row['username'],
'REPORT_AT' => $user->format_date($row['time']),
'ACTION' => $row['action'],
'ID' => $row['id'])
);
}
}
$template->assign_vars(array(
'U_POST_ACTION' => $this->u_action . '&amp;u=' . $user_id,
'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false,
'S_SELECT_SORT_DIR' => $s_sort_dir,
'S_SELECT_SORT_KEY' => $s_sort_key,
'S_SELECT_SORT_DAYS' => $s_limit_days,
'L_TITLE' => $user->lang['MCP_NOTES_USER'],
'PAGE_NUMBER' => on_page($log_count, $config['posts_per_page'], $start),
'PAGINATION' => generate_pagination($this->u_action . "&amp;u=$user_id&amp;st=$st&amp;sk=$sk&amp;sd=$sd", $log_count, $config['posts_per_page'], $start),
'TOTAL_REPORTS' => ($log_count == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $log_count),
'USERNAME' => $userrow['username'],
'USER_COLOR' => (!empty($userrow['user_colour'])) ? $userrow['user_colour'] : '',
'RANK_TITLE' => $rank_title,
'JOINED' => $user->format_date($userrow['user_regdate']),
'POSTS' => ($userrow['user_posts']) ? $userrow['user_posts'] : 0,
'WARNINGS' => ($userrow['user_warnings']) ? $userrow['user_warnings'] : 0,
'AVATAR_IMG' => $avatar_img,
'RANK_IMG' => $rank_img,
)
);
}
$template->assign_vars(array(
'U_POST_ACTION' => "mcp.$phpEx$SID&amp;i=$id&amp;mode=$mode&amp;u=$user_id",
'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false,
'S_SELECT_SORT_DIR' => $s_sort_dir,
'S_SELECT_SORT_KEY' => $s_sort_key,
'S_SELECT_SORT_DAYS' => $s_limit_days,
'L_TITLE' => $user->lang['MCP_NOTES_USER'],
'PAGE_NUMBER' => on_page($log_count, $config['posts_per_page'], $start),
'PAGINATION' => generate_pagination("mcp.$phpEx$SID&amp;i=$id&amp;mode=$mode&amp;u=$user_id&amp;st=$st&amp;sk=$sk&amp;sd=$sd", $log_count, $config['posts_per_page'], $start),
'TOTAL_REPORTS' => ($log_count == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $log_count),
'USERNAME' => $userrow['username'],
'USER_COLOR' => (!empty($userrow['user_colour'])) ? $userrow['user_colour'] : '',
'RANK_TITLE' => $rank_title,
'JOINED' => $user->format_date($userrow['user_regdate']),
'POSTS' => ($userrow['user_posts']) ? $userrow['user_posts'] : 0,
'WARNINGS' => ($userrow['user_warnings']) ? $userrow['user_warnings'] : 0,
'AVATAR_IMG' => $avatar_img,
'RANK_IMG' => $rank_img,
)
);
}
?>

View File

@@ -13,7 +13,7 @@
*/
function mcp_post_details($id, $mode, $action)
{
global $SID, $phpEx, $phpbb_root_path, $config;
global $phpEx, $phpbb_root_path, $config;
global $template, $db, $user, $auth;
$user->add_lang('posting');
@@ -30,7 +30,7 @@ function mcp_post_details($id, $mode, $action)
}
$post_info = $post_info[$post_id];
$url = "{$phpbb_root_path}mcp.$phpEx$SID" . extra_url();
$url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . extra_url());
switch ($action)
{
@@ -45,7 +45,7 @@ function mcp_post_details($id, $mode, $action)
$whois = preg_replace('#(\s)(http:/{2}[^\s]*)(\s)#', '\1<a href="\2" target="_blank">\2</a>\3', $whois);
$template->assign_vars(array(
'RETURN_POST' => sprintf($user->lang['RETURN_POST'], "<a href=\"{$phpbb_root_path}mcp.$phpEx$SID&amp;i=$id&amp;mode=$mode&amp;p=$post_id\">", '</a>'),
'RETURN_POST' => sprintf($user->lang['RETURN_POST'], '<a href="' . append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&amp;mode=$mode&amp;p=$post_id") . '">', '</a>'),
'WHOIS' => trim($whois))
);
@@ -101,7 +101,7 @@ function mcp_post_details($id, $mode, $action)
$template->assign_vars(array(
'U_MCP_ACTION' => "$url&amp;i=main&amp;quickmod=1", // Use this for mode paramaters
'U_POST_ACTION' => "$url&amp;i=$id&amp;mode=post_details", // Use this for action parameters
'U_APPROVE_ACTION' => "{$phpbb_root_path}mcp.$phpEx$SID&amp;i=queue&amp;p=$post_id",
'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&amp;p=$post_id"),
'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']),
'S_CAN_CHGPOSTER' => $auth->acl_get('m_chgposter', $post_info['forum_id']),
@@ -114,14 +114,14 @@ function mcp_post_details($id, $mode, $action)
'S_USER_NOTES' => true,
'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false,
'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']}" : '',
'U_FIND_MEMBER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=mcp_chgposter&amp;field=username'),
'U_VIEW_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $post_info['user_id']),
'U_MCP_USER_NOTES' => ($auth->acl_gets('m_', 'a_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $post_info['user_id']) : '',
'U_MCP_WARN_USER' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']),
'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&amp;f={$post_info['forum_id']}&amp;p={$post_info['post_id']}") : '',
'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], "<a href=\"{$phpbb_root_path}viewtopic.$phpEx$SID&amp;p=$post_id#p$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>'),
'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", "p=$post_id") . "#p$post_id\">", '</a>'),
'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", "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']),
@@ -184,7 +184,7 @@ function mcp_post_details($id, $mode, $action)
'REASON_TITLE' => $row['reason_title'],
'REASON_DESC' => $row['reason_description'],
'REPORTER' => ($row['user_id'] != ANONYMOUS) ? $row['username'] : $user->lang['GUEST'],
'U_REPORTER' => ($row['user_id'] != ANONYMOUS) ? "{$phpbb_root_path}memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u={$row['user_id']}" : '',
'U_REPORTER' => ($row['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", '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'])))
@@ -249,8 +249,8 @@ function mcp_post_details($id, $mode, $action)
'NUM_POSTS' => $row['postings'],
'L_POST_S' => ($row['postings'] == 1) ? $user->lang['POST'] : $user->lang['POSTS'],
'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")
'U_PROFILE' => ($row['user_id'] == ANONYMOUS) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['user_id']),
'U_SEARCHPOSTS' => append_sid("{$phpbb_root_path}search.$phpEx", 'author=' . urlencode($row['username']) . '&amp;sr=topics'))
);
}
$db->sql_freeresult($result);
@@ -290,7 +290,7 @@ function mcp_post_details($id, $mode, $action)
'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' => "{$phpbb_root_path}mcp.$phpEx$SID&amp;i=$id&amp;mode=$mode&amp;action=whois&amp;p=$post_id&amp;ip={$row['poster_ip']}")
'U_WHOIS' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&amp;mode=$mode&amp;action=whois&amp;p=$post_id&amp;ip={$row['poster_ip']}"))
);
}
$db->sql_freeresult($result);

View File

@@ -15,8 +15,8 @@
*/
class mcp_queue
{
var $p_master;
var $u_action;
function mcp_main(&$p_master)
{
@@ -26,7 +26,7 @@ class mcp_queue
function main($id, $mode)
{
global $auth, $db, $user, $template;
global $config, $phpbb_root_path, $phpEx, $SID, $action;
global $config, $phpbb_root_path, $phpEx, $action;
include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
@@ -112,19 +112,19 @@ class mcp_queue
$template->assign_vars(array(
'S_MCP_QUEUE' => true,
'S_APPROVE_ACTION' => "{$phpbb_root_path}mcp.$phpEx$SID&amp;i=queue&amp;p=$post_id&amp;f=$forum_id",
'S_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&amp;p=$post_id&amp;f=$forum_id"),
'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']),
'S_POST_REPORTED' => $post_info['post_reported'],
'S_POST_UNAPPROVED' => !$post_info['post_approved'],
'S_POST_LOCKED' => $post_info['post_edit_locked'],
'S_USER_NOTES' => $auth->acl_gets('m_', 'a_') ? true : false,
'U_VIEW_PROFILE' => ($post_info['user_id'] != ANONYMOUS) ? "{$phpbb_root_path}memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u=" . $post_info['user_id'] : '',
'U_MCP_USER_NOTES' => "{$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']}" : '',
'U_VIEW_PROFILE' => ($post_info['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $post_info['user_id']) : '',
'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $post_info['user_id']),
'U_MCP_WARN_USER' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']),
'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&amp;f={$post_info['forum_id']}&amp;p={$post_info['post_id']}") : '',
'RETURN_QUEUE' => sprintf($user->lang['RETURN_QUEUE'], "<a href=\"{$phpbb_root_path}mcp.$phpEx$SID&amp;i=queue" . (($topic_id) ? '&amp;mode=unapproved_topics' : '&amp;mode=unapproved_posts') . "&amp;start=$start\">", '</a>'),
'RETURN_QUEUE' => sprintf($user->lang['RETURN_QUEUE'], '<a href="' . append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue' . (($topic_id) ? '&amp;mode=unapproved_topics' : '&amp;mode=unapproved_posts')) . "&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']),
@@ -293,12 +293,12 @@ class mcp_queue
$s_checkbox = '<input type="checkbox" name="post_id_list[]" value="' . $row['post_id'] . '" />';
$template->assign_block_vars('postrow', array(
'U_VIEWFORUM' => "{$phpbb_root_path}viewforum.$phpEx$SID&amp;f=" . $row['forum_id'],
'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']),
// Q: Why accessing the topic by a post_id instead of its topic_id?
// A: To prevent the post from being hidden because of wrong encoding or different charset
'U_VIEWTOPIC' => "{$phpbb_root_path}viewtopic.$phpEx$SID&amp;f=" . $row['forum_id'] . '&amp;p=' . $row['post_id'] . (($mode == 'unapproved_posts') ? '#p' . $row['post_id'] : ''),
'U_VIEW_DETAILS'=> "{$phpbb_root_path}mcp.$phpEx$SID&amp;i=queue&amp;start=$start&amp;mode=approve_details&amp;f={$forum_id}&amp;p={$row['post_id']}" . (($mode == 'unapproved_topics') ? "&amp;t={$row['topic_id']}" : '' ),
'U_VIEWPROFILE' => ($row['poster_id'] != ANONYMOUS) ? "{$phpbb_root_path}memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u={$row['poster_id']}" : '',
'U_VIEWTOPIC' => 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={$forum_id}&amp;p={$row['post_id']}" . (($mode == 'unapproved_topics') ? "&amp;t={$row['topic_id']}" : '')),
'U_VIEWPROFILE' => ($row['poster_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['poster_id']) : '',
'FORUM_NAME' => $row['forum_name'],
'TOPIC_TITLE' => $row['topic_title'],
@@ -319,7 +319,7 @@ class mcp_queue
'S_FORUM_OPTIONS' => $forum_options,
'S_MCP_ACTION' => build_url(array('t', 'f', 'sd', 'st', 'sk')),
'PAGINATION' => generate_pagination("{$phpbb_root_path}mcp.$phpEx$SID&amp;i=$id&amp;mode=$mode&amp;f=$forum_id", $total, $config['topics_per_page'], $start),
'PAGINATION' => generate_pagination($this->u_action . "&amp;f=$forum_id", $total, $config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($total, $config['topics_per_page'], $start),
'TOPIC_ID' => $topic_id,
'TOTAL' => $total)
@@ -335,7 +335,7 @@ class mcp_queue
function approve_post($post_id_list, $mode)
{
global $db, $template, $user, $config;
global $phpEx, $phpbb_root_path, $SID;
global $phpEx, $phpbb_root_path;
if (!($forum_id = check_ids($post_id_list, POSTS_TABLE, 'post_id', 'm_approve')))
{
@@ -551,7 +551,7 @@ function approve_post($post_id_list, $mode)
function disapprove_post($post_id_list, $mode)
{
global $db, $template, $user, $config;
global $phpEx, $phpbb_root_path, $SID;
global $phpEx, $phpbb_root_path;
if (!($forum_id = check_ids($post_id_list, POSTS_TABLE, 'post_id', 'm_approve')))
{

View File

@@ -15,8 +15,8 @@
*/
class mcp_reports
{
var $p_master;
var $u_action;
function mcp_main(&$p_master)
{
@@ -26,7 +26,7 @@ class mcp_reports
function main($id, $mode)
{
global $auth, $db, $user, $template;
global $config, $phpbb_root_path, $phpEx, $SID, $action;
global $config, $phpbb_root_path, $phpEx, $action;
include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
@@ -119,24 +119,24 @@ class mcp_reports
$template->assign_vars(array(
'S_MCP_REPORT' => true,
'S_CLOSE_ACTION' => "{$phpbb_root_path}mcp.$phpEx$SID&amp;i=reports&amp;p=$post_id&amp;f=$forum_id",
'S_CLOSE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=reports&amp;p=$post_id&amp;f=$forum_id"),
'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']),
'S_POST_REPORTED' => $post_info['post_reported'],
'S_POST_UNAPPROVED' => !$post_info['post_approved'],
'S_POST_LOCKED' => $post_info['post_edit_locked'],
'S_USER_NOTES' => $auth->acl_gets('m_', 'a_') ? true : false,
'U_VIEW_PROFILE' => ($post_info['user_id'] != ANONYMOUS) ? "{$phpbb_root_path}memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u=" . $post_info['user_id'] : '',
'U_MCP_USER_NOTES' => "{$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_VIEW_REPORTER_PROFILE' => "{$phpbb_root_path}memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u=" . $report['user_id'],
'U_MCP_REPORTER_NOTES' => "{$phpbb_root_path}mcp.$phpEx$SID&amp;i=notes&amp;mode=user_notes&amp;u=" . $report['user_id'],
'U_MCP_WARN_REPORTER' => "{$phpbb_root_path}mcp.$phpEx$SID&amp;i=warn&amp;mode=warn_user&amp;u=" . $report['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']}" : '',
'U_VIEW_PROFILE' => ($post_info['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $post_info['user_id']) : '',
'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $post_info['user_id']),
'U_MCP_WARN_USER' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']),
'U_VIEW_REPORTER_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $report['user_id']),
'U_MCP_REPORTER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $report['user_id']),
'U_MCP_WARN_REPORTER' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $report['user_id']),
'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&amp;f={$post_info['forum_id']}&amp;p={$post_info['post_id']}") : '',
'EDIT_IMG' => $user->img('btn_edit', $user->lang['EDIT_POST']),
'RETURN_REPORTS' => sprintf($user->lang['RETURN_REPORTS'], "<a href=\"{$phpbb_root_path}mcp.$phpEx$SID&amp;i=reports" . (($post_info['post_reported']) ? '&amp;mode=reports' : '&amp;mode=reports_closed') . "&amp;start=$start\">", '</a>'),
'RETURN_REPORTS' => sprintf($user->lang['RETURN_REPORTS'], '<a href="' . append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports' . (($post_info['post_reported']) ? '&amp;mode=reports' : '&amp;mode=reports_closed') . '&amp;start=' . $start) . '">', '</a>'),
'REPORTED_IMG' => $user->img('icon_reported', $user->lang['POST_REPORTED']),
'REPORT_REASON_TITLE' => $reason['title'],
'REPORT_REASON_DESCRIPTION' => $reason['description'],
@@ -292,13 +292,13 @@ class mcp_reports
$s_checkbox = '<input type="checkbox" name="post_id_list[]" value="' . $row['post_id'] . '" />';
$template->assign_block_vars('postrow', array(
'U_VIEWFORUM' => "{$phpbb_root_path}viewforum.$phpEx$SID&amp;f=" . $row['forum_id'],
'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']),
// Q: Why accessing the topic by a post_id instead of its topic_id?
// A: To prevent the post from being hidden because of wrong encoding or different charset
'U_VIEWTOPIC' => "{$phpbb_root_path}viewtopic.$phpEx$SID&amp;f=" . $row['forum_id'] . '&amp;p=' . $row['post_id'] . '#p' . $row['post_id'],
'U_VIEW_DETAILS' => "{$phpbb_root_path}mcp.$phpEx$SID&amp;i=reports&amp;start=$start&amp;mode=report_details&amp;f={$forum_id}&amp;p={$row['post_id']}",
'U_VIEW_POSTER_PROFILE' => ($row['poster_id'] != ANONYMOUS) ? "{$phpbb_root_path}memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u={$row['poster_id']}" : '',
'U_VIEW_REPORTER_PROFILE' => ($row['reporter_id'] != ANONYMOUS) ? "{$phpbb_root_path}memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u={$row['reporter_id']}" : '',
'U_VIEWTOPIC' => 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={$forum_id}&amp;p={$row['post_id']}"),
'U_VIEW_POSTER_PROFILE' => ($row['poster_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['poster_id']) : '',
'U_VIEW_REPORTER_PROFILE' => ($row['reporter_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['reporter_id']) : '',
'S_CHECKBOX' => $s_checkbox,
@@ -324,7 +324,7 @@ class mcp_reports
'S_FORUM_OPTIONS' => $forum_options,
'S_CLOSED' => ($mode == 'reports_closed') ? true : false,
'PAGINATION' => generate_pagination("{$phpbb_root_path}mcp.$phpEx$SID&amp;i=$id&amp;mode=$mode&amp;f=$forum_id&amp;t=$topic_id", $total, $config['topics_per_page'], $start),
'PAGINATION' => generate_pagination($this->u_action . "&amp;f=$forum_id&amp;t=$topic_id", $total, $config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($total, $config['topics_per_page'], $start),
'TOPIC_ID' => $topic_id,
'TOTAL' => $total)
@@ -342,7 +342,7 @@ class mcp_reports
function close_report($post_id_list, $mode, $action)
{
global $db, $template, $user, $config;
global $phpEx, $phpbb_root_path, $SID;
global $phpEx, $phpbb_root_path;
if (!($forum_id = check_ids($post_id_list, POSTS_TABLE, 'post_id', 'm_report')))
{

View File

@@ -13,10 +13,10 @@
*/
function mcp_topic_view($id, $mode, $action)
{
global $SID, $phpEx, $phpbb_root_path, $config;
global $phpEx, $phpbb_root_path, $config;
global $template, $db, $user, $auth;
$url = "{$phpbb_root_path}mcp.$phpEx$SID" . extra_url();
$url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . extra_url());
$user->add_lang('viewtopic');
@@ -132,7 +132,7 @@ function mcp_topic_view($id, $mode, $action)
'POST_SUBJECT' => $post_subject,
'MESSAGE' => $message,
'POST_ID' => $row['post_id'],
'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], "<a href=\"{$phpbb_root_path}viewtopic.$phpEx$SID&amp;t=$topic_id\">", '</a>'),
'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $topic_id) . '">', '</a>'),
'MINI_POST_IMG' => ($row['post_time'] > $user->data['user_lastvisit'] && $user->data['is_registered']) ? $user->img('icon_post_new', $user->lang['NEW_POST']) : $user->img('icon_post', $user->lang['POST']),
@@ -141,8 +141,8 @@ function mcp_topic_view($id, $mode, $action)
'S_POST_UNAPPROVED' => ($row['post_approved']) ? false : true,
'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=unapproved_posts&amp;action=approve&amp;post_id_list[]=" . $row['post_id'],
'U_MCP_REPORT' => "{$phpbb_root_path}mcp.$phpEx$SID&amp;i=reports&amp;mode=report_details&amp;p=" . $row['post_id'])
'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=unapproved_posts&amp;action=approve&amp;post_id_list[]=' . $row['post_id']),
'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=report_details&amp;p=' . $row['post_id']))
);
unset($rowset[$i]);
@@ -179,10 +179,10 @@ function mcp_topic_view($id, $mode, $action)
$template->assign_vars(array(
'TOPIC_TITLE' => $topic_info['topic_title'],
'U_VIEWTOPIC' => "{$phpbb_root_path}viewtopic.$phpEx$SID&amp;f=" . $topic_info['forum_id'] . '&amp;t=' . $topic_info['topic_id'],
'U_VIEWTOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", '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="' . $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>') : '',
'TO_TOPIC_INFO' => ($to_topic_id) ? sprintf($user->lang['YOU_SELECTED_TOPIC'], $to_topic_id, '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", '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,
@@ -205,11 +205,11 @@ function mcp_topic_view($id, $mode, $action)
'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>'),
'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$topic_info['forum_id']}&amp;t={$topic_info['topic_id']}&amp;start=$start") . '">', '</a>'),
'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", "f={$topic_info['forum_id']}&amp;start=$start") . '">', '</a>'),
'PAGE_NUMBER' => on_page($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),
'PAGINATION' => (!$posts_per_page) ? '' : generate_pagination(append_sid("{$phpbb_root_path}mcp.$phpEx", "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)
);
}
@@ -219,7 +219,7 @@ function mcp_topic_view($id, $mode, $action)
*/
function split_topic($action, $topic_id, $to_forum_id, $subject)
{
global $db, $template, $user, $phpEx, $SID, $phpbb_root_path, $auth;
global $db, $template, $user, $phpEx, $phpbb_root_path, $auth;
$post_id_list = request_var('post_id_list', array(0));
$start = request_var('start', 0);
@@ -375,7 +375,7 @@ function split_topic($action, $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=\"{$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>');
$return_link = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']) . '">', '</a>') . '<br /><br />' . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');
}
else
{
@@ -391,7 +391,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
}
else
{
meta_refresh(3, "viewtopic.$phpEx$SID&amp;f=$to_forum_id&amp;t=$to_topic_id");
meta_refresh(3, append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$to_forum_id&amp;t=$to_topic_id"));
trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link);
}
}
@@ -401,7 +401,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
*/
function merge_posts($topic_id, $to_topic_id)
{
global $db, $template, $user, $phpEx, $SID, $phpbb_root_path, $auth;
global $db, $template, $user, $phpEx, $phpbb_root_path, $auth;
if (!$to_topic_id)
{
@@ -463,11 +463,11 @@ function merge_posts($topic_id, $to_topic_id)
if (sizeof($topic_data))
{
$return_link .= sprintf($user->lang['RETURN_TOPIC'], '<a href="viewtopic.' . $phpEx . $SID . '&amp;f=' . $forum_id . '&amp;t=' . $topic_id . '">', '</a>');
$return_link .= sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $forum_id . '&amp;t=' . $topic_id) . '">', '</a>');
}
// Link to the new topic
$return_link .= (($return_link) ? '<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 .= (($return_link) ? '<br /><br />' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');
}
else
{
@@ -483,7 +483,7 @@ function merge_posts($topic_id, $to_topic_id)
}
else
{
meta_refresh(3, "{$phpbb_root_path}viewtopic.$phpEx$SID&amp;f=$to_forum_id&amp;t=$to_topic_id");
meta_refresh(3, append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$to_forum_id&amp;t=$to_topic_id"));
trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link);
}
}

View File

@@ -15,9 +15,9 @@
*/
class mcp_warn
{
var $p_master;
var $u_action;
function mcp_main(&$p_master)
{
$this->p_master = &$p_master;
@@ -26,7 +26,7 @@ class mcp_warn
function main($id, $mode)
{
global $auth, $db, $user, $template;
global $config, $phpbb_root_path, $phpEx, $SID;
global $config, $phpbb_root_path, $phpEx;
$action = request_var('action', array('' => ''));
@@ -59,21 +59,17 @@ class mcp_warn
}
}
//
// Functions
//
/**
* Generates the summary on the main page of the warning module
*/
function mcp_warn_front_view($id, $mode)
{
global $SID, $phpEx, $phpbb_root_path, $config;
global $phpEx, $phpbb_root_path, $config;
global $template, $db, $user, $auth;
$template->assign_vars(array(
'U_FIND_MEMBER' => "memberlist.$phpEx$SID&amp;mode=searchuser&amp;form=mcp&amp;field=username",
'U_POST_ACTION' => "mcp.$phpEx$SID&amp;i=warn&amp;mode=warn_user",
'U_FIND_MEMBER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=mcp&amp;field=username'),
'U_POST_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user'),
)
);
@@ -88,8 +84,8 @@ function mcp_warn_front_view($id, $mode)
foreach ($highest as $row)
{
$template->assign_block_vars('highest', array(
'U_NOTES' => 'mcp.' . $phpEx . $SID . '&amp;i=notes&amp;mode=user_notes&amp;u=' . $row['user_id'],
'U_USER' => 'memberlist.' . $phpEx . $SID . '&amp;mode=viewprofile&amp;u=' . $row['user_id'],
'U_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $row['user_id']),
'U_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['user_id']),
'USERNAME' => $row['username'],
'WARNING_TIME' => $user->format_date($row['user_last_warning']),
@@ -109,8 +105,8 @@ function mcp_warn_front_view($id, $mode)
while ($row = $db->sql_fetchrow($result))
{
$template->assign_block_vars('latest', array(
'U_NOTES' => 'mcp.' . $phpEx . $SID . '&amp;i=notes&amp;mode=user_notes&amp;u=' . $row['user_id'],
'U_USER' => 'memberlist.' . $phpEx . $SID . '&amp;mode=viewprofile&amp;u=' . $row['user_id'],
'U_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $row['user_id']),
'U_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['user_id']),
'USERNAME' => $row['username'],
'WARNING_TIME' => $user->format_date($row['warning_time']),
@@ -126,7 +122,7 @@ function mcp_warn_front_view($id, $mode)
*/
function mcp_warn_list_view($id, $mode, $action)
{
global $SID, $phpEx, $phpbb_root_path, $config;
global $phpEx, $phpbb_root_path, $config;
global $template, $db, $user, $auth;
$user->add_lang('memberlist');
@@ -155,8 +151,8 @@ function mcp_warn_list_view($id, $mode, $action)
foreach ($users as $row)
{
$template->assign_block_vars('user', array(
'U_NOTES' => 'mcp.' . $phpEx . $SID . '&amp;i=notes&amp;mode=user_notes&amp;u=' . $row['user_id'],
'U_USER' => 'memberlist.' . $phpEx . $SID . '&amp;mode=viewprofile&amp;u=' . $row['user_id'],
'U_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $row['user_id']),
'U_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['user_id']),
'USERNAME' => $row['username'],
'WARNING_TIME' => $user->format_date($row['user_last_warning']),
@@ -166,14 +162,14 @@ function mcp_warn_list_view($id, $mode, $action)
}
$template->assign_vars(array(
'U_POST_ACTION' => "mcp.$phpEx$SID&amp;i=$id&amp;mode=$mode",
'U_POST_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&amp;mode=$mode"),
'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false,
'S_SELECT_SORT_DIR' => $s_sort_dir,
'S_SELECT_SORT_KEY' => $s_sort_key,
'S_SELECT_SORT_DAYS' => $s_limit_days,
'PAGE_NUMBER' => on_page($user_count, $config['topics_per_page'], $start),
'PAGINATION' => generate_pagination("mcp.$phpEx$SID&amp;i=$id&amp;mode=$mode&amp;st=$st&amp;sk=$sk&amp;sd=$sd", $user_count, $config['topics_per_page'], $start),
'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&amp;mode=$mode&amp;st=$st&amp;sk=$sk&amp;sd=$sd"), $user_count, $config['topics_per_page'], $start),
'TOTAL_USERS' => ($user_count == 1) ? $user->lang['LIST_USER'] : sprintf($user->lang['LIST_USERS'], $user_count),
)
);
@@ -185,7 +181,7 @@ function mcp_warn_list_view($id, $mode, $action)
*/
function mcp_warn_post_view($id, $mode, $action)
{
global $SID, $phpEx, $phpbb_root_path, $config;
global $phpEx, $phpbb_root_path, $config;
global $template, $db, $user, $auth;
$post_id = request_var('p', 0);
@@ -227,7 +223,7 @@ function mcp_warn_post_view($id, $mode, $action)
{
add_warning($userrow, $warning, $notify, $post_id);
$redirect = "mcp.$phpEx$SID&amp;i=notes&amp;mode=user_notes&amp;u=$user_id";
$redirect = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=notes&amp;mode=user_notes&amp;u=$user_id");
meta_refresh(2, $redirect);
trigger_error($user->lang['USER_WARNING_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
}
@@ -274,11 +270,11 @@ function mcp_warn_post_view($id, $mode, $action)
}
else
{
$avatar_img = '<img src="adm/images/no_avatar.gif" alt="" />';
$avatar_img = '<img src="' . $phpbb_root_path . 'images/no_avatar.gif" alt="" />';
}
$template->assign_vars(array(
'U_POST_ACTION' => "mcp.$phpEx$SID&amp;i=$id&amp;mode=$mode&amp;p=$post_id",
'U_POST_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&amp;mode=$mode&amp;p=$post_id"),
'POST' => $message,
'USERNAME' => $userrow['username'],
@@ -298,7 +294,7 @@ function mcp_warn_post_view($id, $mode, $action)
*/
function mcp_warn_user_view($id, $mode, $action)
{
global $SID, $phpEx, $phpbb_root_path, $config;
global $phpEx, $phpbb_root_path, $config;
global $template, $db, $user, $auth;
$user_id = request_var('u', 0);
@@ -321,7 +317,7 @@ function mcp_warn_user_view($id, $mode, $action)
{
add_warning($userrow, $warning, $notify);
$redirect = "mcp.$phpEx$SID&amp;i=notes&amp;mode=user_notes&amp;u=$user_id";
$redirect = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=notes&amp;mode=user_notes&amp;u=$user_id");
meta_refresh(2, $redirect);
trigger_error($user->lang['USER_WARNING_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
}
@@ -353,7 +349,7 @@ function mcp_warn_user_view($id, $mode, $action)
// OK, they didn't submit a warning so lets build the page for them to do so
$template->assign_vars(array(
'U_POST_ACTION' => "mcp.$phpEx$SID&amp;i=$id&amp;mode=$mode&amp;u=$user_id",
'U_POST_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&amp;mode=$mode&amp;u=$user_id"),
'USERNAME' => $userrow['username'],
'USER_COLOR' => (!empty($userrow['user_colour'])) ? $userrow['user_colour'] : '',
@@ -373,7 +369,7 @@ function mcp_warn_user_view($id, $mode, $action)
*/
function add_warning($userrow, $warning, $send_pm = true, $post_id = 0)
{
global $SID, $phpEx, $phpbb_root_path, $config;
global $phpEx, $phpbb_root_path, $config;
global $template, $db, $user, $auth;
if ($send_pm)