aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/mcp/mcp_forum.php5
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php33
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewfolder.php58
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewmessage.php10
4 files changed, 55 insertions, 51 deletions
diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php
index 70548faafc..4ced2b77bf 100644
--- a/phpBB/includes/mcp/mcp_forum.php
+++ b/phpBB/includes/mcp/mcp_forum.php
@@ -13,9 +13,8 @@
*/
function mcp_forum_view($id, $mode, $action, $url, $forum_info)
{
+ global $template, $db, $user, $auth, $cache;
global $SID, $phpEx, $phpbb_root_path, $config;
- global $template, $db, $user, $auth;
- global $_POST, $_REQUEST;
if ($action == 'merge_select')
{
@@ -84,7 +83,7 @@ function mcp_forum_view($id, $mode, $action, $url, $forum_info)
// Grab icons
$icons = array();
- obtain_icons($icons);
+ $cache->obtain_icons($icons);
$topic_rows = array();
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index 5202e1ae32..d742387c4e 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -30,7 +30,6 @@ function compose_pm($id, $mode, $action)
$to_user_id = request_var('u', 0);
$to_group_id = request_var('g', 0);
$msg_id = request_var('p', 0);
- $quote_post = request_var('q', 0);
$draft_id = request_var('d', 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
if ($cancel || ($current_time - $lastclick < 2 && $submit))
{
- $redirect = "{$phpbb_root_path}ucp.$phpEx$SID&amp;i=$id&amp;mode=view_messages&amp;action=view_message" . (($msg_id) ? "&amp;p=$msg_id" : '');
+ $redirect = "{$phpbb_root_path}ucp.$phpEx$SID&amp;i=$id&amp;mode=view&amp;action=view_message" . (($msg_id) ? "&amp;p=$msg_id" : '');
redirect($redirect);
}
@@ -81,6 +80,7 @@ function compose_pm($id, $mode, $action)
case 'reply':
case 'quote':
case 'forward':
+ case 'quotepost':
if (!$msg_id)
{
trigger_error('NO_MESSAGE');
@@ -91,7 +91,7 @@ function compose_pm($id, $mode, $action)
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
FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . " u
@@ -180,7 +180,7 @@ function compose_pm($id, $mode, $action)
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'));
}
@@ -236,7 +236,6 @@ function compose_pm($id, $mode, $action)
$s_action = "{$phpbb_root_path}ucp.$phpEx?sid={$user->session_id}&amp;i=$id&amp;mode=$mode&amp;action=$action";
$s_action .= ($msg_id) ? "&amp;p=$msg_id" : '';
- $s_action .= ($quote_post) ? "&amp;q=1" : '';
// Delete triggered ?
if ($action == 'delete')
@@ -296,7 +295,7 @@ function compose_pm($id, $mode, $action)
$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_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)
$msg_id = submit_pm($action, $subject, $pm_data, $update_message);
- $return_message_url = "{$phpbb_root_path}ucp.$phpEx$SID&amp;i=pm&amp;mode=view_messages&amp;action=view_message&amp;p=" . $msg_id;
+ $return_message_url = "{$phpbb_root_path}ucp.$phpEx$SID&amp;i=pm&amp;mode=view&amp;p=" . $msg_id;
$return_folder_url = "{$phpbb_root_path}ucp.$phpEx$SID&amp;i=pm&amp;folder=outbox";
meta_refresh(3, $return_message_url);
@@ -563,16 +562,16 @@ function compose_pm($id, $mode, $action)
}
// 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);
- 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";
}
- 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);
}
@@ -694,23 +693,27 @@ function compose_pm($id, $mode, $action)
{
case 'post':
$page_title = $user->lang['POST_NEW_PM'];
- break;
+ break;
case 'quote':
$page_title = $user->lang['POST_QUOTE_PM'];
- break;
+ break;
+
+ case 'quotepost':
+ $page_title = $user->lang['POST_PM_POST'];
+ break;
case 'reply':
$page_title = $user->lang['POST_REPLY_PM'];
- break;
+ break;
case 'edit':
$page_title = $user->lang['POST_EDIT_PM'];
- break;
+ break;
case 'forward':
$page_title = $user->lang['POST_FORWARD_PM'];
- break;
+ break;
default:
trigger_error('NO_ACTION_MODE');
diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php
index ebed926a25..c52349e92a 100644
--- a/phpBB/includes/ucp/ucp_pm_viewfolder.php
+++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php
@@ -10,20 +10,20 @@
/**
* 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)
{
global $phpbb_root_path, $phpEx, $SID, $user, $template, $auth, $config, $db;
-
+
$user->add_lang('viewforum');
-
+
// Grab icons
$icons = array();
obtain_icons($icons);
$color_rows = array('marked', 'replied', 'message_reported', 'friend', 'foe');
-
+
foreach ($color_rows as $var)
{
$template->assign_block_vars('pm_colour_info', array(
@@ -44,8 +44,8 @@ function view_folder($id, $mode, $folder_id, $folder, $type)
$friend = $foe = array();
// Get friends and foes
- $sql = 'SELECT *
- FROM ' . ZEBRA_TABLE . '
+ $sql = 'SELECT *
+ FROM ' . ZEBRA_TABLE . '
WHERE user_id = ' . $user->data['user_id'];
$result = $db->sql_query($sql);
@@ -61,7 +61,7 @@ function view_folder($id, $mode, $folder_id, $folder, $type)
'S_MARK_OPTIONS'=> $s_mark_options)
);
- $folder_info = get_pm_from($folder_id, $folder, $user->data['user_id'], "{$phpbb_root_path}ucp.$phpEx$SID&amp;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 ...
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)
{
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 .= ' IN (' . implode(', ', array_keys($recipient_list[$ug_type])) . ')';
-
+
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
@@ -100,7 +100,7 @@ function view_folder($id, $mode, $folder_id, $folder, $type)
}
$db->sql_freeresult($result);
}
- }
+ }
foreach ($address as $message_id => $adr_ary)
{
@@ -112,29 +112,29 @@ function view_folder($id, $mode, $folder_id, $folder, $type)
}
}
}
-
+
unset($recipient_list, $address);
}
- $url = "{$phpbb_root_path}ucp.$phpEx$SID&amp;i=$id";
+ $url = "{$phpbb_root_path}ucp.$phpEx$SID";
foreach ($folder_info['pm_list'] as $message_id)
{
$row = &$folder_info['rowset'][$message_id];
-
+
$folder_img = ($row['unread']) ? 'folder_new' : 'folder';
$folder_alt = ($row['unread']) ? 'NEW_MESSAGES' : 'NO_NEW_MESSAGES';
// Generate all URIs ...
$message_author = "<a href=\"{$phpbb_root_path}memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u=" . $row['author_id'] . '">' . $row['username'] . '</a>';
- $view_message_url = "$url&amp;f=$folder_id&amp;p=$message_id";
- $remove_message_url = "$url&amp;mode=compose&amp;action=delete&amp;p=$message_id";
+ $view_message_url = "$url&amp;i=$id&amp;f=$folder_id&amp;p=$message_id";
+ $remove_message_url = "$url&amp;i=compose&amp;action=delete&amp;p=$message_id";
$row_indicator = '';
foreach ($color_rows as $var)
{
if (($var != 'friend' && $var != 'foe' && $row[$var])
- ||
+ ||
(($var == 'friend' || $var == 'foe') && isset(${$var}[$row['author_id']]) && ${$var}[$row['author_id']]))
{
$row_indicator = $var;
@@ -145,7 +145,7 @@ function view_folder($id, $mode, $folder_id, $folder, $type)
// Send vars to template
$template->assign_block_vars('messagerow', array(
'PM_CLASS' => ($row_indicator) ? 'pm_' . $row_indicator . '_colour' : '',
-
+
'FOLDER_ID' => $folder_id,
'MESSAGE_ID' => $message_id,
'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_REMOVE_PM' => ($row['deleted']) ? $remove_message_url : '',
'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}&amp;mode=reports&amp;pm=$message_id")
-// 'U_MCP_QUEUE' => "mcp.$phpEx?sid={$user->session_id}&amp;mode=mod_queue&amp;t=$topic_id")
+ 'U_MCP_REPORT' => "{$phpbb_root_path}mcp.$phpEx?sid={$user->session_id}&amp;i=reports&amp;pm=$message_id")
+// 'U_MCP_QUEUE' => "mcp.$phpEx?sid={$user->session_id}&amp;i=mod_queue&amp;t=$topic_id")
);
}
unset($folder_info['rowset']);
-
+
$template->assign_vars(array(
'S_SHOW_RECIPIENTS' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? true : false,
'S_SHOW_COLOUR_LEGEND' => true)
@@ -255,8 +255,8 @@ function get_pm_from($folder_id, $folder, $user_id, $url, $type = 'folder')
}
else
{
- $sql = 'SELECT pm_count
- FROM ' . PRIVMSGS_FOLDER_TABLE . "
+ $sql = 'SELECT pm_count
+ FROM ' . PRIVMSGS_FOLDER_TABLE . "
WHERE folder_id = $folder_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(
- 'PAGINATION' => generate_pagination("$url&amp;mode=view_messages&amp;action=view_folder&amp;f=$folder_id&amp;$u_sort_param", $pm_count, $config['topics_per_page'], $start),
+ 'PAGINATION' => generate_pagination("$url&amp;mode=view&amp;action=view_folder&amp;f=$folder_id&amp;$u_sort_param", $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)),
@@ -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_KEY' => $s_sort_key,
'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&amp;mode=compose&amp;action=post" : '',
- 'S_PM_ACTION' => "$url&amp;mode=view_messages&amp;action=view_folder&amp;f=$folder_id")
+ 'U_POST_NEW_TOPIC' => ($auth->acl_get('u_sendpm')) ? "$url&amp;i=compose&amp;action=post" : '',
+ 'S_PM_ACTION' => "$url&amp;i=pm&amp;mode=view&amp;action=view_folder&amp;f=$folder_id")
);
// Grab all pm data
@@ -314,7 +314,7 @@ function get_pm_from($folder_id, $folder, $user_id, $url, $type = 'folder')
$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
WHERE t.user_id = $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;
return array(
- 'pm_count' => $pm_count,
- 'pm_list' => $pm_list,
+ 'pm_count' => $pm_count,
+ 'pm_list' => $pm_list,
'rowset' => $rowset
);
}
diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php
index f8bbfb10f6..9408352335 100644
--- a/phpBB/includes/ucp/ucp_pm_viewmessage.php
+++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php
@@ -13,7 +13,8 @@
*/
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'));
@@ -35,7 +36,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
// Grab icons
$icons = array();
- obtain_icons($icons);
+ $cache->obtain_icons($icons);
// Instantiate BBCode if need be
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)
{
- 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)
{
@@ -383,7 +385,7 @@ function get_user_informations($user_id, $user_row)
// Grab ranks
$ranks = array();
- obtain_ranks($ranks);
+ $cache->obtain_ranks($ranks);
// Generate online information for user
if ($config['load_onlinetrack'])