Advertisement
Guest User

Untitled

a guest
Jan 8th, 2013
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. function data() {
  2. global $SESS, $DB, $PREFS, $IN, $FNS, $OUT, $EXT, $STAT, $LANG, $LOC;
  3. $reply = array();
  4. $SessID = $SESS - > userdata['location'];
  5. if (isset($SessID)) {
  6. $ticket = authenticate($SessID);
  7. if ($ticket['valid']) {
  8. $OnlineID = $ticket['onlineid'];
  9. $userTicket = $ticket;
  10. $NPID = userNPID($OnlineID);
  11. $_data['profile'] = userProfile($NPID, $OnlineID);
  12. $_data['friends'] = userFriendList($userTicket);
  13. $_data['profile_extra'] = userExpandedList($OnlineID, $NPID);
  14. $_data['UserName'] = (string) $_data['profile'] - > onlinename;
  15. $_data['Bio'] = (string) $_data['profile'] - > aboutme;
  16. $_data['Avatar'] = (string) $_data['profile'] - > avatarurl;
  17. $_data['AvatarMedium'] = (string) $_data['profile'] - > {
  18. 'medium-avatarurl'
  19. };
  20. $_data['AvatarSmall'] = (string) $_data['profile'] - > {
  21. 'small-avatarurl'
  22. };
  23. $_data['level'] = (string) $_data['profile_extra'] - > list - > user - > {
  24. 'trophy-level'
  25. } - > level;
  26. $level = (string) $_data['profile_extra'] - > list - > user - > {
  27. 'trophy-level'
  28. } - > level;
  29. $friends_array = array();
  30. $friends_online_array = array();
  31. foreach($_data['friends'] - > list - > user as $value) {
  32. $friends_id = $value - > npid - > onlineid;
  33. $friends_online_array[] = $friends_id;
  34. }
  35. $_data['friends_number'] = count($friends_online_array, COUNT_RECURSIVE);
  36. $reply[] = $_data;
  37. $this - > Userlevel($level);
  38. // _dlog('OUTPUT', $this);
  39. return $reply;
  40. } else {
  41. // $this->ShowError(3);
  42. }
  43. }
  44. }
  45.  
  46. function Userlevel($level) {
  47. global $TMPL;
  48. $TMPL->tagdata = $level;
  49. return $TMPL->tagdata;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement