当前位置: 首页>>代码示例>>PHP>>正文


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怎么用?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);
 }
开发者ID:CompositeUK,项目名称:clone.BuddyPress,代码行数:12,代码来源:class-bp-friends-friendship.php

示例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));
}
开发者ID:eresyyl,项目名称:mk,代码行数:23,代码来源:bp-friends-functions.php

示例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));
}
开发者ID:alvaropereyra,项目名称:shrekcms,代码行数:12,代码来源:bp-friends.php


注:本文中的BP_Friends_Friendship::search_users_count方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。