mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-05 08:17:47 +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:
@@ -15,9 +15,11 @@
|
||||
*/
|
||||
class ucp_attachments
|
||||
{
|
||||
var $u_action;
|
||||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $template, $user, $db, $config, $phpEx, $phpbb_root_path, $SID;
|
||||
global $template, $user, $db, $config, $phpEx, $phpbb_root_path;
|
||||
|
||||
$start = request_var('start', 0);
|
||||
$sort_key = request_var('sk', 'a');
|
||||
@@ -44,9 +46,8 @@ class ucp_attachments
|
||||
}
|
||||
delete_attachments('attach', $delete_ids);
|
||||
|
||||
$refresh_url = "{$phpbb_root_path}ucp.$phpEx$SID&i=$id";
|
||||
meta_refresh(3, $refresh_url);
|
||||
$message = ((sizeof($delete_ids) == 1) ? $user->lang['ATTACHMENT_DELETED'] : $user->lang['ATTACHMENTS_DELETED']) . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $refresh_url . '">', '</a>');
|
||||
meta_refresh(3, $this->u_action);
|
||||
$message = ((sizeof($delete_ids) == 1) ? $user->lang['ATTACHMENT_DELETED'] : $user->lang['ATTACHMENTS_DELETED']) . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
|
||||
trigger_error($message);
|
||||
}
|
||||
else
|
||||
@@ -103,11 +104,11 @@ class ucp_attachments
|
||||
{
|
||||
if ($row['in_message'])
|
||||
{
|
||||
$view_topic = "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&p={$row['post_msg_id']}";
|
||||
$view_topic = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&p={$row['post_msg_id']}");
|
||||
}
|
||||
else
|
||||
{
|
||||
$view_topic = "{$phpbb_root_path}viewtopic.$phpEx$SID&t={$row['topic_id']}&p={$row['post_msg_id']}#p{$row['post_msg_id']}";
|
||||
$view_topic = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t={$row['topic_id']}&p={$row['post_msg_id']}") . "#p{$row['post_msg_id']}";
|
||||
}
|
||||
|
||||
$template->assign_block_vars('attachrow', array(
|
||||
@@ -126,7 +127,7 @@ class ucp_attachments
|
||||
|
||||
'S_IN_MESSAGE' => $row['in_message'],
|
||||
|
||||
'U_VIEW_ATTACHMENT' => $phpbb_root_path . 'download.' . $phpEx . $SID . '&id=' . $row['attach_id'],
|
||||
'U_VIEW_ATTACHMENT' => append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . $row['attach_id']),
|
||||
'U_VIEW_TOPIC' => $view_topic)
|
||||
);
|
||||
|
||||
@@ -138,22 +139,22 @@ class ucp_attachments
|
||||
|
||||
$template->assign_vars(array(
|
||||
'PAGE_NUMBER' => on_page($num_attachments, $config['posts_per_page'], $start),
|
||||
'PAGINATION' => generate_pagination("{$phpbb_root_path}ucp.$phpEx$SID&i=$id&sk=$sort_key&sd=$sort_dir", $num_attachments, $config['posts_per_page'], $start),
|
||||
'PAGINATION' => generate_pagination($this->u_action . "&sk=$sort_key&sd=$sort_dir", $num_attachments, $config['posts_per_page'], $start),
|
||||
'TOTAL_ATTACHMENTS' => $num_attachments,
|
||||
|
||||
'L_TITLE' => $user->lang['UCP_ATTACHMENTS'],
|
||||
|
||||
'U_SORT_FILENAME' => "{$phpbb_root_path}ucp.$phpEx$SID&i=$id&sk=a&sd=" . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a'),
|
||||
'U_SORT_FILE_COMMENT' => "{$phpbb_root_path}ucp.$phpEx$SID&i=$id&sk=b&sd=" . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a'),
|
||||
'U_SORT_EXTENSION' => "{$phpbb_root_path}ucp.$phpEx$SID&i=$id&sk=c&sd=" . (($sort_key == 'c' && $sort_dir == 'a') ? 'd' : 'a'),
|
||||
'U_SORT_FILESIZE' => "{$phpbb_root_path}ucp.$phpEx$SID&i=$id&sk=d&sd=" . (($sort_key == 'd' && $sort_dir == 'a') ? 'd' : 'a'),
|
||||
'U_SORT_DOWNLOADS' => "{$phpbb_root_path}ucp.$phpEx$SID&i=$id&sk=e&sd=" . (($sort_key == 'e' && $sort_dir == 'a') ? 'd' : 'a'),
|
||||
'U_SORT_POST_TIME' => "{$phpbb_root_path}ucp.$phpEx$SID&i=$id&sk=f&sd=" . (($sort_key == 'f' && $sort_dir == 'a') ? 'd' : 'a'),
|
||||
'U_SORT_TOPIC_TITLE' => "{$phpbb_root_path}ucp.$phpEx$SID&i=$id&sk=g&sd=" . (($sort_key == 'f' && $sort_dir == 'a') ? 'd' : 'a'),
|
||||
'U_SORT_FILENAME' => $this->u_action . "&sk=a&sd=" . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a'),
|
||||
'U_SORT_FILE_COMMENT' => $this->u_action . "&sk=b&sd=" . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a'),
|
||||
'U_SORT_EXTENSION' => $this->u_action . "&i=$id&sk=c&sd=" . (($sort_key == 'c' && $sort_dir == 'a') ? 'd' : 'a'),
|
||||
'U_SORT_FILESIZE' => $this->u_action . "&sk=d&sd=" . (($sort_key == 'd' && $sort_dir == 'a') ? 'd' : 'a'),
|
||||
'U_SORT_DOWNLOADS' => $this->u_action . "&sk=e&sd=" . (($sort_key == 'e' && $sort_dir == 'a') ? 'd' : 'a'),
|
||||
'U_SORT_POST_TIME' => $this->u_action . "&sk=f&sd=" . (($sort_key == 'f' && $sort_dir == 'a') ? 'd' : 'a'),
|
||||
'U_SORT_TOPIC_TITLE' => $this->u_action . "&sk=g&sd=" . (($sort_key == 'f' && $sort_dir == 'a') ? 'd' : 'a'),
|
||||
|
||||
'S_DISPLAY_MARK_ALL' => ($num_attachments) ? true : false,
|
||||
'S_DISPLAY_PAGINATION' => ($num_attachments) ? true : false,
|
||||
'S_UCP_ACTION' => "{$phpbb_root_path}ucp.$phpEx$SID&i=$id",
|
||||
'S_UCP_ACTION' => $this->u_action,
|
||||
'S_SORT_OPTIONS' => $s_sort_key,
|
||||
'S_ORDER_SELECT' => $s_sort_dir)
|
||||
);
|
||||
|
Reference in New Issue
Block a user