phpBB

Code Changes

File: memberlist.php

  Unmodified   Added   Modified   Removed
Line 20Line 20
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);


include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);


$mode = request_var('mode', '');

$mode = $request->variable('mode', '');


if ($mode === 'contactadmin')
{


if ($mode === 'contactadmin')
{

Line 37Line 37
$template->assign_var('S_IN_MEMBERLIST', true);

// Grab data

$template->assign_var('S_IN_MEMBERLIST', true);

// Grab data

$action		= request_var('action', '');
$user_id = request_var('u', ANONYMOUS);
$username = request_var('un', '', true);
$group_id = request_var('g', 0);
$topic_id = request_var('t', 0);

$action		= $request->variable('action', '');
$user_id = $request->variable('u', ANONYMOUS);
$username = $request->variable('un', '', true);
$group_id = $request->variable('g', 0);
$topic_id = $request->variable('t', 0);


// Redirect when old mode is used
if ($mode == 'leaders')


// Redirect when old mode is used
if ($mode == 'leaders')

Line 75Line 75
		{
if ($user->data['user_id'] != ANONYMOUS)
{

		{
if ($user->data['user_id'] != ANONYMOUS)
{

 
				send_status_line(403, 'Forbidden');

				trigger_error('NO_VIEW_USERS');
}


				trigger_error('NO_VIEW_USERS');
}


Line 83Line 84
	break;
}


	break;
}


$start	= request_var('start', 0);




/** @var \phpbb\group\helper $group_helper */
$group_helper = $phpbb_container->get('group_helper');

$start = $request->variable('start', 0);

$submit = (isset($_POST['submit'])) ? true : false;

$default_key = 'c';

$submit = (isset($_POST['submit'])) ? true : false;

$default_key = 'c';

$sort_key = request_var('sk', $default_key);
$sort_dir = request_var('sd', 'a');







$sort_key = $request->variable('sk', $default_key);
$sort_dir = $request->variable('sd', 'a');

$user_types = array(USER_NORMAL, USER_FOUNDER);
if ($auth->acl_get('a_user'))
{
$user_types[] = USER_INACTIVE;
}


// What do you want to do today? ... oops, I think that line is taken ...
switch ($mode)


// What do you want to do today? ... oops, I think that line is taken ...
switch ($mode)

Line 136Line 146
			}
else
{

			}
else
{

				$row['group_name'] = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];

				$row['group_name'] = $group_helper->get_name($row['group_name']);

				$row['u_group'] = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']);
}


				$row['u_group'] = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']);
}


Line 151Line 161
		$db->sql_freeresult($result);

$sql_ary = array(

		$db->sql_freeresult($result);

$sql_ary = array(

			'SELECT'	=> 'u.user_id, u.group_id as default_group, u.username, u.username_clean, u.user_colour, u.user_rank, u.user_posts, u.user_allow_pm, g.group_id',

			'SELECT'	=> 'u.user_id, u.group_id as default_group, u.username, u.username_clean, u.user_colour, u.user_type, u.user_rank, u.user_posts, u.user_allow_pm, g.group_id',


'FROM' => array(
USER_GROUP_TABLE => 'ug',


'FROM' => array(
USER_GROUP_TABLE => 'ug',

Line 172Line 182

'ORDER_BY' => 'u.username_clean ASC',
);


'ORDER_BY' => 'u.username_clean ASC',
);

 

/**
* Modify the query used to get the users for the team page
*
* @event core.memberlist_team_modify_query
* @var array sql_ary Array containing the query
* @var array group_ids Array of group ids
* @var array teampage_data The teampage data
* @since 3.1.3-RC1
*/
$vars = array(
'sql_ary',
'group_ids',
'teampage_data',
);
extract($phpbb_dispatcher->trigger_event('core.memberlist_team_modify_query', compact($vars)));


$result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary));



$result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary));


Line 285Line 311

$user_rank_data = phpbb_get_user_rank($row, (($row['user_id'] == ANONYMOUS) ? false : $row['user_posts']));



$user_rank_data = phpbb_get_user_rank($row, (($row['user_id'] == ANONYMOUS) ? false : $row['user_posts']));


						$template->assign_block_vars('group.user', array(

						$template_vars = array(

							'USER_ID'		=> $row['user_id'],
'FORUMS' => $row['forums'],
'FORUM_OPTIONS' => (isset($row['forums_options'])) ? true : false,

							'USER_ID'		=> $row['user_id'],
'FORUMS' => $row['forums'],
'FORUM_OPTIONS' => (isset($row['forums_options'])) ? true : false,

Line 297Line 323

'RANK_IMG' => $user_rank_data['img'],
'RANK_IMG_SRC' => $user_rank_data['img_src'],


'RANK_IMG' => $user_rank_data['img'],
'RANK_IMG_SRC' => $user_rank_data['img_src'],

 

'S_INACTIVE' => $row['user_type'] == USER_INACTIVE,


'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($row['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&u=' . $row['user_id']) : '',



'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($row['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&u=' . $row['user_id']) : '',


Line 304Line 332
							'USERNAME'			=> get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']),
'USER_COLOR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']),
'U_VIEW_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']),

							'USERNAME'			=> get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']),
'USER_COLOR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']),
'U_VIEW_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']),

						));



















						);

/**
* Modify the template vars for displaying the user in the groups on the teampage
*
* @event core.memberlist_team_modify_template_vars
* @var array template_vars Array containing the query
* @var array row Array containing the action user row
* @var array groups_ary Array of groups with all users that should be displayed
* @since 3.1.3-RC1
*/
$vars = array(
'template_vars',
'row',
'groups_ary',
);
extract($phpbb_dispatcher->trigger_event('core.memberlist_team_modify_template_vars', compact($vars)));

$template->assign_block_vars('group.user', $template_vars);


if ($config['teampage_memberships'] != 2)
{


if ($config['teampage_memberships'] != 2)
{

Line 327Line 373

if (!$auth->acl_get('u_sendim'))
{


if (!$auth->acl_get('u_sendim'))
{

 
			send_status_line(403, 'Forbidden');

			trigger_error('NOT_AUTHORISED');
}


			trigger_error('NOT_AUTHORISED');
}


Line 377Line 424
						include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);

$subject = sprintf($user->lang['IM_JABBER_SUBJECT'], $user->data['username'], $config['server_name']);

						include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);

$subject = sprintf($user->lang['IM_JABBER_SUBJECT'], $user->data['username'], $config['server_name']);

						$message = utf8_normalize_nfc(request_var('message', '', true));

						$message = $request->variable('message', '', true);


if (empty($message))
{


if (empty($message))
{

Line 502Line 549
		$group_data = $group_sort = array();
foreach ($profile_groups as $row)
{

		$group_data = $group_sort = array();
foreach ($profile_groups as $row)
{

			if ($row['group_type'] == GROUP_SPECIAL)
{
// Lookup group name in language dictionary
if (isset($user->lang['G_' . $row['group_name']]))
{
$row['group_name'] = $user->lang['G_' . $row['group_name']];
}
}
else if (!$auth_hidden_groups && $row['group_type'] == GROUP_HIDDEN && !isset($user_groups[$row['group_id']]))

			if (!$auth_hidden_groups && $row['group_type'] == GROUP_HIDDEN && !isset($user_groups[$row['group_id']]))









			{
// Skip over hidden groups the user cannot see
continue;
}

			{
// Skip over hidden groups the user cannot see
continue;
}

 

$row['group_name'] = $group_helper->get_name($row['group_name']);


$group_sort[$row['group_id']] = utf8_clean_string($row['group_name']);
$group_data[$row['group_id']] = $row;


$group_sort[$row['group_id']] = utf8_clean_string($row['group_name']);
$group_data[$row['group_id']] = $row;

Line 604Line 645
		$profile_fields = array();
if ($config['load_cpf_viewprofile'])
{

		$profile_fields = array();
if ($config['load_cpf_viewprofile'])
{

 
			/* @var $cp \phpbb\profilefields\manager */

			$cp = $phpbb_container->get('profilefields.manager');
$profile_fields = $cp->grab_profile_fields_data($user_id);
$profile_fields = (isset($profile_fields[$user_id])) ? $cp->generate_profile_fields_template_data($profile_fields[$user_id]) : array();

			$cp = $phpbb_container->get('profilefields.manager');
$profile_fields = $cp->grab_profile_fields_data($user_id);
$profile_fields = (isset($profile_fields[$user_id])) ? $cp->generate_profile_fields_template_data($profile_fields[$user_id]) : array();

Line 681Line 723
			'U_MCP_QUEUE'			=> ($auth->acl_getf_global('m_approve')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue', true, $user->session_id) : '',

'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_id) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&u={$user_id}&hash=" . generate_link_hash('switchperm')) : '',

			'U_MCP_QUEUE'			=> ($auth->acl_getf_global('m_approve')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue', true, $user->session_id) : '',

'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_id) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&u={$user_id}&hash=" . generate_link_hash('switchperm')) : '',

			'U_EDIT_SELF'			=> ($user_id == $user->data['user_id']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=ucp_profile&mode=profile_info') : '',

			'U_EDIT_SELF'			=> ($user_id == $user->data['user_id'] && $auth->acl_get('u_chgprofileinfo')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=ucp_profile&mode=profile_info') : '',


'S_USER_NOTES' => ($user_notes_enabled) ? true : false,
'S_WARN_USER' => ($warn_user_enabled) ? true : false,


'S_USER_NOTES' => ($user_notes_enabled) ? true : false,
'S_WARN_USER' => ($warn_user_enabled) ? true : false,

Line 752Line 794
			include($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
}


			include($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
}


		$user_id	= request_var('u', 0);
$topic_id = request_var('t', 0);

		$user_id	= $request->variable('u', 0);
$topic_id = $request->variable('t', 0);


if ($user_id)
{


if ($user_id)
{

Line 771Line 813
		{
trigger_error('NO_EMAIL');
}

		{
trigger_error('NO_EMAIL');
}

 

/** @var $form \phpbb\message\form */

		$form = $phpbb_container->get('message.form.' . $form_name);

$form->bind($request);

		$form = $phpbb_container->get('message.form.' . $form_name);

$form->bind($request);

Line 798Line 842

$sql = 'SELECT username, user_id, user_colour
FROM ' . USERS_TABLE . '


$sql = 'SELECT username, user_id, user_colour
FROM ' . USERS_TABLE . '

			WHERE ' . $db->sql_in_set('user_type', array(USER_NORMAL, USER_FOUNDER)) . '

			WHERE ' . $db->sql_in_set('user_type', $user_types) . '

				AND username_clean ' . $db->sql_like_expression(utf8_clean_string($username_chars) . $db->get_any_char());
$result = $db->sql_query_limit($sql, 10);
$user_list = array();

				AND username_clean ' . $db->sql_like_expression(utf8_clean_string($username_chars) . $db->get_any_char());
$result = $db->sql_query_limit($sql, 10);
$user_list = array();

Line 826Line 870
		// The basic memberlist
$page_title = $user->lang['MEMBERLIST'];
$template_html = 'memberlist_body.html';

		// The basic memberlist
$page_title = $user->lang['MEMBERLIST'];
$template_html = 'memberlist_body.html';

 

/* @var $pagination \phpbb\pagination */

		$pagination = $phpbb_container->get('pagination');

// Sorting

		$pagination = $phpbb_container->get('pagination');

// Sorting

Line 874Line 920
		$sql_select = $sql_where_data = $sql_from = $sql_where = $order_by = '';



		$sql_select = $sql_where_data = $sql_from = $sql_where = $order_by = '';



		$form			= request_var('form', '');
$field = request_var('field', '');
$select_single = request_var('select_single', false);

		$form			= $request->variable('form', '');
$field = $request->variable('field', '');
$select_single = $request->variable('select_single', false);


// Search URL parameters, if any of these are in the URL we do a search
$search_params = array('username', 'email', 'jabber', 'search_group_id', 'joined_select', 'active_select', 'count_select', 'joined', 'active', 'count', 'ip');


// Search URL parameters, if any of these are in the URL we do a search
$search_params = array('username', 'email', 'jabber', 'search_group_id', 'joined_select', 'active_select', 'count_select', 'joined', 'active', 'count', 'ip');

Line 886Line 932
		$field = (!preg_match('/^[a-z0-9_-]+$/i', $field)) ? '' : $field;
if ((($mode == '' || $mode == 'searchuser') || sizeof(array_intersect($request->variable_names(\phpbb\request\request_interface::GET), $search_params)) > 0) && ($config['load_search'] || $auth->acl_get('a_')))
{

		$field = (!preg_match('/^[a-z0-9_-]+$/i', $field)) ? '' : $field;
if ((($mode == '' || $mode == 'searchuser') || sizeof(array_intersect($request->variable_names(\phpbb\request\request_interface::GET), $search_params)) > 0) && ($config['load_search'] || $auth->acl_get('a_')))
{

			$username	= request_var('username', '', true);
$email = strtolower(request_var('email', ''));
$jabber = request_var('jabber', '');
$search_group_id = request_var('search_group_id', 0);

			$username	= $request->variable('username', '', true);
$email = strtolower($request->variable('email', ''));
$jabber = $request->variable('jabber', '');
$search_group_id = $request->variable('search_group_id', 0);


// when using these, make sure that we actually have values defined in $find_key_match


// when using these, make sure that we actually have values defined in $find_key_match

			$joined_select	= request_var('joined_select', 'lt');
$active_select = request_var('active_select', 'lt');
$count_select = request_var('count_select', 'eq');

			$joined_select	= $request->variable('joined_select', 'lt');
$active_select = $request->variable('active_select', 'lt');
$count_select = $request->variable('count_select', 'eq');





			$joined			= explode('-', request_var('joined', ''));
$active = explode('-', request_var('active', ''));
$count = (request_var('count', '') !== '') ? request_var('count', 0) : '';
$ipdomain = request_var('ip', '');

			$joined			= explode('-', $request->variable('joined', ''));
$active = explode('-', $request->variable('active', ''));
$count = ($request->variable('count', '') !== '') ? $request->variable('count', 0) : '';
$ipdomain = $request->variable('ip', '');


$find_key_match = array('lt' => '<', 'gt' => '>', 'eq' => '=');



$find_key_match = array('lt' => '<', 'gt' => '>', 'eq' => '=');


Line 991Line 1037
						FROM ' . POSTS_TABLE . '
WHERE poster_ip ' . ((strpos($ips, '%') !== false) ? 'LIKE' : 'IN') . " ($ips)
AND " . $db->sql_in_set('forum_id', $ip_forums);

						FROM ' . POSTS_TABLE . '
WHERE poster_ip ' . ((strpos($ips, '%') !== false) ? 'LIKE' : 'IN') . " ($ips)
AND " . $db->sql_in_set('forum_id', $ip_forums);

 

/**
* Modify sql query for members search by ip address / hostname
*
* @event core.memberlist_modify_ip_search_sql_query
* @var string ipdomain The host name
* @var string ips IP address list for the given host name
* @var string sql The SQL query for searching members by IP address
* @since 3.1.7-RC1
*/
$vars = array(
'ipdomain',
'ips',
'sql',
);
extract($phpbb_dispatcher->trigger_event('core.memberlist_modify_ip_search_sql_query', compact($vars)));


					$result = $db->sql_query($sql);

if ($row = $db->sql_fetchrow($result))

					$result = $db->sql_query($sql);

if ($row = $db->sql_fetchrow($result))

Line 1016Line 1079
			}
}


			}
}


		$first_char = request_var('first_char', '');

		$first_char = $request->variable('first_char', '');


if ($first_char == 'other')
{


if ($first_char == 'other')
{

Line 1035Line 1098
		if ($mode == 'group')
{
// We JOIN here to save a query for determining membership for hidden groups. ;)

		if ($mode == 'group')
{
// We JOIN here to save a query for determining membership for hidden groups. ;)

			$sql = 'SELECT g.*, ug.user_id

			$sql = 'SELECT g.*, ug.user_id, ug.group_leader

				FROM ' . GROUPS_TABLE . ' g
LEFT JOIN ' . USER_GROUP_TABLE . ' ug ON (ug.user_pending = 0 AND ug.user_id = ' . $user->data['user_id'] . " AND ug.group_id = $group_id)
WHERE g.group_id = $group_id";

				FROM ' . GROUPS_TABLE . ' g
LEFT JOIN ' . USER_GROUP_TABLE . ' ug ON (ug.user_pending = 0 AND ug.user_id = ' . $user->data['user_id'] . " AND ug.group_id = $group_id)
WHERE g.group_id = $group_id";

Line 1093Line 1156
				{
$user_rank_data['img'] .= '<br />';
}

				{
$user_rank_data['img'] .= '<br />';
}

 
			}
// include modules for manage groups link display or not
// need to ensure the module is active
$can_manage_group = false;
if ($user->data['is_registered'] && $group_row['group_leader'])
{
if (!class_exists('p_master'))
{
include($phpbb_root_path . 'includes/functions_module.' . $phpEx);
}
$module = new p_master;
$module->list_modules('ucp');

if ($module->is_active('ucp_groups', 'manage'))
{
$can_manage_group = true;
}
unset($module);

			}

$template->assign_vars(array(
'GROUP_DESC' => generate_text_for_display($group_row['group_desc'], $group_row['group_desc_uid'], $group_row['group_desc_bitfield'], $group_row['group_desc_options']),

			}

$template->assign_vars(array(
'GROUP_DESC' => generate_text_for_display($group_row['group_desc'], $group_row['group_desc_uid'], $group_row['group_desc_bitfield'], $group_row['group_desc_options']),

				'GROUP_NAME'	=> ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'],

				'GROUP_NAME'	=> $group_helper->get_name($group_row['group_name']),

				'GROUP_COLOR'	=> $group_row['group_colour'],
'GROUP_TYPE' => $user->lang['GROUP_IS_' . $group_row['l_group_type']],
'GROUP_RANK' => $user_rank_data['title'],

				'GROUP_COLOR'	=> $group_row['group_colour'],
'GROUP_TYPE' => $user->lang['GROUP_IS_' . $group_row['l_group_type']],
'GROUP_RANK' => $user_rank_data['title'],

Line 1106Line 1187
				'RANK_IMG'		=> $user_rank_data['img'],
'RANK_IMG_SRC' => $user_rank_data['img_src'],


				'RANK_IMG'		=> $user_rank_data['img'],
'RANK_IMG_SRC' => $user_rank_data['img_src'],


				'U_PM'			=> ($auth->acl_get('u_sendpm') && $auth->acl_get('u_masspm_group') && $group_row['group_receive_pm'] && $config['allow_privmsg'] && $config['allow_mass_pm']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=compose&amp;g=' . $group_id) : '',)


				'U_PM'			=> ($auth->acl_get('u_sendpm') && $auth->acl_get('u_masspm_group') && $group_row['group_receive_pm'] && $config['allow_privmsg'] && $config['allow_mass_pm']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=compose&amp;g=' . $group_id) : '',
'U_MANAGE' => ($can_manage_group) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=ucp_groups&amp;mode=manage') : false,)

			);

$sql_select = ', ug.group_leader';

			);

$sql_select = ', ug.group_leader';

Line 1130Line 1212
		{
$order_by .= ', u.user_posts DESC';
}

		{
$order_by .= ', u.user_posts DESC';
}

 

/**
* Modify sql query data for members search
*
* @event core.memberlist_modify_sql_query_data
* @var string order_by SQL ORDER BY clause condition
* @var string sort_dir The sorting direction
* @var string sort_key The sorting key
* @var array sort_key_sql Arraty with the sorting conditions data
* @var string sql_from SQL FROM clause condition
* @var string sql_select SQL SELECT fields list
* @var string sql_where SQL WHERE clause condition
* @var string sql_where_data SQL WHERE clause additional conditions data
* @since 3.1.7-RC1
*/
$vars = array(
'order_by',
'sort_dir',
'sort_key',
'sort_key_sql',
'sql_from',
'sql_select',
'sql_where',
'sql_where_data',
);
extract($phpbb_dispatcher->trigger_event('core.memberlist_modify_sql_query_data', compact($vars)));


// Count the users ...


// Count the users ...

		if ($sql_where)
{

 
			$sql = 'SELECT COUNT(u.user_id) AS total_users
FROM ' . USERS_TABLE . " u$sql_from

			$sql = 'SELECT COUNT(u.user_id) AS total_users
FROM ' . USERS_TABLE . " u$sql_from

				WHERE u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ")

			WHERE " . $db->sql_in_set('u.user_type', $user_types) . "

				$sql_where";
$result = $db->sql_query($sql);
$total_users = (int) $db->sql_fetchfield('total_users');
$db->sql_freeresult($result);

				$sql_where";
$result = $db->sql_query($sql);
$total_users = (int) $db->sql_fetchfield('total_users');
$db->sql_freeresult($result);

		}
else
{
$total_users = $config['num_users'];
}

 

// Build a relevant pagination_url
$params = $sort_params = array();



// Build a relevant pagination_url
$params = $sort_params = array();


		// We do not use request_var() here directly to save some calls (not all variables are set)

		// We do not use $request->variable() here directly to save some calls (not all variables are set)

		$check_params = array(
'g' => array('g', 0),
'sk' => array('sk', $default_key),

		$check_params = array(
'g' => array('g', 0),
'sk' => array('sk', $default_key),

Line 1167Line 1268
			'count_select'	=> array('count_select', 'eq'),
'joined' => array('joined', ''),
'active' => array('active', ''),

			'count_select'	=> array('count_select', 'eq'),
'joined' => array('joined', ''),
'active' => array('active', ''),

			'count'			=> (request_var('count', '') !== '') ? array('count', 0) : array('count', ''),

			'count'			=> ($request->variable('count', '') !== '') ? array('count', 0) : array('count', ''),

			'ip'			=> array('ip', ''),
'first_char' => array('first_char', ''),
);

			'ip'			=> array('ip', ''),
'first_char' => array('first_char', ''),
);

Line 1180Line 1281
				continue;
}


				continue;
}


			$param = call_user_func_array('request_var', $call);
$param = urlencode($key) . '=' . ((is_string($param)) ? urlencode($param) : $param);


			$param = call_user_func_array(array($request, 'variable'), $call);
// Encode strings, convert everything else to int in order to prevent empty parameters.
$param = urlencode($key) . '=' . ((is_string($param)) ? urlencode($param) : (int) $param);

			$params[] = $param;

if ($key != 'first_char')

			$params[] = $param;

if ($key != 'first_char')

Line 1232Line 1334
		// Some search user specific data
if (($mode == '' || $mode == 'searchuser') && ($config['load_search'] || $auth->acl_get('a_')))
{

		// Some search user specific data
if (($mode == '' || $mode == 'searchuser') && ($config['load_search'] || $auth->acl_get('a_')))
{

			$group_selected = request_var('search_group_id', 0);

			$group_selected = $request->variable('search_group_id', 0);

			$s_group_select = '<option value="0"' . ((!$group_selected) ? ' selected="selected"' : '') . '>&nbsp;</option>';
$group_ids = array();


			$s_group_select = '<option value="0"' . ((!$group_selected) ? ' selected="selected"' : '') . '>&nbsp;</option>';
$group_ids = array();


Line 1276Line 1378
			while ($row = $db->sql_fetchrow($result))
{
$group_ids[] = $row['group_id'];

			while ($row = $db->sql_fetchrow($result))
{
$group_ids[] = $row['group_id'];

				$s_group_select .= '<option value="' . $row['group_id'] . '"' . (($group_selected == $row['group_id']) ? ' selected="selected"' : '') . '>' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';

				$s_group_select .= '<option value="' . $row['group_id'] . '"' . (($group_selected == $row['group_id']) ? ' selected="selected"' : '') . '>' . $group_helper->get_name($row['group_name']) . '</option>';

			}
$db->sql_freeresult($result);


			}
$db->sql_freeresult($result);


Line 1311Line 1413
			);
}


			);
}


		$start = $pagination->validate_start($start, $config['topics_per_page'], $config['num_users']);

		$start = $pagination->validate_start($start, $config['topics_per_page'], $total_users);


// Get us some users :D
$sql = "SELECT u.user_id
FROM " . USERS_TABLE . " u
$sql_from


// Get us some users :D
$sql = "SELECT u.user_id
FROM " . USERS_TABLE . " u
$sql_from

			WHERE u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ")

			WHERE " . $db->sql_in_set('u.user_type', $user_types) . "

				$sql_where
ORDER BY $order_by";
$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);

				$sql_where
ORDER BY $order_by";
$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);

Line 1332Line 1434
		// Load custom profile fields
if ($config['load_cpf_memberlist'])
{

		// Load custom profile fields
if ($config['load_cpf_memberlist'])
{

 
			/* @var $cp \phpbb\profilefields\manager */

			$cp = $phpbb_container->get('profilefields.manager');

$cp_row = $cp->generate_profile_fields_template_headlines('field_show_on_ml');

			$cp = $phpbb_container->get('profilefields.manager');

$cp_row = $cp->generate_profile_fields_template_headlines('field_show_on_ml');

Line 1413Line 1516
//				uasort($id_cache, create_function('$first, $second', "return (\$first['last_visit'] == \$second['last_visit']) ? 0 : ((\$first['last_visit'] < \$second['last_visit']) ? $lesser_than : ($lesser_than * -1));"));
usort($user_list, 'phpbb_sort_last_active');
}

//				uasort($id_cache, create_function('$first, $second', "return (\$first['last_visit'] == \$second['last_visit']) ? 0 : ((\$first['last_visit'] < \$second['last_visit']) ? $lesser_than : ($lesser_than * -1));"));
usort($user_list, 'phpbb_sort_last_active');
}

 

// do we need to display contact fields as such
$use_contact_fields = false;

/**
* Modify list of users before member row is created
*
* @event core.memberlist_memberrow_before
* @var array user_list Array containing list of users
* @var bool use_contact_fields Should we display contact fields as such?
* @since 3.1.7-RC1
*/
$vars = array('user_list', 'use_contact_fields');
extract($phpbb_dispatcher->trigger_event('core.memberlist_memberrow_before', compact($vars)));


for ($i = 0, $end = sizeof($user_list); $i < $end; ++$i)
{


for ($i = 0, $end = sizeof($user_list); $i < $end; ++$i)
{

Line 1424Line 1541
				$cp_row = array();
if ($config['load_cpf_memberlist'])
{

				$cp_row = array();
if ($config['load_cpf_memberlist'])
{

					$cp_row = (isset($profile_fields_cache[$user_id])) ? $cp->generate_profile_fields_template_data($profile_fields_cache[$user_id], false) : array();

					$cp_row = (isset($profile_fields_cache[$user_id])) ? $cp->generate_profile_fields_template_data($profile_fields_cache[$user_id], $use_contact_fields) : array();

				}

$memberrow = array_merge(phpbb_show_profile($row, false, false, false), array(

				}

$memberrow = array_merge(phpbb_show_profile($row, false, false, false), array(

Line 1432Line 1549

'S_CUSTOM_PROFILE' => (isset($cp_row['row']) && sizeof($cp_row['row'])) ? true : false,
'S_GROUP_LEADER' => $is_leader,


'S_CUSTOM_PROFILE' => (isset($cp_row['row']) && sizeof($cp_row['row'])) ? true : false,
'S_GROUP_LEADER' => $is_leader,

 
					'S_INACTIVE'		=> $row['user_type'] == USER_INACTIVE,


'U_VIEW_PROFILE' => get_username_string('profile', $user_id, $row['username']),
));


'U_VIEW_PROFILE' => get_username_string('profile', $user_id, $row['username']),
));

Line 1471Line 1589
			'U_HIDE_FIND_MEMBER'	=> ($mode == 'searchuser' || ($mode == '' && $submit)) ? $u_hide_find_member : '',
'U_LIVE_SEARCH' => ($config['allow_live_searches']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=livesearch') : false,
'U_SORT_USERNAME' => $sort_url . '&amp;sk=a&amp;sd=' . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a'),

			'U_HIDE_FIND_MEMBER'	=> ($mode == 'searchuser' || ($mode == '' && $submit)) ? $u_hide_find_member : '',
'U_LIVE_SEARCH' => ($config['allow_live_searches']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=livesearch') : false,
'U_SORT_USERNAME' => $sort_url . '&amp;sk=a&amp;sd=' . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a'),

			'U_SORT_JOINED'			=> $sort_url . '&amp;sk=c&amp;sd=' . (($sort_key == 'c' && $sort_dir == 'a') ? 'd' : 'a'),
'U_SORT_POSTS' => $sort_url . '&amp;sk=d&amp;sd=' . (($sort_key == 'd' && $sort_dir == 'a') ? 'd' : 'a'),
'U_SORT_EMAIL' => $sort_url . '&amp;sk=e&amp;sd=' . (($sort_key == 'e' && $sort_dir == 'a') ? 'd' : 'a'),
'U_SORT_ACTIVE' => ($auth->acl_get('u_viewonline')) ? $sort_url . '&amp;sk=l&amp;sd=' . (($sort_key == 'l' && $sort_dir == 'a') ? 'd' : 'a') : '',
'U_SORT_RANK' => $sort_url . '&amp;sk=m&amp;sd=' . (($sort_key == 'm' && $sort_dir == 'a') ? 'd' : 'a'),
'U_LIST_CHAR' => $sort_url . '&amp;sk=a&amp;sd=' . (($sort_key == 'l' && $sort_dir == 'a') ? 'd' : 'a'),

			'U_SORT_JOINED'			=> $sort_url . '&amp;sk=c&amp;sd=' . (($sort_key == 'c' && $sort_dir == 'd') ? 'a' : 'd'),
'U_SORT_POSTS' => $sort_url . '&amp;sk=d&amp;sd=' . (($sort_key == 'd' && $sort_dir == 'd') ? 'a' : 'd'),
'U_SORT_EMAIL' => $sort_url . '&amp;sk=e&amp;sd=' . (($sort_key == 'e' && $sort_dir == 'd') ? 'a' : 'd'),
'U_SORT_ACTIVE' => ($auth->acl_get('u_viewonline')) ? $sort_url . '&amp;sk=l&amp;sd=' . (($sort_key == 'l' && $sort_dir == 'd') ? 'a' : 'd') : '',
'U_SORT_RANK' => $sort_url . '&amp;sk=m&amp;sd=' . (($sort_key == 'm' && $sort_dir == 'd') ? 'a' : 'd'),
'U_LIST_CHAR' => $sort_url . '&amp;sk=a&amp;sd=' . (($sort_key == 'l' && $sort_dir == 'd') ? 'a' : 'd'),


'S_SHOW_GROUP' => ($mode == 'group') ? true : false,
'S_VIEWONLINE' => $auth->acl_get('u_viewonline'),


'S_SHOW_GROUP' => ($mode == 'group') ? true : false,
'S_VIEWONLINE' => $auth->acl_get('u_viewonline'),