diff options
Diffstat (limited to 'phpBB/includes/functions_display.php')
| -rw-r--r-- | phpBB/includes/functions_display.php | 36 | 
1 files changed, 8 insertions, 28 deletions
| diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 86eabc419c..4e8d8f7d34 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -23,6 +23,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod  {  	global $db, $auth, $user, $template;  	global $phpbb_root_path, $phpEx, $config; +	global $request;  	$forum_rows = $subforums = $forum_ids = $forum_ids_moderator = $forum_moderators = $active_forum_ary = array();  	$parent_id = $visible_forums = 0; @@ -90,7 +91,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod  	}  	else if ($config['load_anon_lastread'] || $user->data['is_registered'])  	{ -		$tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : ''; +		$tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, phpbb_request_interface::COOKIE);  		$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();  		if (!$user->data['is_registered']) @@ -124,18 +125,6 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod  	$forum_tracking_info = array();  	$branch_root_id = $root_data['forum_id']; -	// Check for unread global announcements (index page only) -	$ga_unread = false; -	if ($root_data['forum_id'] == 0) -	{ -		$unread_ga_list = get_unread_topics($user->data['user_id'], 'AND t.forum_id = 0', '', 1); - -		if (!empty($unread_ga_list)) -		{ -			$ga_unread = true; -		} -	} -  	while ($row = $db->sql_fetchrow($result))  	{  		$forum_id = $row['forum_id']; @@ -281,8 +270,6 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod  		$token = request_var('hash', '');  		if (check_link_hash($token, 'global'))  		{ -			// Add 0 to forums array to mark global announcements correctly -			$forum_ids[] = 0;  			markread('topics', $forum_ids);  			$message = sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect . '">', '</a>');  			meta_refresh(3, $redirect); @@ -334,12 +321,6 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod  		$forum_unread = (isset($forum_tracking_info[$forum_id]) && $row['orig_forum_last_post_time'] > $forum_tracking_info[$forum_id]) ? true : false; -		// Mark the first visible forum on index as unread if there's any unread global announcement -		if ($ga_unread && !empty($forum_ids_moderator) && $forum_id == $forum_ids_moderator[0]) -		{ -			$forum_unread = true; -		} -  		$folder_image = $folder_alt = $l_subforums = '';  		$subforums_list = array(); @@ -475,8 +456,8 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod  			'FORUM_DESC'			=> generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']),  			'TOPICS'				=> $row['forum_topics'],  			$l_post_click_count		=> $post_click_count, +			'FORUM_IMG_STYLE'		=> $folder_image,  			'FORUM_FOLDER_IMG'		=> $user->img($folder_image, $folder_alt), -			'FORUM_FOLDER_IMG_SRC'	=> $user->img($folder_image, $folder_alt, false, '', 'src'),  			'FORUM_FOLDER_IMG_ALT'	=> isset($user->lang[$folder_alt]) ? $user->lang[$folder_alt] : '',  			'FORUM_IMAGE'			=> ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $user->lang[$folder_alt] . '" />' : '',  			'FORUM_IMAGE_SRC'		=> ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '', @@ -1077,6 +1058,7 @@ function display_user_activity(&$userdata)  function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, $notify_status = 'unset', $start = 0, $item_title = '')  {  	global $template, $db, $user, $phpEx, $start, $phpbb_root_path; +	global $request;  	$table_sql = ($mode == 'forum') ? FORUMS_WATCH_TABLE : TOPICS_WATCH_TABLE;  	$where_sql = ($mode == 'forum') ? 'forum_id' : 'topic_id'; @@ -1103,7 +1085,6 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,  		if (!is_null($notify_status) && $notify_status !== '')  		{ -  			if (isset($_GET['unwatch']))  			{  				$uid = request_var('uid', 0); @@ -1111,7 +1092,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,  				if (($token && check_link_hash($token, "{$mode}_$match_id")) || confirm_box(true))  				{ -					if (($uid != $user_id) || ($_GET['unwatch'] != $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>'); @@ -1168,7 +1149,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,  				if (($token && check_link_hash($token, "{$mode}_$match_id")) || confirm_box(true))  				{ -					if (($uid != $user_id) || ($_GET['watch'] != $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>'); @@ -1211,7 +1192,8 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,  	}  	else  	{ -		if ((isset($_GET['unwatch']) && $_GET['unwatch'] == $mode) || (isset($_GET['watch']) && $_GET['watch'] == $mode)) +		if ((isset($_GET['unwatch']) && $request->variable('unwatch', '', false, phpbb_request_interface::GET) == $mode) || +			(isset($_GET['watch']) && $request->variable('watch', '', false, phpbb_request_interface::GET) == $mode))  		{  			login_box();  		} @@ -1329,5 +1311,3 @@ function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $  	$avatar_img .= $avatar;  	return '<img src="' . (str_replace(' ', '%20', $avatar_img)) . '" width="' . $avatar_width . '" height="' . $avatar_height . '" alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />';  } - -?>
\ No newline at end of file | 
