bilateral() 공개 메소드

对应API:{@link http://open.weibo.com/wiki/2/friendships/friends/bilateral friendships/friends/bilateral}
public bilateral ( integer $uid, integer $page = 1, integer $count = 50, integer $sort ) : array
$uid integer 需要获取双向关注列表的用户UID。
$page integer 返回结果的页码,默认为1。
$count integer 单页返回的记录条数,默认为50。
$sort integer 排序类型,0:按关注时间最近排序,默认为0。
리턴 array
예제 #1
0
파일: sina.php 프로젝트: kid2682/SMZDM
 /**
  * 获取好友列表 
  */
 public function getFriends($bind_user, $page, $count)
 {
     $info = unserialize($bind_user['info']);
     $client = new SaeTClientV2($this->setting['app_key'], $this->setting['app_secret'], $info['access_token']);
     $res = $client->bilateral($bind_user['keyid'], $page, $count);
     $friends = $users = array();
     foreach ($res['users'] as $u) {
         $users[] = array('id' => $u['id'], 'sid' => $u['screen_name'], 'name' => $u['name'], 'avatar' => $u['profile_image_url']);
     }
     $friends['users'] = $users;
     $friends['total_number'] = $res['total_number'];
     return $friends;
 }
예제 #2
0
 /**
  * 获取分享弹出框html,同时需要读取用户相互关注粉丝
  */
 function ajax_share_content()
 {
     $id = @$GLOBALS['G']['url_args'][0];
     if (empty($id)) {
         exit;
     }
     $_SESSION['share_id'] = $id;
     if (@$_SESSION['islogined']) {
         $token = ck::get('token');
         $c = new SaeTClientV2(Sconfig::$weibo['APPKEY'], Sconfig::$weibo['APPSECRET'], $token['access_token']);
         //TODO: 获取用户互相关注用户列表
         $friends = $c->bilateral($token['uid'], 1, 100);
         $this->friends = $friends['users'];
         $ext_info = gClass('ExtStorage')->find_one($id);
         $detailpicArr = json_decode($ext_info['descpic'], true);
         $ext_info['detailpic'] = $detailpicArr[0];
         $this->ext_info = $ext_info;
         //授权用户详细信息
         $userinfo = $c->show_user_by_id($token['uid']);
         //取得微博发布内容
         require SITE_PATH . 'include/weibo_content.php';
         $this->weibo_content = rand_content($cfg_content, $this->ext_info);
         $nick = !empty($userinfo['screen_name']) ? $userinfo['screen_name'] : $userinfo['name'];
         exit(json_encode(array('status' => 'success', 'html' => $this->display('extensions/share.html', false), 'nick' => $nick)));
     }
     exit(json_encode(array('status' => 'error', 'msg' => '未登录')));
 }
예제 #3
0
파일: css8.php 프로젝트: robertniu/php
    $idgenderimg = "<em class=\"W_ico12 female\" title=\"女\"></em>";
}
if ($user_message['gender'] == "f") {
    $idgender = "m";
    $idgenderimg = "<em class=\"W_ico12 male\" title=\"男\"></em>";
}
if ($totalbill < 200) {
    $page_a = 1;
}
if ($totalbill % 200) {
    $page_a = (int) ($totalbill / 200) + 1;
} else {
    $page_a = $totalbill / 200;
}
for ($page_b = 1; $page_b <= $page_a; $page_b++) {
    $f_byid = $c->bilateral($uid, $page_b, 200);
    //根据ID获取用户的互粉列表
    if (is_array($f_byid['users'])) {
        foreach ($f_byid['users'] as $item_u) {
            if ($item_u['gender'] == $idgender) {
                $arrid[$countsex] = $item_u['id'];
                $arrname[$countsex] = $item_u['screen_name'];
                $arrimg[$countsex] = $item_u['profile_image_url'];
                $arrdes[$countsex] = $item_u['description'];
                $arrloc[$countsex] = $item_u['location'];
                $countsex++;
            }
        }
    }
}
function SelectTag($tag)
예제 #4
0
파일: pylist.php 프로젝트: robertniu/php
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>新浪萝卜  -- Powered by Sina App Engine</title>
</head>

<body><?php 
echo $user_message['screen_name'];
?>
 ,您好!
<form name="pyl" action = "result.php" method = "post">	





<?php 
$f_byid = $c->bilateral($uid, 0, 200);
//根据ID获取用户的互粉列表
$sortsid = array();
$i = 0;
$countsex = 0;
$countcity = 0;
if (is_array($f_byid['users'])) {
    foreach ($f_byid['users'] as $item_u) {
        if ($item_u['gender'] == "f") {
            echo '<div style="padding:10px;margin:5px;border:1px solid #ccc">';
            //echo '####################################<br>';
            $countsex++;
            echo $item_u['id'] . '<br>';
            echo $item_u['screen_name'] . ':<br>';
            ?>
<img src= <?php