Vergleich memberlist.php - 1.8.3 - 1.8.27

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 11Zeile 11
define("IN_MYBB", 1);
define('THIS_SCRIPT', 'memberlist.php');


define("IN_MYBB", 1);
define('THIS_SCRIPT', 'memberlist.php');


$templatelist = "memberlist,memberlist_search,memberlist_user,memberlist_user_groupimage,memberlist_user_avatar,memberlist_user_userstar";
$templatelist .= ",multipage,multipage_end,multipage_jump_page,multipage_nextpage,multipage_page,multipage_page_current,multipage_page_link_current,multipage_prevpage,multipage_start,memberlist_referrals,memberlist_referrals_bit,memberlist_error,memberlist_orderarrow";

$templatelist = "memberlist,memberlist_search,memberlist_user,memberlist_user_groupimage,memberlist_user_avatar,memberlist_user_userstar,memberlist_search_contact_field,memberlist_referrals,memberlist_referrals_bit";
$templatelist .= ",multipage,multipage_end,multipage_jump_page,multipage_nextpage,multipage_page,multipage_page_current,multipage_page_link_current,multipage_prevpage,multipage_start,memberlist_error,memberlist_orderarrow";


require_once "./global.php";



require_once "./global.php";


Zeile 32Zeile 32
{
error_no_permission();
}

{
error_no_permission();
}

 

$orderarrow = $sort_selected = array(
'regdate' => '',
'lastvisit' => '',
'reputation' => '',
'postnum' => '',
'threadnum' => '',
'referrals' => '',
'username' => ''
);


// Showing advanced search page?
if($mybb->get_input('action') == "search")
{
$plugins->run_hooks("memberlist_search");
add_breadcrumb($lang->nav_memberlist_search);


// Showing advanced search page?
if($mybb->get_input('action') == "search")
{
$plugins->run_hooks("memberlist_search");
add_breadcrumb($lang->nav_memberlist_search);

 

if(isset($mybb->usergroup['usergroup']))
{
$usergroup = $mybb->usergroup['usergroup'];
}
else
{
$usergroup = '';
}
if(isset($mybb->usergroup['additionalgroups']))
{
$additionalgroups = $mybb->usergroup['additionalgroups'];
}
else
{
$additionalgroups = '';
}

$contact_fields = array();
foreach(array('skype', 'google', 'icq') as $field)
{
$contact_fields[$field] = '';
$settingkey = 'allow'.$field.'field';

if($mybb->settings[$settingkey] != '' && is_member($mybb->settings[$settingkey], array('usergroup' => $usergroup, 'additionalgroups' => $additionalgroups)))
{
$tmpl = 'memberlist_search_'.$field;

$lang_string = 'search_'.$field;
$lang_string = $lang->{$lang_string};

$bgcolors[$field] = alt_trow();
eval('$contact_fields[\''.$field.'\'] = "'.$templates->get('memberlist_search_contact_field').'";');
}
}

$referrals_option = '';
if($mybb->settings['usereferrals'] == 1)
{
eval("\$referrals_option = \"".$templates->get("memberlist_referrals_option")."\";");
}


	eval("\$search_page = \"".$templates->get("memberlist_search")."\";");
output_page($search_page);
}

	eval("\$search_page = \"".$templates->get("memberlist_search")."\";");
output_page($search_page);
}

Zeile 50Zeile 102
	if(isset($mybb->input['sort']))
{
$mybb->input['sort'] = strtolower($mybb->get_input('sort'));

	if(isset($mybb->input['sort']))
{
$mybb->input['sort'] = strtolower($mybb->get_input('sort'));

	}

	}

	else
{
$mybb->input['sort'] = $mybb->settings['default_memberlist_sortby'];
}

	else
{
$mybb->input['sort'] = $mybb->settings['default_memberlist_sortby'];
}


$sort_selected = array(
'regdate' => '',
'lastvisit' => '',
'reputation' => '',
'postnum' => '',
'referrals' => '',
'username' => ''
);

 

switch($mybb->input['sort'])
{


switch($mybb->input['sort'])
{

Zeile 83Zeile 126
			$sort_field = "u.threadnum";
break;
case "referrals":

			$sort_field = "u.threadnum";
break;
case "referrals":

			$sort_field = "u.referrals";








			if($mybb->settings['usereferrals'] == 1)
{
$sort_field = "u.referrals";
}
else
{
$sort_field = "u.username";
}

			break;
default:
$sort_field = "u.username";
$mybb->input['sort'] = 'username';

			break;
default:
$sort_field = "u.username";
$mybb->input['sort'] = 'username';

			break;

			break;

	}
$sort_selected[$mybb->input['sort']] = " selected=\"selected\"";

// Incoming sort order?
if(isset($mybb->input['order']))

	}
$sort_selected[$mybb->input['sort']] = " selected=\"selected\"";

// Incoming sort order?
if(isset($mybb->input['order']))

	{

	{

		$mybb->input['order'] = strtolower($mybb->input['order']);
}
else
{
$mybb->input['order'] = strtolower($mybb->settings['default_memberlist_order']);

		$mybb->input['order'] = strtolower($mybb->input['order']);
}
else
{
$mybb->input['order'] = strtolower($mybb->settings['default_memberlist_order']);

	}

	}


$order_check = array('ascending' => '', 'descending' => '');
if($mybb->input['order'] == "ascending" || (!$mybb->input['order'] && $mybb->input['sort'] == 'username'))


$order_check = array('ascending' => '', 'descending' => '');
if($mybb->input['order'] == "ascending" || (!$mybb->input['order'] && $mybb->input['sort'] == 'username'))

Zeile 110Zeile 160
		$oppsort = $lang->desc;
$oppsortnext = "descending";
$mybb->input['order'] = "ascending";

		$oppsort = $lang->desc;
$oppsortnext = "descending";
$mybb->input['order'] = "ascending";

	}
else

	}
else

	{
$sort_order = "DESC";
$sortordernow = "descending";

	{
$sort_order = "DESC";
$sortordernow = "descending";

Zeile 120Zeile 170
		$mybb->input['order'] = "descending";
}
$order_check[$mybb->input['order']] = " checked=\"checked\"";

		$mybb->input['order'] = "descending";
}
$order_check[$mybb->input['order']] = " checked=\"checked\"";

 

if($sort_field == 'u.lastactive' && $mybb->usergroup['canviewwolinvis'] == 0)
{
$sort_field = "u.invisible ASC, CASE WHEN u.invisible = 1 THEN u.regdate ELSE u.lastactive END";
}


// Incoming results per page?


// Incoming results per page?

	$mybb->input['perpage'] = $mybb->get_input('perpage', 1);

	$mybb->input['perpage'] = $mybb->get_input('perpage', MyBB::INPUT_INT);

	if($mybb->input['perpage'] > 0 && $mybb->input['perpage'] <= 500)

	if($mybb->input['perpage'] > 0 && $mybb->input['perpage'] <= 500)

	{

	{

		$per_page = $mybb->input['perpage'];
}
else if($mybb->settings['membersperpage'])

		$per_page = $mybb->input['perpage'];
}
else if($mybb->settings['membersperpage'])

Zeile 134Zeile 189
	else
{
$per_page = $mybb->input['perpage'] = 20;

	else
{
$per_page = $mybb->input['perpage'] = 20;

	}


	}


	$search_query = '1=1';
$search_url = "";

	$search_query = '1=1';
$search_url = "";

 

switch($db->type)
{
// PostgreSQL's LIKE is case sensitive
case "pgsql":
$like = "ILIKE";
break;
default:
$like = "LIKE";
}


// Limiting results to a certain letter
if(isset($mybb->input['letter']))


// Limiting results to a certain letter
if(isset($mybb->input['letter']))

Zeile 146Zeile 211
		if($mybb->input['letter'] == -1)
{
$search_query .= " AND u.username NOT REGEXP('[a-zA-Z]')";

		if($mybb->input['letter'] == -1)
{
$search_query .= " AND u.username NOT REGEXP('[a-zA-Z]')";

		}

		}

		else if(strlen($letter) == 1)

		else if(strlen($letter) == 1)

		{
$search_query .= " AND u.username LIKE '".$db->escape_string_like($letter)."%'";
}

		{
$search_query .= " AND u.username {$like} '".$db->escape_string_like($letter)."%'";
}

		$search_url .= "&letter={$letter}";
}


		$search_url .= "&letter={$letter}";
}


Zeile 161Zeile 226
		$username_like_query = $db->escape_string_like($search_username);

// Name begins with

		$username_like_query = $db->escape_string_like($search_username);

// Name begins with

		if($mybb->input['username_match'] == "begins")
{
$search_query .= " AND u.username LIKE '".$username_like_query."%'";

		if($mybb->get_input('username_match') == "begins")
{
$search_query .= " AND u.username {$like} '".$username_like_query."%'";

			$search_url .= "&username_match=begins";

			$search_url .= "&username_match=begins";

		}

		}

		// Just contains

		// Just contains

 
		else if($mybb->get_input('username_match') == "contains")
{
$search_query .= " AND u.username {$like} '%".$username_like_query."%'";
$search_url .= "&username_match=contains";
}
// Exact

		else
{

		else
{

			$search_query .= " AND u.username LIKE '%".$username_like_query."%'";


			$username_esc = $db->escape_string(my_strtolower($search_username));
$search_query .= " AND LOWER(u.username)='{$username_esc}'";

		}

$search_url .= "&username=".urlencode($search_username);

		}

$search_url .= "&username=".urlencode($search_username);

Zeile 180Zeile 252
	$search_website = htmlspecialchars_uni($mybb->input['website']);
if(trim($mybb->input['website']))
{

	$search_website = htmlspecialchars_uni($mybb->input['website']);
if(trim($mybb->input['website']))
{

		$search_query .= " AND u.website LIKE '%".$db->escape_string_like($mybb->input['website'])."%'";

		$search_query .= " AND u.website {$like} '%".$db->escape_string_like($mybb->input['website'])."%'";

		$search_url .= "&website=".urlencode($mybb->input['website']);
}

// Search by contact field input

		$search_url .= "&website=".urlencode($mybb->input['website']);
}

// Search by contact field input

	foreach(array('aim', 'icq', 'google', 'skype', 'yahoo') as $cfield)

	foreach(array('icq', 'google', 'skype') as $cfield)

	{
$csetting = 'allow'.$cfield.'field';
$mybb->input[$cfield] = trim($mybb->get_input($cfield));

	{
$csetting = 'allow'.$cfield.'field';
$mybb->input[$cfield] = trim($mybb->get_input($cfield));

Zeile 221Zeile 293
			}
else
{

			}
else
{

				$search_query .= " AND u.{$cfield} LIKE '%".$db->escape_string_like($mybb->input[$cfield])."%'";

				$search_query .= " AND u.{$cfield} {$like} '%".$db->escape_string_like($mybb->input[$cfield])."%'";

			}
$search_url .= "&{$cfield}=".urlencode($mybb->input[$cfield]);
}

			}
$search_url .= "&{$cfield}=".urlencode($mybb->input[$cfield]);
}

Zeile 235Zeile 307
		if($groupcache['showmemberlist'] == 0)
{
$group[] = (int)$gid;

		if($groupcache['showmemberlist'] == 0)
{
$group[] = (int)$gid;

		}

		}

	}

if(is_array($group) && !empty($group))
{
$hiddengroup = implode(',', $group);

	}

if(is_array($group) && !empty($group))
{
$hiddengroup = implode(',', $group);





		$search_query .= " AND u.usergroup NOT IN ({$hiddengroup})";

foreach($group as $hidegid)

		$search_query .= " AND u.usergroup NOT IN ({$hiddengroup})";

foreach($group as $hidegid)

Zeile 267Zeile 339
	$query = $db->simple_select("users u", "COUNT(*) AS users", "{$search_query}");
$num_users = $db->fetch_field($query, "users");


	$query = $db->simple_select("users u", "COUNT(*) AS users", "{$search_query}");
$num_users = $db->fetch_field($query, "users");


	$page = $mybb->get_input('page', 1);

	$page = $mybb->get_input('page', MyBB::INPUT_INT);

	if($page && $page > 0)
{
$start = ($page - 1) * $per_page;

	if($page && $page > 0)
{
$start = ($page - 1) * $per_page;

	}







		$pages = ceil($num_users / $per_page);
if($page > $pages)
{
$start = 0;
$page = 1;
}
}

	else
{
$start = 0;
$page = 1;
}

	else
{
$start = 0;
$page = 1;
}





	$sort = htmlspecialchars_uni($mybb->input['sort']);
eval("\$orderarrow['{$sort}'] = \"".$templates->get("memberlist_orderarrow")."\";");

// Referral?

	$sort = htmlspecialchars_uni($mybb->input['sort']);
eval("\$orderarrow['{$sort}'] = \"".$templates->get("memberlist_orderarrow")."\";");

// Referral?

	if($mybb->settings['usereferrals'] == 1)

	if($mybb->settings['usereferrals'] == 1)

	{
$colspan = 7;
eval("\$referral_header = \"".$templates->get("memberlist_referrals")."\";");

	{
$colspan = 7;
eval("\$referral_header = \"".$templates->get("memberlist_referrals")."\";");

	}

$multipage = multipage($num_users, $per_page, $page, $search_url);

	}

$multipage = multipage($num_users, $per_page, $page, $search_url);


// Cache a few things
$usertitles = $cache->read('usertitles');
$usertitles_cache = array();
foreach($usertitles as $usertitle)


// Cache a few things
$usertitles = $cache->read('usertitles');
$usertitles_cache = array();
foreach($usertitles as $usertitle)

	{

	{

		$usertitles_cache[$usertitle['posts']] = $usertitle;
}
$users = '';

		$usertitles_cache[$usertitle['posts']] = $usertitle;
}
$users = '';

Zeile 311Zeile 389
		$user = $plugins->run_hooks("memberlist_user", $user);

$alt_bg = alt_trow();

		$user = $plugins->run_hooks("memberlist_user", $user);

$alt_bg = alt_trow();


$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);



$user['username'] = format_name(htmlspecialchars_uni($user['username']), $user['usergroup'], $user['displaygroup']);


		$user['profilelink'] = build_profile_link($user['username'], $user['uid']);

		$user['profilelink'] = build_profile_link($user['username'], $user['uid']);





		// Get the display usergroup

		// Get the display usergroup

		if(empty($user['displaygroup']))












		if($user['usergroup'])
{
$usergroup = usergroup_permissions($user['usergroup']);
}
else
{
$usergroup = usergroup_permissions(1);
}

$displaygroupfields = array("title", "description", "namestyle", "usertitle", "stars", "starimage", "image");

if(!$user['displaygroup'])

		{
$user['displaygroup'] = $user['usergroup'];

		{
$user['displaygroup'] = $user['usergroup'];

		}
$usergroup = $usergroups_cache[$user['displaygroup']];







		}

$display_group = usergroup_displaygroup($user['displaygroup']);
if(is_array($display_group))
{
$usergroup = array_merge($usergroup, $display_group);
}


		// Build referral?
if($mybb->settings['usereferrals'] == 1)
{

		// Build referral?
if($mybb->settings['usereferrals'] == 1)
{

 
			$referral_count = (int) $user['referrals'];
if($referral_count > 0)
{
$uid = (int) $user['uid'];
eval("\$user['referrals'] = \"".$templates->get('member_referrals_link')."\";");
}


			eval("\$referral_bit = \"".$templates->get("memberlist_referrals_bit")."\";");
}

$usergroup['groupimage'] = '';
// Work out the usergroup/title stuff
if(!empty($usergroup['image']))

			eval("\$referral_bit = \"".$templates->get("memberlist_referrals_bit")."\";");
}

$usergroup['groupimage'] = '';
// Work out the usergroup/title stuff
if(!empty($usergroup['image']))

		{

		{

			if(!empty($mybb->user['language']))
{
$language = $mybb->user['language'];
}
else

			if(!empty($mybb->user['language']))
{
$language = $mybb->user['language'];
}
else

			{

			{

				$language = $mybb->settings['bblanguage'];
}
$usergroup['image'] = str_replace("{lang}", $language, $usergroup['image']);
$usergroup['image'] = str_replace("{theme}", $theme['imgdir'], $usergroup['image']);
eval("\$usergroup['groupimage'] = \"".$templates->get("memberlist_user_groupimage")."\";");

				$language = $mybb->settings['bblanguage'];
}
$usergroup['image'] = str_replace("{lang}", $language, $usergroup['image']);
$usergroup['image'] = str_replace("{theme}", $theme['imgdir'], $usergroup['image']);
eval("\$usergroup['groupimage'] = \"".$templates->get("memberlist_user_groupimage")."\";");

		}

		}


$has_custom_title = 0;
if(trim($user['usertitle']) != "")
{
$has_custom_title = 1;


$has_custom_title = 0;
if(trim($user['usertitle']) != "")
{
$has_custom_title = 1;

		}

		}


if($usergroup['usertitle'] != "" && !$has_custom_title)
{
$user['usertitle'] = $usergroup['usertitle'];


if($usergroup['usertitle'] != "" && !$has_custom_title)
{
$user['usertitle'] = $usergroup['usertitle'];

		}

		}

		elseif(is_array($usertitles_cache) && !$usergroup['usertitle'])
{
foreach($usertitles_cache as $posts => $titleinfo)

		elseif(is_array($usertitles_cache) && !$usergroup['usertitle'])
{
foreach($usertitles_cache as $posts => $titleinfo)

Zeile 378Zeile 479
		if(!empty($usergroup['stars']))
{
$user['stars'] = $usergroup['stars'];

		if(!empty($usergroup['stars']))
{
$user['stars'] = $usergroup['stars'];

		}


		}


		if(empty($user['starimage']))
{
$user['starimage'] = $usergroup['starimage'];

		if(empty($user['starimage']))
{
$user['starimage'] = $usergroup['starimage'];

		}


		}


		$user['userstars'] = '';

		$user['userstars'] = '';

		if(!empty($user['starimage']))

		if(!empty($user['starimage']) && isset($user['stars']))

		{
// Only display stars if we have an image to use...
$starimage = str_replace("{theme}", $theme['imgdir'], $user['starimage']);

		{
// Only display stars if we have an image to use...
$starimage = str_replace("{theme}", $theme['imgdir'], $user['starimage']);

Zeile 403Zeile 504
		}

// Show avatar

		}

// Show avatar

		$useravatar = format_avatar(htmlspecialchars_uni($user['avatar']), $user['avatardimensions'], my_strtolower($mybb->settings['memberlistmaxavatarsize']));

		$useravatar = format_avatar($user['avatar'], $user['avatardimensions'], my_strtolower($mybb->settings['memberlistmaxavatarsize']));

		eval("\$user['avatar'] = \"".$templates->get("memberlist_user_avatar")."\";");


		eval("\$user['avatar'] = \"".$templates->get("memberlist_user_avatar")."\";");


		if($user['invisible'] == 1 && $mybb->usergroup['canviewwolinvis'] != 1 && $user['uid'] != $mybb->user['uid'])


		$last_seen = max(array($user['lastactive'], $user['lastvisit']));
if(empty($last_seen))

		{
$user['lastvisit'] = $lang->lastvisit_never;

		{
$user['lastvisit'] = $lang->lastvisit_never;


if($user['lastvisit'])
{
// We have had at least some active time, hide it instead
$user['lastvisit'] = $lang->lastvisit_hidden;
}

 
		}
else
{

		}
else
{

			$user['lastvisit'] = my_date('relative', $user['lastactive']);









			// We have some stamp here
if($user['invisible'] == 1 && $mybb->usergroup['canviewwolinvis'] != 1 && $user['uid'] != $mybb->user['uid'])
{
$user['lastvisit'] = $lang->lastvisit_hidden;
}
else
{
$user['lastvisit'] = my_date('relative', $last_seen);
}

		}

$user['regdate'] = my_date('relative', $user['regdate']);
$user['postnum'] = my_number_format($user['postnum']);
$user['threadnum'] = my_number_format($user['threadnum']);
eval("\$users .= \"".$templates->get("memberlist_user")."\";");

		}

$user['regdate'] = my_date('relative', $user['regdate']);
$user['postnum'] = my_number_format($user['postnum']);
$user['threadnum'] = my_number_format($user['threadnum']);
eval("\$users .= \"".$templates->get("memberlist_user")."\";");

	}


	}


	// Do we have no results?
if(!$users)

	// Do we have no results?
if(!$users)

	{

	{

		eval("\$users = \"".$templates->get("memberlist_error")."\";");

		eval("\$users = \"".$templates->get("memberlist_error")."\";");

 
	}

$referrals_option = '';
if($mybb->settings['usereferrals'] == 1)
{
eval("\$referrals_option = \"".$templates->get("memberlist_referrals_option")."\";");

	}

$plugins->run_hooks("memberlist_end");

	}

$plugins->run_hooks("memberlist_end");