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


PHP SaeTClientV2::friends_by_id方法代码示例

本文整理汇总了PHP中SaeTClientV2::friends_by_id方法的典型用法代码示例。如果您正苦于以下问题:PHP SaeTClientV2::friends_by_id方法的具体用法?PHP SaeTClientV2::friends_by_id怎么用?PHP SaeTClientV2::friends_by_id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SaeTClientV2的用法示例。


在下文中一共展示了SaeTClientV2::friends_by_id方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: debug

     if (1 != $num) {
         $msg = "向数据库插入数据出错。file:" . __FILE__ . ";line:" . __LINE__ . "sql:" . $sql;
         debug($msg);
     }
     $sql = "update user set bind_status = bind_status + 1 where user_id = '{$id}' limit 1";
     $num = $dbo->exeUpdate($sql);
     if (1 != $num) {
         $msg = "向数据库插入数据出错。file:" . __FILE__ . ";line:" . __LINE__ . "sql:" . $sql;
         debug($msg);
     }
     //写session,跳转
     $_SESSION['sid'] = $sid;
     $_SESSION['stoken'] = $token['access_token'];
     header("Location:task.php");
     // 后台获取用户的已关注用户id列表,写入SESSION
     $friends = $c->friends_by_id($_SESSION['sid']);
     if_weiboapi_fail($friends, __FILE__, __LINE__);
     foreach ($friends['users'] as $friend) {
         $followed_id[] = $friend['id'];
     }
     $_SESSION['followed_id'] = $followed_id;
     $_SESSION['is_bind_weibo'] = TRUE;
     $_SESSION['slevel'] = $weibo_init_level;
     exit;
 } else {
     // 尚未注册。在用微博帐号注册。注:直接用微博注册者默认为普通会员,广告主需要先注册微动力。
     $user_info = $c->show_user_by_id($sid);
     // fetch user basic message according to sid
     if_weiboapi_fail($user_info);
     $screen_name = $user_info['screen_name'];
     $name = $screen_name . '@sina';
开发者ID:mafergomez70,项目名称:micro-power,代码行数:31,代码来源:callback.php

示例2:

        // 0:全部,1:原创,2图片,3视频,4音乐
        $trim_user = 1;
        // 0:返回完整user信息,1:user字段仅返回uid
        $base_app = 0;
        // 0:无限制,1:仅返回通过本应用发布的微博
        $statuses = $c->user_timeline_by_id($uid, $page, $count, $since_id, $max_id, $feature, $trim_user, $base_app);
        if_weiboapi_fail($statuses);
        break;
    case 2:
        // sina_follow
        $uid = $_SESSION['sid'];
        $cursor = 0;
        $count = 50;
        $followers = $c->followers_by_id($uid, $cursor, $count);
        if_weiboapi_fail($followers);
        $friends = $c->friends_by_id($uid, $cursor, $count);
        if_weiboapi_fail($friends);
        break;
    default:
        $msg = '暂不支持该类型';
}
require_once "uiparts/docheader.php";
?>
<body>
	<?php 
include "uiparts/header.php";
?>
	<div id="func_column">
		<ul >
			<li><a href="create_task.php?type=sina_follow">创建新浪关注任务</a></li>
			<li><a href="create_task.php?type=sina_repost">创建新浪转发任务</a></li>
开发者ID:mafergomez70,项目名称:micro-power,代码行数:31,代码来源:create_task.php

示例3: selectUserRandom

  <!--游戏开始按钮div-->
  <div id="daojishi_bot">
    <input name="start_button" type="button" id="start_button" value="开始!" onclick="baoxu_start();" />
  </div>
</div>
<!--用于显示真正进行连连看的图片的TABLE-->
<table id="llk_table" cellspacing="0" cellpadding="0" border="1">
</table>
<!-------------------------连连看模块结束------------------------------->
<!--------------------------用户信息处理-------------------------------->
<?php 
//当前用户的UID
$pre_user_id = $_SESSION['oauth2']["user_id"];
//echo "登记的用户名为:".$pre_user_id;
//获得用户的关注者数组
$friends_info = $c->friends_by_id($uid = $pre_user_id, $cursor = 0, $count = 200);
// done
?>
<div id="user_llk">
  <!--用于显示用户用户的关注者的TABLE-->
  <table id="user_table">
  </table>
  <!--用户控制区,用户选择连连看头像和确定-->
  <div id="user_control">
    <input type="button" value="确定" onclick="chooseUser();" />
    <input type="button" value="换一批" onclick="user_Load(userPhotoArray,userIdArray,userNameArray, userRow, userCol); selectUserRandom(userRow, userCol);" />
  </div>
</div>
<!--获取好友头像,显示以供选取-->
<script language="javascript" type="text/javascript">
var userPhotoArray = [];
开发者ID:yunsite,项目名称:baoxu-project,代码行数:31,代码来源:index.php

示例4: foreach

$tlb_byid = $c->timeline_batch_by_id($s);//批量获取指定的一批用户的timeline,测试不成功:第三方应用访问api接口权限受限制 
	if( is_array( $tlb_byid['statuses'] ) )
	{
  		 foreach( $tlb_byid['statuses'] as $item_u )   
   		{      
    		 echo '<div style="padding:10px;margin:5px;border:1px solid #ccc">';
     		 echo '####################################<br>';
     		 echo  $item_u['text'].':<br>';  
                 echo  $item_u['created_at'].'<br>';
                 echo  '</div>';
                }
         }
} 
*/
$f_byid = $c->friends_by_id($targetid, 0, 20);
//根据ID获取用户的关注列表
$sortsid = array();
$i = 0;
if (is_array($f_byid['users'])) {
    foreach ($f_byid['users'] as $item_u) {
        echo '<div style="padding:10px;margin:5px;border:1px solid #ccc">';
        echo '####################################<br>';
        echo $item_u['id'] . '<br>';
        echo $item_u['screen_name'] . ':<br>';
        $ut_byid = $c->user_timeline_by_id($item_u['id'], 1, 1);
        if (is_array($ut_byid['statuses'])) {
            foreach ($ut_byid['statuses'] as $item_c) {
                echo '############<br>';
                // echo 'i='.$i.'<br>';
                echo $item_c['text'] . '<br>';
开发者ID:robertniu,项目名称:php,代码行数:30,代码来源:weibolist.php


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