本文整理匯總了PHP中BP_Core_User::get_alphabetical_users方法的典型用法代碼示例。如果您正苦於以下問題:PHP BP_Core_User::get_alphabetical_users方法的具體用法?PHP BP_Core_User::get_alphabetical_users怎麽用?PHP BP_Core_User::get_alphabetical_users使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類BP_Core_User
的用法示例。
在下文中一共展示了BP_Core_User::get_alphabetical_users方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: bp_core_members_template
function bp_core_members_template($type, $per_page, $max)
{
global $bp, $bp_the_member_query;
$this->pag_page = isset($_REQUEST['upage']) ? intval($_REQUEST['upage']) : 1;
$this->pag_num = isset($_REQUEST['num']) ? intval($_REQUEST['num']) : $per_page;
if (isset($_REQUEST['s']) && '' != $_REQUEST['s'] && $type != 'random') {
$this->members = BP_Core_User::search_users($_REQUEST['s'], $this->pag_num, $this->pag_page);
} else {
if (isset($_REQUEST['letter']) && '' != $_REQUEST['letter']) {
$this->members = BP_Core_User::get_users_by_letter($_REQUEST['letter'], $this->pag_num, $this->pag_page);
} else {
switch ($type) {
case 'random':
$this->members = BP_Core_User::get_random_users($this->pag_num, $this->pag_page);
break;
case 'newest':
$this->members = BP_Core_User::get_newest_users($this->pag_num, $this->pag_page);
break;
case 'popular':
$this->members = BP_Core_User::get_popular_users($this->pag_num, $this->pag_page);
break;
case 'online':
$this->members = BP_Core_User::get_online_users($this->pag_num, $this->pag_page);
break;
case 'alphabetical':
$this->members = BP_Core_User::get_alphabetical_users($this->pag_num, $this->pag_page);
break;
case 'active':
default:
$this->members = BP_Core_User::get_active_users($this->pag_num, $this->pag_page);
break;
}
}
}
if (!$max) {
$this->total_member_count = (int) $this->members['total'];
} else {
$this->total_member_count = (int) $max;
}
$this->members = $this->members['users'];
if ($max) {
if ($max >= count($this->members)) {
$this->member_count = count($this->members);
} else {
$this->member_count = (int) $max;
}
} else {
$this->member_count = count($this->members);
}
$this->pag_links = paginate_links(array('base' => add_query_arg('upage', '%#%'), 'format' => '', 'total' => ceil((int) $this->total_member_count / (int) $this->pag_num), 'current' => (int) $this->pag_page, 'prev_text' => '«', 'next_text' => '»', 'mid_size' => 1));
}