mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
- some additional changes
- fixing pm history bug (quote post) git-svn-id: file:///svn/phpbb/trunk@5243 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
1d688c6b8d
commit
2a75587153
4 changed files with 55 additions and 51 deletions
|
@ -13,9 +13,8 @@
|
||||||
*/
|
*/
|
||||||
function mcp_forum_view($id, $mode, $action, $url, $forum_info)
|
function mcp_forum_view($id, $mode, $action, $url, $forum_info)
|
||||||
{
|
{
|
||||||
|
global $template, $db, $user, $auth, $cache;
|
||||||
global $SID, $phpEx, $phpbb_root_path, $config;
|
global $SID, $phpEx, $phpbb_root_path, $config;
|
||||||
global $template, $db, $user, $auth;
|
|
||||||
global $_POST, $_REQUEST;
|
|
||||||
|
|
||||||
if ($action == 'merge_select')
|
if ($action == 'merge_select')
|
||||||
{
|
{
|
||||||
|
@ -84,7 +83,7 @@ function mcp_forum_view($id, $mode, $action, $url, $forum_info)
|
||||||
|
|
||||||
// Grab icons
|
// Grab icons
|
||||||
$icons = array();
|
$icons = array();
|
||||||
obtain_icons($icons);
|
$cache->obtain_icons($icons);
|
||||||
|
|
||||||
$topic_rows = array();
|
$topic_rows = array();
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,6 @@ function compose_pm($id, $mode, $action)
|
||||||
$to_user_id = request_var('u', 0);
|
$to_user_id = request_var('u', 0);
|
||||||
$to_group_id = request_var('g', 0);
|
$to_group_id = request_var('g', 0);
|
||||||
$msg_id = request_var('p', 0);
|
$msg_id = request_var('p', 0);
|
||||||
$quote_post = request_var('q', 0);
|
|
||||||
$draft_id = request_var('d', 0);
|
$draft_id = request_var('d', 0);
|
||||||
$lastclick = request_var('lastclick', 0);
|
$lastclick = request_var('lastclick', 0);
|
||||||
|
|
||||||
|
@ -61,7 +60,7 @@ function compose_pm($id, $mode, $action)
|
||||||
// Was cancel pressed? If so then redirect to the appropriate page
|
// Was cancel pressed? If so then redirect to the appropriate page
|
||||||
if ($cancel || ($current_time - $lastclick < 2 && $submit))
|
if ($cancel || ($current_time - $lastclick < 2 && $submit))
|
||||||
{
|
{
|
||||||
$redirect = "{$phpbb_root_path}ucp.$phpEx$SID&i=$id&mode=view_messages&action=view_message" . (($msg_id) ? "&p=$msg_id" : '');
|
$redirect = "{$phpbb_root_path}ucp.$phpEx$SID&i=$id&mode=view&action=view_message" . (($msg_id) ? "&p=$msg_id" : '');
|
||||||
redirect($redirect);
|
redirect($redirect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,6 +80,7 @@ function compose_pm($id, $mode, $action)
|
||||||
case 'reply':
|
case 'reply':
|
||||||
case 'quote':
|
case 'quote':
|
||||||
case 'forward':
|
case 'forward':
|
||||||
|
case 'quotepost':
|
||||||
if (!$msg_id)
|
if (!$msg_id)
|
||||||
{
|
{
|
||||||
trigger_error('NO_MESSAGE');
|
trigger_error('NO_MESSAGE');
|
||||||
|
@ -91,7 +91,7 @@ function compose_pm($id, $mode, $action)
|
||||||
trigger_error('NO_AUTH_SEND_MESSAGE');
|
trigger_error('NO_AUTH_SEND_MESSAGE');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($quote_post)
|
if ($mode == 'quotepost')
|
||||||
{
|
{
|
||||||
$sql = 'SELECT p.post_text as message_text, p.poster_id as author_id, p.post_time as message_time, p.bbcode_bitfield, p.bbcode_uid, p.enable_sig, p.enable_html, p.enable_smilies, p.enable_magic_url, t.topic_title as message_subject, u.username as quote_username
|
$sql = 'SELECT p.post_text as message_text, p.poster_id as author_id, p.post_time as message_time, p.bbcode_bitfield, p.bbcode_uid, p.enable_sig, p.enable_html, p.enable_smilies, p.enable_magic_url, t.topic_title as message_subject, u.username as quote_username
|
||||||
FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . " u
|
FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . " u
|
||||||
|
@ -180,7 +180,7 @@ function compose_pm($id, $mode, $action)
|
||||||
trigger_error('NO_AUTHOR');
|
trigger_error('NO_AUTHOR');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($action == 'reply' || $action == 'quote') && !sizeof($address_list) && !$refresh && !$submit && !$preview)
|
if (($action == 'reply' || $action == 'quote' || $action == 'quotepost') && !sizeof($address_list) && !$refresh && !$submit && !$preview)
|
||||||
{
|
{
|
||||||
$address_list = array('u' => array($author_id => 'to'));
|
$address_list = array('u' => array($author_id => 'to'));
|
||||||
}
|
}
|
||||||
|
@ -236,7 +236,6 @@ function compose_pm($id, $mode, $action)
|
||||||
|
|
||||||
$s_action = "{$phpbb_root_path}ucp.$phpEx?sid={$user->session_id}&i=$id&mode=$mode&action=$action";
|
$s_action = "{$phpbb_root_path}ucp.$phpEx?sid={$user->session_id}&i=$id&mode=$mode&action=$action";
|
||||||
$s_action .= ($msg_id) ? "&p=$msg_id" : '';
|
$s_action .= ($msg_id) ? "&p=$msg_id" : '';
|
||||||
$s_action .= ($quote_post) ? "&q=1" : '';
|
|
||||||
|
|
||||||
// Delete triggered ?
|
// Delete triggered ?
|
||||||
if ($action == 'delete')
|
if ($action == 'delete')
|
||||||
|
@ -296,7 +295,7 @@ function compose_pm($id, $mode, $action)
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!in_array($action, array('quote', 'edit', 'delete', 'forward')))
|
if (!in_array($action, array('quote', 'quotepost', 'edit', 'delete', 'forward')))
|
||||||
{
|
{
|
||||||
$enable_sig = ($config['allow_sig'] && $auth->acl_get('u_sig') && $user->optionget('attachsig'));
|
$enable_sig = ($config['allow_sig'] && $auth->acl_get('u_sig') && $user->optionget('attachsig'));
|
||||||
$enable_smilies = ($config['allow_smilies'] && $auth->acl_get('u_pm_smilies') && $user->optionget('smilies'));
|
$enable_smilies = ($config['allow_smilies'] && $auth->acl_get('u_pm_smilies') && $user->optionget('smilies'));
|
||||||
|
@ -499,7 +498,7 @@ function compose_pm($id, $mode, $action)
|
||||||
// ((!$message_subject) ? $subject : $message_subject)
|
// ((!$message_subject) ? $subject : $message_subject)
|
||||||
$msg_id = submit_pm($action, $subject, $pm_data, $update_message);
|
$msg_id = submit_pm($action, $subject, $pm_data, $update_message);
|
||||||
|
|
||||||
$return_message_url = "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=view_messages&action=view_message&p=" . $msg_id;
|
$return_message_url = "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=view&p=" . $msg_id;
|
||||||
$return_folder_url = "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder=outbox";
|
$return_folder_url = "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder=outbox";
|
||||||
meta_refresh(3, $return_message_url);
|
meta_refresh(3, $return_message_url);
|
||||||
|
|
||||||
|
@ -563,16 +562,16 @@ function compose_pm($id, $mode, $action)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Decode text for message display
|
// Decode text for message display
|
||||||
$bbcode_uid = (($action == 'quote' || $action == 'forward')&& !$preview && !$refresh && !sizeof($error)) ? $bbcode_uid : $message_parser->bbcode_uid;
|
$bbcode_uid = (($action == 'quote' || $action == 'forward' || $action == 'quotepost') && !$preview && !$refresh && !sizeof($error)) ? $bbcode_uid : $message_parser->bbcode_uid;
|
||||||
|
|
||||||
$message_parser->decode_message($bbcode_uid);
|
$message_parser->decode_message($bbcode_uid);
|
||||||
|
|
||||||
if ($action == 'quote' && !$preview && !$refresh)
|
if (($action == 'quote' || $action == 'quotepost') && !$preview && !$refresh)
|
||||||
{
|
{
|
||||||
$message_parser->message = '[quote="' . $quote_username . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
|
$message_parser->message = '[quote="' . $quote_username . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($action == 'reply' || $action == 'quote') && !$preview && !$refresh)
|
if (($action == 'reply' || $action == 'quote' || $action == 'quotepost') && !$preview && !$refresh)
|
||||||
{
|
{
|
||||||
$message_subject = ((!preg_match('/^Re:/', $message_subject)) ? 'Re: ' : '') . censor_text($message_subject);
|
$message_subject = ((!preg_match('/^Re:/', $message_subject)) ? 'Re: ' : '') . censor_text($message_subject);
|
||||||
}
|
}
|
||||||
|
@ -694,23 +693,27 @@ function compose_pm($id, $mode, $action)
|
||||||
{
|
{
|
||||||
case 'post':
|
case 'post':
|
||||||
$page_title = $user->lang['POST_NEW_PM'];
|
$page_title = $user->lang['POST_NEW_PM'];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'quote':
|
case 'quote':
|
||||||
$page_title = $user->lang['POST_QUOTE_PM'];
|
$page_title = $user->lang['POST_QUOTE_PM'];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'quotepost':
|
||||||
|
$page_title = $user->lang['POST_PM_POST'];
|
||||||
|
break;
|
||||||
|
|
||||||
case 'reply':
|
case 'reply':
|
||||||
$page_title = $user->lang['POST_REPLY_PM'];
|
$page_title = $user->lang['POST_REPLY_PM'];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'edit':
|
case 'edit':
|
||||||
$page_title = $user->lang['POST_EDIT_PM'];
|
$page_title = $user->lang['POST_EDIT_PM'];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'forward':
|
case 'forward':
|
||||||
$page_title = $user->lang['POST_FORWARD_PM'];
|
$page_title = $user->lang['POST_FORWARD_PM'];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
trigger_error('NO_ACTION_MODE');
|
trigger_error('NO_ACTION_MODE');
|
||||||
|
|
|
@ -10,20 +10,20 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* View message folder
|
* View message folder
|
||||||
* Called from ucp_pm with mode == 'view_messages' && action == 'view_folder'
|
* Called from ucp_pm with mode == 'view' && action == 'view_folder'
|
||||||
*/
|
*/
|
||||||
function view_folder($id, $mode, $folder_id, $folder, $type)
|
function view_folder($id, $mode, $folder_id, $folder, $type)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx, $SID, $user, $template, $auth, $config, $db;
|
global $phpbb_root_path, $phpEx, $SID, $user, $template, $auth, $config, $db;
|
||||||
|
|
||||||
$user->add_lang('viewforum');
|
$user->add_lang('viewforum');
|
||||||
|
|
||||||
// Grab icons
|
// Grab icons
|
||||||
$icons = array();
|
$icons = array();
|
||||||
obtain_icons($icons);
|
obtain_icons($icons);
|
||||||
|
|
||||||
$color_rows = array('marked', 'replied', 'message_reported', 'friend', 'foe');
|
$color_rows = array('marked', 'replied', 'message_reported', 'friend', 'foe');
|
||||||
|
|
||||||
foreach ($color_rows as $var)
|
foreach ($color_rows as $var)
|
||||||
{
|
{
|
||||||
$template->assign_block_vars('pm_colour_info', array(
|
$template->assign_block_vars('pm_colour_info', array(
|
||||||
|
@ -44,8 +44,8 @@ function view_folder($id, $mode, $folder_id, $folder, $type)
|
||||||
$friend = $foe = array();
|
$friend = $foe = array();
|
||||||
|
|
||||||
// Get friends and foes
|
// Get friends and foes
|
||||||
$sql = 'SELECT *
|
$sql = 'SELECT *
|
||||||
FROM ' . ZEBRA_TABLE . '
|
FROM ' . ZEBRA_TABLE . '
|
||||||
WHERE user_id = ' . $user->data['user_id'];
|
WHERE user_id = ' . $user->data['user_id'];
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ function view_folder($id, $mode, $folder_id, $folder, $type)
|
||||||
'S_MARK_OPTIONS'=> $s_mark_options)
|
'S_MARK_OPTIONS'=> $s_mark_options)
|
||||||
);
|
);
|
||||||
|
|
||||||
$folder_info = get_pm_from($folder_id, $folder, $user->data['user_id'], "{$phpbb_root_path}ucp.$phpEx$SID&i=$id", $type);
|
$folder_info = get_pm_from($folder_id, $folder, $user->data['user_id'], "{$phpbb_root_path}ucp.$phpEx$SID", $type);
|
||||||
|
|
||||||
// Okay, lets dump out the page ...
|
// Okay, lets dump out the page ...
|
||||||
if (sizeof($folder_info['pm_list']))
|
if (sizeof($folder_info['pm_list']))
|
||||||
|
@ -84,14 +84,14 @@ function view_folder($id, $mode, $folder_id, $folder, $type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (array('u', 'g') as $ug_type)
|
foreach (array('u', 'g') as $ug_type)
|
||||||
{
|
{
|
||||||
if (isset($recipient_list[$ug_type]) && sizeof($recipient_list[$ug_type]))
|
if (isset($recipient_list[$ug_type]) && sizeof($recipient_list[$ug_type]))
|
||||||
{
|
{
|
||||||
$sql = ($ug_type == 'u') ? 'SELECT user_id as id, username as name, user_colour as colour FROM ' . USERS_TABLE . ' WHERE user_id' : 'SELECT group_id as id, group_name as name, group_colour as colour FROM ' . GROUPS_TABLE . ' WHERE group_id';
|
$sql = ($ug_type == 'u') ? 'SELECT user_id as id, username as name, user_colour as colour FROM ' . USERS_TABLE . ' WHERE user_id' : 'SELECT group_id as id, group_name as name, group_colour as colour FROM ' . GROUPS_TABLE . ' WHERE group_id';
|
||||||
$sql .= ' IN (' . implode(', ', array_keys($recipient_list[$ug_type])) . ')';
|
$sql .= ' IN (' . implode(', ', array_keys($recipient_list[$ug_type])) . ')';
|
||||||
|
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
|
@ -100,7 +100,7 @@ function view_folder($id, $mode, $folder_id, $folder, $type)
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($address as $message_id => $adr_ary)
|
foreach ($address as $message_id => $adr_ary)
|
||||||
{
|
{
|
||||||
|
@ -112,29 +112,29 @@ function view_folder($id, $mode, $folder_id, $folder, $type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unset($recipient_list, $address);
|
unset($recipient_list, $address);
|
||||||
}
|
}
|
||||||
|
|
||||||
$url = "{$phpbb_root_path}ucp.$phpEx$SID&i=$id";
|
$url = "{$phpbb_root_path}ucp.$phpEx$SID";
|
||||||
|
|
||||||
foreach ($folder_info['pm_list'] as $message_id)
|
foreach ($folder_info['pm_list'] as $message_id)
|
||||||
{
|
{
|
||||||
$row = &$folder_info['rowset'][$message_id];
|
$row = &$folder_info['rowset'][$message_id];
|
||||||
|
|
||||||
$folder_img = ($row['unread']) ? 'folder_new' : 'folder';
|
$folder_img = ($row['unread']) ? 'folder_new' : 'folder';
|
||||||
$folder_alt = ($row['unread']) ? 'NEW_MESSAGES' : 'NO_NEW_MESSAGES';
|
$folder_alt = ($row['unread']) ? 'NEW_MESSAGES' : 'NO_NEW_MESSAGES';
|
||||||
|
|
||||||
// Generate all URIs ...
|
// Generate all URIs ...
|
||||||
$message_author = "<a href=\"{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['author_id'] . '">' . $row['username'] . '</a>';
|
$message_author = "<a href=\"{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['author_id'] . '">' . $row['username'] . '</a>';
|
||||||
$view_message_url = "$url&f=$folder_id&p=$message_id";
|
$view_message_url = "$url&i=$id&f=$folder_id&p=$message_id";
|
||||||
$remove_message_url = "$url&mode=compose&action=delete&p=$message_id";
|
$remove_message_url = "$url&i=compose&action=delete&p=$message_id";
|
||||||
|
|
||||||
$row_indicator = '';
|
$row_indicator = '';
|
||||||
foreach ($color_rows as $var)
|
foreach ($color_rows as $var)
|
||||||
{
|
{
|
||||||
if (($var != 'friend' && $var != 'foe' && $row[$var])
|
if (($var != 'friend' && $var != 'foe' && $row[$var])
|
||||||
||
|
||
|
||||||
(($var == 'friend' || $var == 'foe') && isset(${$var}[$row['author_id']]) && ${$var}[$row['author_id']]))
|
(($var == 'friend' || $var == 'foe') && isset(${$var}[$row['author_id']]) && ${$var}[$row['author_id']]))
|
||||||
{
|
{
|
||||||
$row_indicator = $var;
|
$row_indicator = $var;
|
||||||
|
@ -145,7 +145,7 @@ function view_folder($id, $mode, $folder_id, $folder, $type)
|
||||||
// Send vars to template
|
// Send vars to template
|
||||||
$template->assign_block_vars('messagerow', array(
|
$template->assign_block_vars('messagerow', array(
|
||||||
'PM_CLASS' => ($row_indicator) ? 'pm_' . $row_indicator . '_colour' : '',
|
'PM_CLASS' => ($row_indicator) ? 'pm_' . $row_indicator . '_colour' : '',
|
||||||
|
|
||||||
'FOLDER_ID' => $folder_id,
|
'FOLDER_ID' => $folder_id,
|
||||||
'MESSAGE_ID' => $message_id,
|
'MESSAGE_ID' => $message_id,
|
||||||
'MESSAGE_AUTHOR' => $message_author,
|
'MESSAGE_AUTHOR' => $message_author,
|
||||||
|
@ -164,13 +164,13 @@ function view_folder($id, $mode, $folder_id, $folder, $type)
|
||||||
'U_VIEW_PM' => ($row['deleted']) ? '' : $view_message_url,
|
'U_VIEW_PM' => ($row['deleted']) ? '' : $view_message_url,
|
||||||
'U_REMOVE_PM' => ($row['deleted']) ? $remove_message_url : '',
|
'U_REMOVE_PM' => ($row['deleted']) ? $remove_message_url : '',
|
||||||
'RECIPIENTS' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? implode(', ', $address_list[$message_id]) : '',
|
'RECIPIENTS' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? implode(', ', $address_list[$message_id]) : '',
|
||||||
'U_MCP_REPORT' => "{$phpbb_root_path}mcp.$phpEx?sid={$user->session_id}&mode=reports&pm=$message_id")
|
'U_MCP_REPORT' => "{$phpbb_root_path}mcp.$phpEx?sid={$user->session_id}&i=reports&pm=$message_id")
|
||||||
// 'U_MCP_QUEUE' => "mcp.$phpEx?sid={$user->session_id}&mode=mod_queue&t=$topic_id")
|
// 'U_MCP_QUEUE' => "mcp.$phpEx?sid={$user->session_id}&i=mod_queue&t=$topic_id")
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
unset($folder_info['rowset']);
|
unset($folder_info['rowset']);
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_SHOW_RECIPIENTS' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? true : false,
|
'S_SHOW_RECIPIENTS' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? true : false,
|
||||||
'S_SHOW_COLOUR_LEGEND' => true)
|
'S_SHOW_COLOUR_LEGEND' => true)
|
||||||
|
@ -255,8 +255,8 @@ function get_pm_from($folder_id, $folder, $user_id, $url, $type = 'folder')
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$sql = 'SELECT pm_count
|
$sql = 'SELECT pm_count
|
||||||
FROM ' . PRIVMSGS_FOLDER_TABLE . "
|
FROM ' . PRIVMSGS_FOLDER_TABLE . "
|
||||||
WHERE folder_id = $folder_id
|
WHERE folder_id = $folder_id
|
||||||
AND user_id = $user_id";
|
AND user_id = $user_id";
|
||||||
}
|
}
|
||||||
|
@ -269,7 +269,7 @@ function get_pm_from($folder_id, $folder, $user_id, $url, $type = 'folder')
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'PAGINATION' => generate_pagination("$url&mode=view_messages&action=view_folder&f=$folder_id&$u_sort_param", $pm_count, $config['topics_per_page'], $start),
|
'PAGINATION' => generate_pagination("$url&mode=view&action=view_folder&f=$folder_id&$u_sort_param", $pm_count, $config['topics_per_page'], $start),
|
||||||
'PAGE_NUMBER' => on_page($pm_count, $config['topics_per_page'], $start),
|
'PAGE_NUMBER' => on_page($pm_count, $config['topics_per_page'], $start),
|
||||||
'TOTAL_MESSAGES'=> (($pm_count == 1) ? $user->lang['VIEW_PM_MESSAGE'] : sprintf($user->lang['VIEW_PM_MESSAGES'], $pm_count)),
|
'TOTAL_MESSAGES'=> (($pm_count == 1) ? $user->lang['VIEW_PM_MESSAGE'] : sprintf($user->lang['VIEW_PM_MESSAGES'], $pm_count)),
|
||||||
|
|
||||||
|
@ -282,10 +282,10 @@ function get_pm_from($folder_id, $folder, $user_id, $url, $type = 'folder')
|
||||||
'S_SELECT_SORT_DIR' => $s_sort_dir,
|
'S_SELECT_SORT_DIR' => $s_sort_dir,
|
||||||
'S_SELECT_SORT_KEY' => $s_sort_key,
|
'S_SELECT_SORT_KEY' => $s_sort_key,
|
||||||
'S_SELECT_SORT_DAYS' => $s_limit_days,
|
'S_SELECT_SORT_DAYS' => $s_limit_days,
|
||||||
'S_TOPIC_ICONS' => ($config['enable_pm_icons']) ? true : false,
|
'S_TOPIC_ICONS' => ($config['enable_pm_icons']) ? true : false,
|
||||||
|
|
||||||
'U_POST_NEW_TOPIC' => ($auth->acl_get('u_sendpm')) ? "$url&mode=compose&action=post" : '',
|
'U_POST_NEW_TOPIC' => ($auth->acl_get('u_sendpm')) ? "$url&i=compose&action=post" : '',
|
||||||
'S_PM_ACTION' => "$url&mode=view_messages&action=view_folder&f=$folder_id")
|
'S_PM_ACTION' => "$url&i=pm&mode=view&action=view_folder&f=$folder_id")
|
||||||
);
|
);
|
||||||
|
|
||||||
// Grab all pm data
|
// Grab all pm data
|
||||||
|
@ -314,7 +314,7 @@ function get_pm_from($folder_id, $folder, $user_id, $url, $type = 'folder')
|
||||||
$sql_start = $start;
|
$sql_start = $start;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'SELECT t.*, p.author_id, p.root_level, p.message_time, p.message_subject, p.icon_id, p.message_reported, p.to_address, p.message_attachment, p.bcc_address, u.username
|
$sql = 'SELECT t.*, p.author_id, p.root_level, p.message_time, p.message_subject, p.icon_id, p.message_reported, p.to_address, p.message_attachment, p.bcc_address, u.username
|
||||||
FROM ' . PRIVMSGS_TO_TABLE . ' t, ' . PRIVMSGS_TABLE . ' p, ' . USERS_TABLE . " u
|
FROM ' . PRIVMSGS_TO_TABLE . ' t, ' . PRIVMSGS_TABLE . ' p, ' . USERS_TABLE . " u
|
||||||
WHERE t.user_id = $user_id
|
WHERE t.user_id = $user_id
|
||||||
AND p.author_id = u.user_id
|
AND p.author_id = u.user_id
|
||||||
|
@ -335,8 +335,8 @@ function get_pm_from($folder_id, $folder, $user_id, $url, $type = 'folder')
|
||||||
$pm_list = ($store_reverse) ? array_reverse($pm_list) : $pm_list;
|
$pm_list = ($store_reverse) ? array_reverse($pm_list) : $pm_list;
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'pm_count' => $pm_count,
|
'pm_count' => $pm_count,
|
||||||
'pm_list' => $pm_list,
|
'pm_list' => $pm_list,
|
||||||
'rowset' => $rowset
|
'rowset' => $rowset
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,8 @@
|
||||||
*/
|
*/
|
||||||
function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
|
function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx, $SID, $user, $template, $auth, $config, $db;
|
global $user, $template, $auth, $db, $cache;
|
||||||
|
global $phpbb_root_path, $phpEx, $SID, $config;
|
||||||
|
|
||||||
$user->add_lang(array('viewtopic', 'memberlist'));
|
$user->add_lang(array('viewtopic', 'memberlist'));
|
||||||
|
|
||||||
|
@ -35,7 +36,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
|
||||||
|
|
||||||
// Grab icons
|
// Grab icons
|
||||||
$icons = array();
|
$icons = array();
|
||||||
obtain_icons($icons);
|
$cache->obtain_icons($icons);
|
||||||
|
|
||||||
// Instantiate BBCode if need be
|
// Instantiate BBCode if need be
|
||||||
if ($message_row['bbcode_bitfield'])
|
if ($message_row['bbcode_bitfield'])
|
||||||
|
@ -369,7 +370,8 @@ function message_history($msg_id, $user_id, $message_row, $folder)
|
||||||
*/
|
*/
|
||||||
function get_user_informations($user_id, $user_row)
|
function get_user_informations($user_id, $user_row)
|
||||||
{
|
{
|
||||||
global $config, $db, $auth, $user, $phpbb_root_path, $phpEx, $SID;
|
global $db, $auth, $user, $cache;
|
||||||
|
global $phpbb_root_path, $phpEx, $SID, $config;
|
||||||
|
|
||||||
if (!$user_id)
|
if (!$user_id)
|
||||||
{
|
{
|
||||||
|
@ -383,7 +385,7 @@ function get_user_informations($user_id, $user_row)
|
||||||
|
|
||||||
// Grab ranks
|
// Grab ranks
|
||||||
$ranks = array();
|
$ranks = array();
|
||||||
obtain_ranks($ranks);
|
$cache->obtain_ranks($ranks);
|
||||||
|
|
||||||
// Generate online information for user
|
// Generate online information for user
|
||||||
if ($config['load_onlinetrack'])
|
if ($config['load_onlinetrack'])
|
||||||
|
|
Loading…
Add table
Reference in a new issue