From 530b7e94c5e10eb1b9aa2ea488825265b685651e Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 21 May 2006 16:54:19 +0000 Subject: - fixing a few smaller bugs/glitches - init user session in cron.php (else it can produce errors if functions expect the user object being set) - fix sql escaping for mssql/mssql_odbc git-svn-id: file:///svn/phpbb/trunk@5957 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/ucp/ucp_attachments.php | 2 +- phpBB/includes/ucp/ucp_main.php | 8 ++++---- phpBB/includes/ucp/ucp_pm_compose.php | 32 ++++++++++++++++---------------- phpBB/includes/ucp/ucp_zebra.php | 3 ++- 4 files changed, 23 insertions(+), 22 deletions(-) (limited to 'phpBB/includes/ucp') diff --git a/phpBB/includes/ucp/ucp_attachments.php b/phpBB/includes/ucp/ucp_attachments.php index f48012f9a0..f8a6d1bf89 100644 --- a/phpBB/includes/ucp/ucp_attachments.php +++ b/phpBB/includes/ucp/ucp_attachments.php @@ -107,7 +107,7 @@ class ucp_attachments } else { - $view_topic = "{$phpbb_root_path}viewtopic.$phpEx$SID&t={$row['topic_id']}&p={$row['post_msg_id']}#{$row['post_msg_id']}"; + $view_topic = "{$phpbb_root_path}viewtopic.$phpEx$SID&t={$row['topic_id']}&p={$row['post_msg_id']}#p{$row['post_msg_id']}"; } $template->assign_block_vars('attachrow', array( diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index 2c777e139f..7421cdd53f 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -137,7 +137,7 @@ class ucp_main 'S_USER_POSTED' => (!empty($row['topic_posted']) && $row['topic_posted']) ? true : false, 'S_UNREAD' => $unread_topic, - 'U_LAST_POST' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$g_forum_id&t=$topic_id&p=" . $row['topic_last_post_id'] . '#' . $row['topic_last_post_id'], + 'U_LAST_POST' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$g_forum_id&t=$topic_id&p=" . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'], 'U_LAST_POST_AUTHOR'=> ($row['topic_last_poster_id'] != ANONYMOUS) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['topic_last_poster_id'] : '', 'U_NEWEST_POST' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$g_forum_id&t=$topic_id&view=unread#unread", 'U_VIEW_TOPIC' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$g_forum_id&t=$topic_id") @@ -287,7 +287,7 @@ class ucp_main $last_poster = ($row['forum_last_poster_name'] != '') ? $row['forum_last_poster_name'] : $user->lang['GUEST']; $last_poster_url = ($row['forum_last_poster_id'] == ANONYMOUS) ? '' : "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['forum_last_poster_id']; - $last_post_url = "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$forum_id&p=" . $row['forum_last_post_id'] . '#' . $row['forum_last_post_id']; + $last_post_url = "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$forum_id&p=" . $row['forum_last_post_id'] . '#p' . $row['forum_last_post_id']; } else { @@ -444,7 +444,7 @@ class ucp_main 'S_UNREAD_TOPIC' => $unread_topic, 'U_NEWEST_POST' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id&view=unread#unread", - 'U_LAST_POST' => $view_topic_url . '&p=' . $row['topic_last_post_id'] . '#' . $row['topic_last_post_id'], + 'U_LAST_POST' => $view_topic_url . '&p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'], 'U_LAST_POST_AUTHOR'=> ($row['topic_last_poster_id'] != ANONYMOUS && $row['topic_last_poster_id']) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u={$row['topic_last_poster_id']}" : '', 'U_VIEW_TOPIC' => $view_topic_url) ); @@ -590,7 +590,7 @@ class ucp_main 'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_attach', '') : '', 'LAST_POST_IMG' => $user->img('icon_post_latest', 'VIEW_LATEST_POST'), - 'U_LAST_POST' => $view_topic_url . '&p=' . $row['topic_last_post_id'] . '#' . $row['topic_last_post_id'], + 'U_LAST_POST' => $view_topic_url . '&p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'], 'U_LAST_POST_AUTHOR'=> ($row['topic_last_poster_id'] != ANONYMOUS && $row['topic_last_poster_id']) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u={$row['topic_last_poster_id']}" : '', 'U_VIEW_TOPIC' => $view_topic_url, 'U_VIEW_FORUM' => "{$phpbb_root_path}viewforum.$phpEx$SID&f={$forum_id}", diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index cd6831c419..c61832c721 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -59,7 +59,11 @@ 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("ucp.$phpEx$SID&i=pm&mode=view&action=view_message" . (($msg_id) ? "&p=$msg_id" : '')); + if ($msg_id) + { + redirect("ucp.$phpEx$SID&i=pm&mode=view&action=view_message&p=$msg_id"); + } + redirect("ucp.$phpEx$SID&i=pm"); } $sql = ''; @@ -79,12 +83,6 @@ function compose_pm($id, $mode, $action) case 'quote': case 'forward': case 'quotepost': - if ($submit) - { - // We don't need to retrieve the post text again when the user is submitting. - break; - } - if (!$msg_id) { trigger_error('NO_MESSAGE'); @@ -167,14 +165,14 @@ function compose_pm($id, $mode, $action) if ($sql) { $result = $db->sql_query_limit($sql, 1); + $post = $db->sql_fetchrow($result); + $db->sql_freeresult($result); - if (!($post = $db->sql_fetchrow($result))) + if (!$post) { trigger_error('NO_MESSAGE'); } - $db->sql_freeresult($result); - $msg_id = (int) $post['msg_id']; $folder_id = (isset($post['folder_id'])) ? $post['folder_id'] : 0; $message_text = (isset($post['message_text'])) ? $post['message_text'] : ''; @@ -397,9 +395,11 @@ function compose_pm($id, $mode, $action) if ($row = $db->sql_fetchrow($result)) { - $_REQUEST['subject'] = $row['draft_subject']; - $_REQUEST['message'] = $row['draft_message']; - $refresh = true; +// $_REQUEST['subject'] = $row['draft_subject']; +// $_REQUEST['message'] = $row['draft_message']; +// $refresh = false; + $message_parser->message = $row['draft_message']; + $message_subject = $row['draft_subject']; $template->assign_var('S_DRAFT_LOADED', true); } else @@ -445,7 +445,7 @@ function compose_pm($id, $mode, $action) // Parse Attachments - before checksum is calculated $message_parser->parse_attachments('fileupload', $action, 0, $submit, $preview, $refresh, true); - // Check checksum ... don't re-parse message if the same + // Parse message $message_parser->parse($enable_bbcode, $enable_urls, $enable_smilies, $img_status, $flash_status, true); if ($action != 'edit' && !$preview && !$refresh && $config['flood_interval'] && !$auth->acl_get('u_ignoreflood')) @@ -578,7 +578,7 @@ function compose_pm($id, $mode, $action) if ($action == 'quotepost') { $post_id = request_var('p', 0); - $message_link = "[url=" . generate_board_url() . "/viewtopic.$phpEx?p={$post_id}#{$post_id}]{$message_subject}[/url]\n"; + $message_link = "[url=" . generate_board_url() . "/viewtopic.$phpEx?p={$post_id}#p{$post_id}]{$message_subject}[/url]\n"; } else { @@ -592,7 +592,7 @@ function compose_pm($id, $mode, $action) $message_subject = ((!preg_match('/^Re:/', $message_subject)) ? 'Re: ' : '') . censor_text($message_subject); } - if ($action == 'forward' && !$preview && !$refresh) + if ($action == 'forward' && !$preview && !$refresh && !$submit) { $fwd_to_field = write_pm_addresses(array('to' => $post['to_address']), 0, true); diff --git a/phpBB/includes/ucp/ucp_zebra.php b/phpBB/includes/ucp/ucp_zebra.php index 243d55fef9..c8b4e5b66d 100644 --- a/phpBB/includes/ucp/ucp_zebra.php +++ b/phpBB/includes/ucp/ucp_zebra.php @@ -186,7 +186,8 @@ class ucp_zebra FROM ' . ZEBRA_TABLE . ' z, ' . USERS_TABLE . ' u WHERE z.user_id = ' . $user->data['user_id'] . " AND $sql_and - AND u.user_id = z.zebra_id"; + AND u.user_id = z.zebra_id + ORDER BY u.username ASC"; $result = $db->sql_query($sql); $s_username_options = ''; -- cgit v1.2.1