Vergleich memberlist.php - 1.8.9 - 1.8.24

  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 38Zeile 38
{
$plugins->run_hooks("memberlist_search");
add_breadcrumb($lang->nav_memberlist_search);

{
$plugins->run_hooks("memberlist_search");
add_breadcrumb($lang->nav_memberlist_search);

 

$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' => $mybb->usergroup['usergroup'], 'additionalgroups' => $mybb->usergroup['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').'";');
}
}

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 55Zeile 79
	{
$mybb->input['sort'] = $mybb->settings['default_memberlist_sortby'];
}

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





	$sort_selected = array(
'regdate' => '',
'lastvisit' => '',

	$sort_selected = array(
'regdate' => '',
'lastvisit' => '',

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

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

			break;

			break;

		case "reputation":
$sort_field = "u.reputation";
break;
case "postnum":
$sort_field = "u.postnum";

		case "reputation":
$sort_field = "u.reputation";
break;
case "postnum":
$sort_field = "u.postnum";

			break;

			break;

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

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

			$sort_field = "u.referrals";
break;








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

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

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

Zeile 96Zeile 127
	if(isset($mybb->input['order']))
{
$mybb->input['order'] = strtolower($mybb->input['order']);

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

	}

	}

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

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

Zeile 120Zeile 151
		$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?
$mybb->input['perpage'] = $mybb->get_input('perpage', MyBB::INPUT_INT);


// Incoming results per page?
$mybb->input['perpage'] = $mybb->get_input('perpage', MyBB::INPUT_INT);

Zeile 130Zeile 166
	else if($mybb->settings['membersperpage'])
{
$per_page = $mybb->input['perpage'] = (int)$mybb->settings['membersperpage'];

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

	}

	}

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

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

Zeile 138Zeile 174

$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 148Zeile 194
			$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_like($letter)."%'";

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

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

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

Zeile 163Zeile 209
		// Name begins with
if($mybb->input['username_match'] == "begins")
{

		// Name begins with
if($mybb->input['username_match'] == "begins")
{

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

			$search_query .= " AND u.username {$like} '".$username_like_query."%'";

			$search_url .= "&username_match=begins";
}
// Just contains

			$search_url .= "&username_match=begins";
}
// Just contains

 
		else if($mybb->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."%'";

			$search_query .= " AND u.username='{$username_like_query}'";

		}

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

		}

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

Zeile 179Zeile 231
	$mybb->input['website'] = trim($mybb->get_input('website'));
$search_website = htmlspecialchars_uni($mybb->input['website']);
if(trim($mybb->input['website']))

	$mybb->input['website'] = trim($mybb->get_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 273
			}
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]);

		}
}

$usergroups_cache = $cache->read('usergroups');


		}
}

$usergroups_cache = $cache->read('usergroups');


	$group = array();
foreach($usergroups_cache as $gid => $groupcache)
{

	$group = array();
foreach($usergroups_cache as $gid => $groupcache)
{

Zeile 239Zeile 291
	}

if(is_array($group) && !empty($group))

	}

if(is_array($group) && !empty($group))

	{

	{

		$hiddengroup = implode(',', $group);

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

		$hiddengroup = implode(',', $group);

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

Zeile 271Zeile 323
	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
{

	}
else
{

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

// Get the display usergroup

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

// Get the display usergroup

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

		if($user['usergroup'])

		{

		{

			$user['displaygroup'] = $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'];
}

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

		}

		}

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

 

// 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")."\";");

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

 
			eval("\$referrals_option = \"".$templates->get("memberlist_referrals_option")."\";");

		}

$usergroup['groupimage'] = '';

		}

$usergroup['groupimage'] = '';

Zeile 406Zeile 488
		$useravatar = format_avatar($user['avatar'], $user['avatardimensions'], my_strtolower($mybb->settings['memberlistmaxavatarsize']));
eval("\$user['avatar'] = \"".$templates->get("memberlist_user_avatar")."\";");


		$useravatar = format_avatar($user['avatar'], $user['avatardimensions'], my_strtolower($mybb->settings['memberlistmaxavatarsize']));
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['regdate'] = my_date('relative', $user['regdate']);