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


PHP UserInfo::get方法代码示例

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


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

示例1: get

 /**
  * Get user media from instagram
  *
  * @see constructQuery
  *
  * @param $user_name
  * @param null $cursor_after
  * @param null $limit
  * @return array
  */
 public function get($user_name, $cursor_after = NULL, $limit = NULL)
 {
     if (!$cursor_after) {
         $resultObj = new UserInfo($this->client);
         $result = $resultObj->get($user_name);
         $this->user_id = $result->id;
     } else {
         $post_params = $this->constructQuery($user_name, $cursor_after, $limit);
         $result = $this->asObject($this->client->webRequest('/query/', 'POST', [], $post_params));
     }
     $media = ['cursor_after' => !empty($result->media->page_info->end_cursor) && !empty($result->media->page_info->has_next_page) ? $result->media->page_info->end_cursor : NULL, 'data' => !empty($result->media->nodes) ? $result->media->nodes : NULL];
     return $media;
 }
开发者ID:moelius,项目名称:instagram-wrapper,代码行数:23,代码来源:UserMedia.php

示例2: loadByRequest

        if ($rt === false) {
            $rt = array('openid' => $this->openid, 'nickname' => '', 'sex' => '', 'city' => '', 'province' => '', 'country' => '', 'headimgurl' => '');
        }
        $info = (object) $rt;
        $sql = "DELETE FROM `wx_userinfo` WHERE `openid` = '{$this->openid}'";
        $this->delete($sql);
        $sql = "INSERT INTO `wx_userinfo` VALUES ('{$info->openid}', '{$info->nickname}', '{$info->sex}', '{$info->country}', '{$info->province}', '{$info->city}', '{$info->headimgurl}')";
        $this->insert($sql);
        return $rt;
    }
    private function loadByRequest()
    {
        include_once dirname(__FILE__) . '/../token/access_token.php';
        include_once dirname(__FILE__) . '/../../util/http_client.php';
        $access_token = (new AccessToken())->get();
        $url = "https://api.weixin.qq.com/cgi-bin/user/info?access_token={$access_token}&openid={$this->openid}&lang=zh_CN";
        $info = json_decode((new HttpClient($url))->get(), true);
        if (isset($info['subscribe']) && $info['subscribe'] == 1) {
            return array('openid' => $info['openid'], 'nickname' => $info['nickname'], 'sex' => $info['sex'], 'city' => $info['city'], 'province' => $info['province'], 'country' => $info['country'], 'headimgurl' => isset($info['headimgurl']) ? $info['headimgurl'] : '');
        } else {
            return false;
        }
    }
}
//request by developer
if (isset($_GET['userinfo']) && isset($_GET['secret']) && isset($_GET['openid'])) {
    if ($_GET['userinfo'] == APPID && $_GET['secret'] == PRIVATE_SECRET) {
        $tmp = new UserInfo($_GET['openid']);
        print_r($tmp->get());
    }
}
开发者ID:jianhua1982,项目名称:wlight,代码行数:31,代码来源:info.php

示例3: getByOpenID

		/** 
		 * Returns a user object by open ID. Does not log a user in.
		 * @param string $uOpenID
		 * @return UserInfo
		 */
		public function getByOpenID($uOpenID) {
			return UserInfo::get('inner join UserOpenIDs on Users.uID = UserOpenIDs.uID where uOpenID = ?', $uOpenID);
		}
开发者ID:rii-J,项目名称:concrete5-de,代码行数:8,代码来源:userinfo.php


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