- //獲取用戶信息
- //主題數
- $_G['tan']['threads']=getuserprofile('threads');
- //回帖數
- $_G['tan']['posts']=getuserprofile('posts')-$_G['tan']['threads'];
- //收藏數
- $_G['tan']['favtimes']=getuserprofile('favtimes');
- //新短消息
- loaducenter();//這個必須加上否則會報錯,這個是用來調用Ucenter相關函數信息
- $arr = uc_pm_checknew($_G['uid'],1);
這個為上面的解釋,getuserprofile 獲取用戶信息任意字段函數,在舉幾個例子供大家參考,此函數,提供一個參數,內容為用戶的字段名,即可返回出來他值的內容.
如:我要獲取用戶
威望::getuserprofile('extcredits1')
金錢: getuserprofile('extcredits2')
貢獻:getuserprofile('extcredits3')
用戶uid:getuserprofile(uid')
聽從:getuserprofile('follower ')
收聽:getuserprofile('following ')
主題:getuserprofile('threads')
直接在你需要的頁面直接寫就可以.
- loaducenter()在文件 source/function/function_core.php 中:
- function loaducenter() {
- require_once DISCUZ_ROOT.'./config/config_ucenter.php';
- require_once DISCUZ_ROOT.'./uc_client/client.php';
- }
新聞熱點
疑難解答