本文整理汇总了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));
}