Vergleich memberlist.php - 1.6.4 - 1.6.17

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: memberlist.php 5406 2011-03-20 01:01:18Z jammerx2 $

 * $Id$

 */

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


 */

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


$templatelist = "memberlist,memberlist_member,memberlist_search,memberlist_user,memberlist_user_groupimage,memberlist_user_avatar";
$templatelist .= ",postbit_www,postbit_email,multipage_nextpage,multipage_page_current,multipage_page,multipage_start,multipage_end,multipage,memberlist_referrals,memberlist_referrals_bit";

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

require_once "./global.php";

// Load global language phrases

require_once "./global.php";

// Load global language phrases

Zeile 38Zeile 38
{
$plugins->run_hooks("memberlist_search");
eval("\$search_page = \"".$templates->get("memberlist_search")."\";");

{
$plugins->run_hooks("memberlist_search");
eval("\$search_page = \"".$templates->get("memberlist_search")."\";");

	output_page($search_page);	

	output_page($search_page);

}
else
{

}
else
{

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

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

	



	switch($mybb->input['sort'])
{
case "regdate":
$sort_field = "u.regdate";

	switch($mybb->input['sort'])
{
case "regdate":
$sort_field = "u.regdate";

			break;

			break;

		case "lastvisit":
$sort_field = "u.lastactive";
break;

		case "lastvisit":
$sort_field = "u.lastactive";
break;

Zeile 78Zeile 78
			break;
case "referrals":
$sort_field = "u.referrals";

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

			break;

			break;

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

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

	}

	}

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

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

	



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

	// Incoming sort order?
if($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']);
}

	



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

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

	{

	{

		$sort_order = "ASC";
$mybb->input['order'] = "ascending";

		$sort_order = "ASC";
$mybb->input['order'] = "ascending";

	}
else
{

	}
else
{

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

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

	



	// Incoming results per page?
$mybb->input['perpage'] = intval($mybb->input['perpage']);
if($mybb->input['perpage'] > 0 && $mybb->input['perpage'] <= 500)

	// Incoming results per page?
$mybb->input['perpage'] = intval($mybb->input['perpage']);
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'])

	{
$per_page = $mybb->input['perpage'] = intval($mybb->settings['membersperpage']);

	{
$per_page = $mybb->input['perpage'] = intval($mybb->settings['membersperpage']);

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

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

	



	$search_query = '1=1';
$search_url = "memberlist.php?sort={$mybb->input['sort']}&order={$mybb->input['order']}&perpage={$mybb->input['perpage']}";

	$search_query = '1=1';
$search_url = "memberlist.php?sort={$mybb->input['sort']}&order={$mybb->input['order']}&perpage={$mybb->input['perpage']}";

	



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

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

Zeile 135Zeile 135
			$search_query .= " AND u.username NOT REGEXP('[a-zA-Z]')";
}
else if(strlen($letter) == 1)

			$search_query .= " AND u.username NOT REGEXP('[a-zA-Z]')";
}
else if(strlen($letter) == 1)

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

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

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

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

	}

	}


// Searching for a matching username
$search_username = htmlspecialchars_uni(trim($mybb->input['username']));


// Searching for a matching username
$search_username = htmlspecialchars_uni(trim($mybb->input['username']));

Zeile 168Zeile 168
	{
$search_query .= " AND u.website LIKE '%".$db->escape_string_like($mybb->input['website'])."%'";
$search_url .= "&website=".urlencode($mybb->input['website']);

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

	}


	}


	// AIM Identity
if(trim($mybb->input['aim']))
{

	// AIM Identity
if(trim($mybb->input['aim']))
{

Zeile 182Zeile 182
	{
$search_query .= " AND u.icq LIKE '%".$db->escape_string_like($mybb->input['icq'])."%'";
$search_url .= "&icq=".urlencode($mybb->input['icq']);

	{
$search_query .= " AND u.icq LIKE '%".$db->escape_string_like($mybb->input['icq'])."%'";
$search_url .= "&icq=".urlencode($mybb->input['icq']);

	}

	}


// MSN/Windows Live Messenger address
if(trim($mybb->input['msn']))


// MSN/Windows Live Messenger address
if(trim($mybb->input['msn']))

	{

	{

		$search_query .= " AND u.msn LIKE '%".$db->escape_string_like($mybb->input['msn'])."%'";
$search_url .= "&msn=".urlencode($mybb->input['msn']);
}

		$search_query .= " AND u.msn LIKE '%".$db->escape_string_like($mybb->input['msn'])."%'";
$search_url .= "&msn=".urlencode($mybb->input['msn']);
}

Zeile 203Zeile 203

$page = intval($mybb->input['page']);
if($page && $page > 0)


$page = intval($mybb->input['page']);
if($page && $page > 0)

	{

	{

		$start = ($page - 1) * $per_page;
}
else

		$start = ($page - 1) * $per_page;
}
else

Zeile 213Zeile 213
	}
$search_url = htmlspecialchars_uni($search_url);
$multipage = multipage($num_users, $per_page, $page, $search_url);

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

	



	// Cache a few things
$usergroups_cache = $cache->read('usergroups');
$query = $db->simple_select("usertitles", "*", "", array('order_by' => 'posts', 'order_dir' => 'DESC'));

	// Cache a few things
$usergroups_cache = $cache->read('usergroups');
$query = $db->simple_select("usertitles", "*", "", array('order_by' => 'posts', 'order_dir' => 'DESC'));

Zeile 231Zeile 231
	");
while($user = $db->fetch_array($query))
{

	");
while($user = $db->fetch_array($query))
{

		$plugins->run_hooks("memberlist_user");






		$user = $plugins->run_hooks("memberlist_user", $user);
if(!$user['username'])
{
continue;
}


		$alt_bg = alt_trow();

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

		$alt_bg = alt_trow();

$user['username'] = format_name($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
if(!$user['displaygroup'])

		// Get the display usergroup
if(!$user['displaygroup'])

		{

		{

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

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

Zeile 249Zeile 254
		if($mybb->settings['usereferrals'] == 1)
{
eval("\$referral_bit = \"".$templates->get("memberlist_referrals_bit")."\";");

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

		}


		}


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

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

Zeile 265Zeile 270
			$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")."\";");

			$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 = 0;
if(trim($user['usertitle']) != "")
{

Zeile 274Zeile 279
		}

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

		}

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

		{

		{

			$user['usertitle'] = $usergroup['usertitle'];
}
elseif(is_array($usertitles_cache) && !$usergroup['usertitle'])

			$user['usertitle'] = $usergroup['usertitle'];
}
elseif(is_array($usertitles_cache) && !$usergroup['usertitle'])

Zeile 300Zeile 305
		}

if(!$user['starimage'])

		}

if(!$user['starimage'])

		{

		{

			$user['starimage'] = $usergroup['starimage'];
}

			$user['starimage'] = $usergroup['starimage'];
}

		



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

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





			for($i = 0; $i < $user['stars']; ++$i)
{
$user['userstars'] .= "<img src=\"{$starimage}\" border=\"0\" alt=\"*\" />";

			for($i = 0; $i < $user['stars']; ++$i)
{
$user['userstars'] .= "<img src=\"{$starimage}\" border=\"0\" alt=\"*\" />";

			}
}

			}
}


if($user['userstars'] && $usergroup['groupimage'])
{
$user['userstars'] = "<br />".$user['userstars'];
}


if($user['userstars'] && $usergroup['groupimage'])
{
$user['userstars'] = "<br />".$user['userstars'];
}

	



		// Show avatar
if($user['avatar'] != '')

		// Show avatar
if($user['avatar'] != '')

		{

		{

			$user['avatar'] = htmlspecialchars_uni($user['avatar']);
$avatar_dimensions = explode("|", $user['avatardimensions']);

			$user['avatar'] = htmlspecialchars_uni($user['avatar']);
$avatar_dimensions = explode("|", $user['avatardimensions']);

			



			if($avatar_dimensions[0] && $avatar_dimensions[1])
{
list($max_width, $max_height) = explode("x", my_strtolower($mybb->settings['memberlistmaxavatarsize']));

			if($avatar_dimensions[0] && $avatar_dimensions[1])
{
list($max_width, $max_height) = explode("x", my_strtolower($mybb->settings['memberlistmaxavatarsize']));

Zeile 338Zeile 343
				}
else
{

				}
else
{

					$avatar_width_height = "width=\"{$avatar_dimensions[0]}\" height=\"{$avatar_dimensions[1]}\"";	

					$avatar_width_height = "width=\"{$avatar_dimensions[0]}\" height=\"{$avatar_dimensions[1]}\"";

				}
}

				}
}

			



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

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

		}		


		}


		$user['regdate'] = my_date($mybb->settings['dateformat'], $user['regdate']).", ".my_date($mybb->settings['timeformat'], $user['regdate']);
$user['lastvisit'] = my_date($mybb->settings['dateformat'], $user['lastactive']).", ".my_date($mybb->settings['timeformat'], $user['lastactive']);
$user['postnum'] = my_number_format($user['postnum']);

		$user['regdate'] = my_date($mybb->settings['dateformat'], $user['regdate']).", ".my_date($mybb->settings['timeformat'], $user['regdate']);
$user['lastvisit'] = my_date($mybb->settings['dateformat'], $user['lastactive']).", ".my_date($mybb->settings['timeformat'], $user['lastactive']);
$user['postnum'] = my_number_format($user['postnum']);