diff options
Diffstat (limited to 'phpBB/includes/functions_display.php')
-rw-r--r-- | phpBB/includes/functions_display.php | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 08442f0913..9335cabc15 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -2,9 +2,8 @@ /** * * @package phpBB3 -* @version $Id$ * @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ @@ -110,7 +109,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod $sql_array['SELECT'] .= ', fa.user_id'; } - $sql = $db->sql_build_query('SELECT', array( + $sql_ary = array( 'SELECT' => $sql_array['SELECT'], 'FROM' => $sql_array['FROM'], 'LEFT_JOIN' => $sql_array['LEFT_JOIN'], @@ -118,8 +117,9 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'WHERE' => $sql_where, 'ORDER_BY' => 'f.left_id', - )); + ); + $sql = $db->sql_build_query('SELECT', $sql_ary); $result = $db->sql_query($sql); $forum_tracking_info = array(); @@ -446,6 +446,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'S_NO_CAT' => $catless && !$last_catless, 'S_IS_LINK' => ($row['forum_type'] == FORUM_LINK) ? true : false, 'S_UNREAD_FORUM' => $forum_unread, + 'S_AUTH_READ' => $auth->acl_get('f_read', $row['forum_id']), 'S_LOCKED_FORUM' => ($row['forum_status'] == ITEM_LOCKED) ? true : false, 'S_LIST_SUBFORUMS' => ($row['display_subforum_list']) ? true : false, 'S_SUBFORUMS' => (sizeof($subforums_list)) ? true : false, @@ -655,7 +656,7 @@ function topic_generate_pagination($replies, $url) $pagination .= '<a href="' . $url . ($j == 0 ? '' : '&start=' . $j) . '">' . $times . '</a>'; if ($times == 1 && $total_pages > 5) { - $pagination .= ' ... '; + $pagination .= '<span class="page-dots"> ... </span>'; // Display the last three pages $times = $total_pages - 3; @@ -1041,10 +1042,10 @@ function display_user_activity(&$userdata) $template->assign_vars(array( 'ACTIVE_FORUM' => $active_f_name, - 'ACTIVE_FORUM_POSTS' => ($active_f_count == 1) ? sprintf($user->lang['USER_POST'], 1) : sprintf($user->lang['USER_POSTS'], $active_f_count), + 'ACTIVE_FORUM_POSTS' => $user->lang('USER_POSTS', (int) $active_f_count), 'ACTIVE_FORUM_PCT' => sprintf($l_active_pct, $active_f_pct), 'ACTIVE_TOPIC' => censor_text($active_t_name), - 'ACTIVE_TOPIC_POSTS' => ($active_t_count == 1) ? sprintf($user->lang['USER_POST'], 1) : sprintf($user->lang['USER_POSTS'], $active_t_count), + 'ACTIVE_TOPIC_POSTS' => $user->lang('USER_POSTS', (int) $active_t_count), 'ACTIVE_TOPIC_PCT' => sprintf($l_active_pct, $active_t_pct), 'U_ACTIVE_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $active_f_id), 'U_ACTIVE_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $active_t_id), @@ -1065,6 +1066,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, $match_id = ($mode == 'forum') ? $forum_id : $topic_id; $u_url = "uid={$user->data['user_id']}"; $u_url .= ($mode == 'forum') ? '&f' : '&f=' . $forum_id . '&t'; + $is_watching = 0; // Is user watching this thread? if ($user_id != ANONYMOUS) @@ -1090,9 +1092,9 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, $uid = request_var('uid', 0); $token = request_var('hash', ''); - if (($token && check_link_hash($token, "{$mode}_$match_id")) || confirm_box(true)) + if ($token && check_link_hash($token, "{$mode}_$match_id") || confirm_box(true)) { - if (($uid != $user_id) || ($request->variable('unwatch', '', false, phpbb_request_interface::GET) != $mode)) + if ($uid != $user_id || $request->variable('unwatch', '', false, phpbb_request_interface::GET) != $mode) { $redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start"); $message = $user->lang['ERR_UNWATCHING'] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>'); @@ -1105,7 +1107,8 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, $db->sql_query($sql); $redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start"); - $message = $user->lang['NOT_WATCHING_' . strtoupper($mode)] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>'); + $message = $user->lang['NOT_WATCHING_' . strtoupper($mode)] . '<br /><br />'; + $message .= sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>'); meta_refresh(3, $redirect_url); trigger_error($message); } @@ -1122,7 +1125,14 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, $s_hidden_fields['t'] = $topic_id; } - $confirm_box_message = (($item_title == '') ? 'UNWATCH_' . strtoupper($mode) : $user->lang('UNWATCH_' . strtoupper($mode) . '_DETAILED', $item_title)); + if ($item_title == '') + { + $confirm_box_message = 'UNWATCH_' . strtoupper($mode); + } + else + { + $confirm_box_message = $user->lang('UNWATCH_' . strtoupper($mode) . '_DETAILED', $item_title); + } confirm_box(false, $confirm_box_message, build_hidden_fields($s_hidden_fields)); } } @@ -1147,9 +1157,9 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, $uid = request_var('uid', 0); $token = request_var('hash', ''); - if (($token && check_link_hash($token, "{$mode}_$match_id")) || confirm_box(true)) + if ($token && check_link_hash($token, "{$mode}_$match_id") || confirm_box(true)) { - if (($uid != $user_id) || ($request->variable('watch', '', false, phpbb_request_interface::GET) != $mode)) + if ($uid != $user_id || $request->variable('watch', '', false, phpbb_request_interface::GET) != $mode) { $redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start"); $message = $user->lang['ERR_WATCHING'] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>'); |