本文整理汇总了PHP中BP_Friends_Friendship::search_users_count方法的典型用法代码示例。如果您正苦于以下问题:PHP BP_Friends_Friendship::search_users_count方法的具体用法?PHP BP_Friends_Friendship::search_users_count怎么用?PHP BP_Friends_Friendship::search_users_count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BP_Friends_Friendship
的用法示例。
在下文中一共展示了BP_Friends_Friendship::search_users_count方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_search_users_count
public function test_search_users_count()
{
$u1 = $this->factory->user->create();
$u2 = $this->factory->user->create();
$u3 = $this->factory->user->create();
xprofile_set_field_data(1, $u1, 'Freedom Isn\'t Free');
xprofile_set_field_data(1, $u2, 'Cool Dude');
xprofile_set_field_data(1, $u3, 'Rock And Roll America Yeah');
// Needs a user_id param though it does nothing
$friends = BP_Friends_Friendship::search_users_count('Coo');
$this->assertEquals(1, $friends);
}
示例2: friends_search_users
/**
* Return a list of a user's friends, filtered by a search term.
*
* @param string $search_terms Search term to filter on.
* @param int $user_id ID of the user whose friends are being searched.
* @param int $pag_num Number of results to return per page. Default: 0 (no
* pagination - show all results).
* @param int $pag_num Number of the page being requested. Default: 0 (no
* pagination - show all results).
* @return array Array of BP_Core_User objects corresponding to friends.
*/
function friends_search_users($search_terms, $user_id, $pag_num = 0, $pag_page = 0)
{
$user_ids = BP_Friends_Friendship::search_users($search_terms, $user_id, $pag_num, $pag_page);
if (empty($user_ids)) {
return false;
}
$users = array();
for ($i = 0, $count = count($user_ids); $i < $count; ++$i) {
$users[] = new BP_Core_User($user_ids[$i]);
}
return array('users' => $users, 'count' => BP_Friends_Friendship::search_users_count($search_terms));
}
示例3: friends_search_users
function friends_search_users($search_terms, $user_id, $pag_num = false, $pag_page = false)
{
global $bp;
$user_ids = BP_Friends_Friendship::search_users($search_terms, $user_id, $pag_num, $pag_page);
if (!$user_ids) {
return false;
}
for ($i = 0; $i < count($user_ids); $i++) {
$users[] = new BP_Core_User($user_ids[$i]);
}
return array('users' => $users, 'count' => BP_Friends_Friendship::search_users_count($search_terms));
}