diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-06-06 20:53:46 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-06-06 20:53:46 +0000 |
commit | dd9ad539fdab80badedf801a816b8a0beafbbf5c (patch) | |
tree | db8ae8a184b060d5576604cc0dfa723773daedb8 /phpBB/includes/ucp/ucp_pm_viewfolder.php | |
parent | 2c8afb820e3842bed2ab6cec4053e71b5c566985 (diff) | |
download | forums-dd9ad539fdab80badedf801a816b8a0beafbbf5c.tar forums-dd9ad539fdab80badedf801a816b8a0beafbbf5c.tar.gz forums-dd9ad539fdab80badedf801a816b8a0beafbbf5c.tar.bz2 forums-dd9ad539fdab80badedf801a816b8a0beafbbf5c.tar.xz forums-dd9ad539fdab80badedf801a816b8a0beafbbf5c.zip |
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
Diffstat (limited to 'phpBB/includes/ucp/ucp_pm_viewfolder.php')
-rw-r--r-- | phpBB/includes/ucp/ucp_pm_viewfolder.php | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php index e088104828..b3421a203d 100644 --- a/phpBB/includes/ucp/ucp_pm_viewfolder.php +++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php @@ -15,11 +15,11 @@ function view_folder($id, $mode, $folder_id, $folder) { global $user, $template, $auth, $db, $cache; - global $phpbb_root_path, $config, $phpEx, $SID; + global $phpbb_root_path, $config, $phpEx; $submit_export = (isset($_POST['submit_export'])) ? true : false; - $folder_info = get_pm_from($folder_id, $folder, $user->data['user_id'], "{$phpbb_root_path}ucp.$phpEx$SID"); + $folder_info = get_pm_from($folder_id, $folder, $user->data['user_id']); if (!$submit_export) { @@ -148,15 +148,13 @@ function view_folder($id, $mode, $folder_id, $folder) { foreach ($id_ary as $ug_id => $_id) { - $address_list[$message_id][] = (($type == 'u') ? "<a href=\"{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=$ug_id\">" : "<a href=\"{$phpbb_root_path}memberlist.$phpEx$SID&mode=group&g=$ug_id\">") . (($recipient_list[$type][$ug_id]['colour']) ? '<span style="color:#' . $recipient_list[$type][$ug_id]['colour'] . '">' : '<span>') . $recipient_list[$type][$ug_id]['name'] . '</span></a>'; + $address_list[$message_id][] = (($type == 'u') ? '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $ug_id) . '">' : '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $ug_id) . '">') . (($recipient_list[$type][$ug_id]['colour']) ? '<span style="color:#' . $recipient_list[$type][$ug_id]['colour'] . '">' : '<span>') . $recipient_list[$type][$ug_id]['name'] . '</span></a>'; } } } unset($recipient_list, $address); } - $url = "{$phpbb_root_path}ucp.$phpEx$SID"; - $data = array(); foreach ($folder_info['pm_list'] as $message_id) @@ -167,9 +165,9 @@ function view_folder($id, $mode, $folder_id, $folder) $folder_alt = ($row['unread']) ? 'NEW_MESSAGES' : 'NO_NEW_MESSAGES'; // Generate all URIs ... - $message_author = "<a href=\"{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['author_id'] . '">' . $row['username'] . '</a>'; - $view_message_url = "$url&i=$id&mode=view&f=$folder_id&p=$message_id"; - $remove_message_url = "$url&i=$id&mode=compose&action=delete&p=$message_id"; + $message_author = '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['author_id']) . '">' . $row['username'] . '</a>'; + $view_message_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&mode=view&f=$folder_id&p=$message_id"); + $remove_message_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&mode=compose&action=delete&p=$message_id"); $row_indicator = ''; foreach ($color_rows as $var) @@ -193,7 +191,7 @@ function view_folder($id, $mode, $folder_id, $folder) 'SENT_TIME' => $user->format_date($row['message_time']), 'SUBJECT' => censor_text($row['message_subject']), 'FOLDER' => (isset($folder[$row['folder_id']])) ? $folder[$row['folder_id']]['folder_name'] : '', - 'U_FOLDER' => (isset($folder[$row['folder_id']])) ? "$url&folder=" . $row['folder_id'] : '', + 'U_FOLDER' => (isset($folder[$row['folder_id']])) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'folder=' . $row['folder_id']) : '', 'PM_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? '<img src="' . $config['icons_path'] . '/' . $icons[$row['icon_id']]['img'] . '" width="' . $icons[$row['icon_id']]['width'] . '" height="' . $icons[$row['icon_id']]['height'] . '" alt="" title="" />' : '', 'FOLDER_IMG' => $user->img($folder_img, $folder_alt), 'PM_IMG' => ($row_indicator) ? $user->img('pm_' . $row_indicator, '') : '', @@ -381,9 +379,9 @@ function view_folder($id, $mode, $folder_id, $folder) /** * Get Messages from folder/user */ -function get_pm_from($folder_id, $folder, $user_id, $url) +function get_pm_from($folder_id, $folder, $user_id) { - global $user, $db, $template, $config, $auth, $_POST; + global $user, $db, $template, $config, $auth, $phpbb_root_path, $phpEx; $start = request_var('start', 0); @@ -434,7 +432,7 @@ function get_pm_from($folder_id, $folder, $user_id, $url) } $template->assign_vars(array( - 'PAGINATION' => generate_pagination("$url&i=pm&mode=view&action=view_folder&f=$folder_id&$u_sort_param", $pm_count, $config['topics_per_page'], $start), + 'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&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), 'TOTAL_MESSAGES'=> (($pm_count == 1) ? $user->lang['VIEW_PM_MESSAGE'] : sprintf($user->lang['VIEW_PM_MESSAGES'], $pm_count)), @@ -447,8 +445,8 @@ function get_pm_from($folder_id, $folder, $user_id, $url) 'S_SELECT_SORT_DAYS' => $s_limit_days, 'S_TOPIC_ICONS' => ($config['enable_pm_icons']) ? true : false, - 'U_POST_NEW_TOPIC' => ($auth->acl_get('u_sendpm')) ? "$url&i=pm&mode=compose" : '', - 'S_PM_ACTION' => "$url&i=pm&mode=view&action=view_folder&f=$folder_id") + 'U_POST_NEW_TOPIC' => ($auth->acl_get('u_sendpm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose') : '', + 'S_PM_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=view&action=view_folder&f=$folder_id")) ); // Grab all pm data |