WIKI使用導(dǎo)航
站長百科導(dǎo)航
站長專題
- 網(wǎng)站推廣
- 網(wǎng)站程序
- 網(wǎng)站賺錢
- 虛擬主機(jī)
- cPanel
- 網(wǎng)址導(dǎo)航專題
- 云計(jì)算
- 微博營銷
- 虛擬主機(jī)管理系統(tǒng)
- 開放平臺(tái)
- WIKI程序與應(yīng)用
- 美國十大主機(jī)
ThinkSNS用戶API-user getInfo()
來自站長百科
導(dǎo)航: 上一頁
1,user getInfo()
格式:user_getInfo(uids, fields, format)
描述: 返回指定用戶的用戶信息,返回形式為一個(gè)數(shù)組
參數(shù)說明:
參數(shù) | 屬性 | 空? | 說明 |
uids | string | 否 | 用戶ID,彼此之間用逗號(hào)分割。 |
fields | string | 否 | 指定返回用戶的哪些信息。 |
format | string | 是 | 指定響應(yīng)返回的格式。有PHP (默認(rèn)) JSON 和XML 這三種值可選。 |
調(diào)用Demo:
$this->api->user_getInfo("1, 2", "name, email"); (返回: array(2) { [0] => array(2) { ["name"] => string(6) "劉偉" ["email"] => string(13) "foxlw@126.com" } [1] => array(2) { ["name"] => string(6) "哈哈" ["email"] => string(10) "ttt@tt.com" } }) $this->api->user_getInfo("1, 2", "name,email", "json"); (返回: string(94) "[{"name":"\u5218\u4f1f","email":"foxlw@126.com"},{"name": "\u54c8\u54c8","email":"ttt@tt.com"}]" )
注: 目前field 可選的字段為:
- id - 用戶ID
- name - 用戶姓名。
- handle - 昵稱。
- sex - 用戶性別,返回值為male 或female。
- birthday - 用戶出生日期,返回值為YYYY-MM-DD 格式,例如1983-01-01。
- blood_type - 用戶血型。
- relationship_status - 婚戀狀態(tài)。
- current_location - 當(dāng)前居住地。
- hometown_location - 家鄉(xiāng)。
- has_added_app - 是否安裝了當(dāng)前應(yīng)用,返回0 時(shí)表示沒有安裝,返回1 時(shí)表示已安裝。
- admin_level - 用戶權(quán)限信息。返回值為‘USER’ 時(shí)表示普通用戶,返回為‘MANAGER’ 時(shí)表示為管理員
- pic - 用戶大尺寸頭像的地址(僅當(dāng)用戶頭像存在時(shí)返回)。
- pic_thumb - 用戶中尺寸頭像的地址(僅當(dāng)用戶頭像存在時(shí)返回)。
- pic_small - 用戶小尺寸頭像的地址(僅當(dāng)用戶頭像存在時(shí)返回)。