phpBB

Code Changes

File: includes/functions_display.php

  Unmodified   Added   Modified   Removed
Line 70Line 70
				$data = array(
'NO_UNREAD_POSTS' => $user->lang['NO_UNREAD_POSTS'],
'UNREAD_POSTS' => $user->lang['UNREAD_POSTS'],

				$data = array(
'NO_UNREAD_POSTS' => $user->lang['NO_UNREAD_POSTS'],
'UNREAD_POSTS' => $user->lang['UNREAD_POSTS'],

					'U_MARK_FORUMS'		=> ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx", 'hash=' . generate_link_hash('global') . '&mark=forums&mark_time=' . time()) : '',

					'U_MARK_FORUMS'		=> ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx", 'hash=' . generate_link_hash('global') . '&mark=forums&mark_time=' . time(), false) : '',

					'MESSAGE_TITLE'		=> $user->lang['INFORMATION'],
'MESSAGE_TEXT' => $user->lang['FORUMS_MARKED']
);

					'MESSAGE_TITLE'		=> $user->lang['INFORMATION'],
'MESSAGE_TEXT' => $user->lang['FORUMS_MARKED']
);

Line 355Line 355
				$data = array(
'NO_UNREAD_POSTS' => $user->lang['NO_UNREAD_POSTS'],
'UNREAD_POSTS' => $user->lang['UNREAD_POSTS'],

				$data = array(
'NO_UNREAD_POSTS' => $user->lang['NO_UNREAD_POSTS'],
'UNREAD_POSTS' => $user->lang['UNREAD_POSTS'],

					'U_MARK_FORUMS'		=> ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'hash=' . generate_link_hash('global') . '&f=' . $root_data['forum_id'] . '&mark=forums&mark_time=' . time()) : '',

					'U_MARK_FORUMS'		=> ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'hash=' . generate_link_hash('global') . '&f=' . $root_data['forum_id'] . '&mark=forums&mark_time=' . time(), false) : '',

					'MESSAGE_TITLE'		=> $user->lang['INFORMATION'],
'MESSAGE_TEXT' => $user->lang['FORUMS_MARKED']
);

					'MESSAGE_TITLE'		=> $user->lang['INFORMATION'],
'MESSAGE_TEXT' => $user->lang['FORUMS_MARKED']
);

Line 442Line 442
			* @var	array	root_data		Array with the root forum data
* @var array row The data of the 'category'
* @since 3.1.0-RC4

			* @var	array	root_data		Array with the root forum data
* @var array row The data of the 'category'
* @since 3.1.0-RC4

			* @change 3.1.7-RC1 Removed undefined catless variable

			* @changed 3.1.7-RC1 Removed undefined catless variable

			*/
$vars = array(
'cat_row',

			*/
$vars = array(
'cat_row',

Line 506Line 506
				}
}


				}
}


			$l_subforums = (sizeof($subforums[$forum_id]) == 1) ? $user->lang['SUBFORUM'] : $user->lang['SUBFORUMS'];

			$l_subforums = (count($subforums[$forum_id]) == 1) ? $user->lang['SUBFORUM'] : $user->lang['SUBFORUMS'];

			$folder_image = ($forum_unread) ? 'forum_unread_subforum' : 'forum_read_subforum';
}
else

			$folder_image = ($forum_unread) ? 'forum_unread_subforum' : 'forum_read_subforum';
}
else

Line 537Line 537
		// Create last post link information, if appropriate
if ($row['forum_last_post_id'])
{

		// Create last post link information, if appropriate
if ($row['forum_last_post_id'])
{

			if ($row['forum_password_last_post'] === '' && $auth->acl_get('f_read', $row['forum_id_last_post']))

			if ($row['forum_password_last_post'] === '' && $auth->acl_gets('f_read', 'f_list_topics', $row['forum_id_last_post']))

			{

			{

				$last_post_subject = censor_text($row['forum_last_post_subject']);


				$last_post_subject = utf8_decode_ncr(censor_text($row['forum_last_post_subject']));


				$last_post_subject_truncated = truncate_string($last_post_subject, 30, 255, false, $user->lang['ELLIPSIS']);
}
else

				$last_post_subject_truncated = truncate_string($last_post_subject, 30, 255, false, $user->lang['ELLIPSIS']);
}
else

Line 547Line 548
				$last_post_subject = $last_post_subject_truncated = '';
}
$last_post_time = $user->format_date($row['forum_last_post_time']);

				$last_post_subject = $last_post_subject_truncated = '';
}
$last_post_time = $user->format_date($row['forum_last_post_time']);

 
			$last_post_time_rfc3339 = gmdate(DATE_RFC3339, $row['forum_last_post_time']);

			$last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id_last_post'] . '&p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id'];
}
else
{

			$last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id_last_post'] . '&p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id'];
}
else
{

			$last_post_subject = $last_post_time = $last_post_url = $last_post_subject_truncated = '';

			$last_post_subject = $last_post_time = $last_post_time_rfc3339 = $last_post_url = $last_post_subject_truncated = '';

		}

// Output moderator listing ... if applicable
$l_moderator = $moderators_list = '';
if ($display_moderators && !empty($forum_moderators[$forum_id]))
{

		}

// Output moderator listing ... if applicable
$l_moderator = $moderators_list = '';
if ($display_moderators && !empty($forum_moderators[$forum_id]))
{

			$l_moderator = (sizeof($forum_moderators[$forum_id]) == 1) ? $user->lang['MODERATOR'] : $user->lang['MODERATORS'];

			$l_moderator = (count($forum_moderators[$forum_id]) == 1) ? $user->lang['MODERATOR'] : $user->lang['MODERATORS'];

			$moderators_list = implode($user->lang['COMMA_SEPARATOR'], $forum_moderators[$forum_id]);
}


			$moderators_list = implode($user->lang['COMMA_SEPARATOR'], $forum_moderators[$forum_id]);
}


Line 605Line 607
			'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_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,

			'S_SUBFORUMS'		=> (count($subforums_list)) ? true : false,

			'S_DISPLAY_SUBJECT'	=>	($last_post_subject !== '' && $config['display_last_subject']) ? true : false,
'S_FEED_ENABLED' => ($config['feed_forum'] && !phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $row['forum_options']) && $row['forum_type'] == FORUM_POST) ? true : false,


			'S_DISPLAY_SUBJECT'	=>	($last_post_subject !== '' && $config['display_last_subject']) ? true : false,
'S_FEED_ENABLED' => ($config['feed_forum'] && !phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $row['forum_options']) && $row['forum_type'] == FORUM_POST) ? true : false,


Line 622Line 624
			'LAST_POST_SUBJECT'		=> $last_post_subject,
'LAST_POST_SUBJECT_TRUNCATED' => $last_post_subject_truncated,
'LAST_POST_TIME' => $last_post_time,

			'LAST_POST_SUBJECT'		=> $last_post_subject,
'LAST_POST_SUBJECT_TRUNCATED' => $last_post_subject_truncated,
'LAST_POST_TIME' => $last_post_time,

 
			'LAST_POST_TIME_RFC3339'=> $last_post_time_rfc3339,

			'LAST_POSTER'			=> get_username_string('username', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
'LAST_POSTER_COLOUR' => get_username_string('colour', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
'LAST_POSTER_FULL' => get_username_string('full', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),

			'LAST_POSTER'			=> get_username_string('username', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
'LAST_POSTER_COLOUR' => get_username_string('colour', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
'LAST_POSTER_FULL' => get_username_string('full', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),

Line 648Line 651
		* @var	array	row				The data of the forum
* @var array subforums_row Template data of subforums
* @since 3.1.0-a1

		* @var	array	row				The data of the forum
* @var array subforums_row Template data of subforums
* @since 3.1.0-a1

		* @change 3.1.0-b5 Added var subforums_row

		* @changed 3.1.0-b5 Added var subforums_row

		*/
$vars = array('forum_row', 'row', 'subforums_row');
extract($phpbb_dispatcher->trigger_event('core.display_forums_modify_template_vars', compact($vars)));

		*/
$vars = array('forum_row', 'row', 'subforums_row');
extract($phpbb_dispatcher->trigger_event('core.display_forums_modify_template_vars', compact($vars)));

Line 1117Line 1120
			'BBCODE_TAG'		=> $row['bbcode_tag'],
'BBCODE_TAG_CLEAN' => str_replace('=', '-', $row['bbcode_tag']),
'BBCODE_HELPLINE' => $row['bbcode_helpline'],

			'BBCODE_TAG'		=> $row['bbcode_tag'],
'BBCODE_TAG_CLEAN' => str_replace('=', '-', $row['bbcode_tag']),
'BBCODE_HELPLINE' => $row['bbcode_helpline'],

			'A_BBCODE_HELPLINE'	=> str_replace(array('&amp;', '&quot;', "'", '&lt;', '&gt;'), array('&', '"', "\'", '<', '>'), $row['bbcode_helpline']),

 
		);

/**

		);

/**

Line 1165Line 1167
*/
function display_user_activity(&$userdata_ary)
{

*/
function display_user_activity(&$userdata_ary)
{

	global $auth, $template, $db, $user;

	global $auth, $template, $db, $user, $config;

	global $phpbb_root_path, $phpEx;
global $phpbb_container, $phpbb_dispatcher;


	global $phpbb_root_path, $phpEx;
global $phpbb_container, $phpbb_dispatcher;


	// Do not display user activity for users having more than 5000 posts...
if ($userdata_ary['user_posts'] > 5000)


	// Do not display user activity for users having too many posts...
$limit = $config['load_user_activity_limit'];
if ($userdata_ary['user_posts'] > $limit && $limit != 0)

	{
return;
}

	{
return;
}

Line 1240Line 1243
	}

$userdata = $userdata_ary;

	}

$userdata = $userdata_ary;

 
	$show_user_activity = true;

	/**
* Alter list of forums and topics to display as active
*

	/**
* Alter list of forums and topics to display as active
*

Line 1247Line 1251
	* @var	array	userdata						User's data
* @var array active_f_row List of active forums
* @var array active_t_row List of active posts

	* @var	array	userdata						User's data
* @var array active_f_row List of active forums
* @var array active_t_row List of active posts

 
	* @var	bool	show_user_activity				Show user forum and topic activity

	* @since 3.1.0-RC3

	* @since 3.1.0-RC3

 
	* @changed 3.2.5-RC1 Added show_user_activity into event

	*/

	*/

	$vars = array('userdata', 'active_f_row', 'active_t_row');

	$vars = array('userdata', 'active_f_row', 'active_t_row', 'show_user_activity');

	extract($phpbb_dispatcher->trigger_event('core.display_user_activity_modify_actives', compact($vars)));
$userdata_ary = $userdata;
unset($userdata);

	extract($phpbb_dispatcher->trigger_event('core.display_user_activity_modify_actives', compact($vars)));
$userdata_ary = $userdata;
unset($userdata);

Line 1286Line 1292
		'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),

		'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),

		'S_SHOW_ACTIVITY'		=> true)

		'S_SHOW_ACTIVITY'		=> $show_user_activity)

	);
}


	);
}


Line 1645Line 1651
		($data['user_type'] != USER_INACTIVE || $data['user_inactive_reason'] != INACTIVE_MANUAL) &&

// They must be able to read PMs

		($data['user_type'] != USER_INACTIVE || $data['user_inactive_reason'] != INACTIVE_MANUAL) &&

// They must be able to read PMs

		sizeof($auth->acl_get_list($user_id, 'u_readpm')) &&

		count($auth->acl_get_list($user_id, 'u_readpm')) &&


// They must not be permanently banned


// They must not be permanently banned

		!sizeof(phpbb_get_banned_user_ids($user_id, false)) &&

		!count(phpbb_get_banned_user_ids($user_id, false)) &&


// They must allow users to contact via PM
(($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) || $data['user_allow_pm'])


// They must allow users to contact via PM
(($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) || $data['user_allow_pm'])