function getDefaultView(&$controller, &$xoopsUser) { $uid = isset($_GET['uid']) ? intval(xoops_getrequest('uid')) : 0; $handler =& xoops_gethandler('user'); $this->mObject =& $handler->get($uid); if (!is_object($this->mObject)) { return USER_FRAME_VIEW_ERROR; } $t_rank = xoops_getrank($this->mObject->get('rank'), $this->mObject->get('posts')); $rankHandler =& xoops_getmodulehandler('ranks', 'user'); $this->mRankObject =& $rankHandler->get($t_rank['id']); $root =& $controller->mRoot; $service =& $root->mServiceManager->getService('privateMessage'); if ($service != null) { $client =& $root->mServiceManager->createClient($service); $this->mPmliteURL = $client->call('getPmliteUrl', array('fromUid' => is_object($xoopsUser) ? $xoopsUser->get('uid') : 0, 'toUid' => $uid)); } unset($service); $service =& $root->mServiceManager->getService("LegacySearch"); if ($service != null) { $this->mSearchResults = array(); $client =& $root->mServiceManager->createClient($service); $moduleArr = $client->call('getActiveModules', array()); $uid = $this->mObject->get('uid'); foreach ($moduleArr as $t_module) { $params = array('mid' => $t_module['mid'], 'uid' => $uid, 'maxhit' => USER_USERINFO_MAXHIT, 'start' => 0); $module = array('name' => $t_module['name'], 'mid' => $t_module['mid'], 'results' => $client->call('searchItemsOfUser', $params)); $nresult = count($module['results']); if ($nresult) { $module['has_more'] = $nresult >= USER_USERINFO_MAXHIT; $this->mSearchResults[] = &$module; unset($module); } } } return USER_FRAME_VIEW_SUCCESS; }
function _loadRank() { if (!$this->_mRankLoadedFlag) { $t_rank = xoops_getrank($this->get('rank'), $this->get('posts')); $rank_id = $t_rank['id']; $handler =& xoops_getmodulehandler('ranks'); $this->mRank =& $handler->get($rank_id); $this->_mRankLoadedFlag = true; } }
/** * get the user's rank * @return array array of rank ID and title */ function rank() { if (!isset($this->_rank)) { $this->_rank = xoops_getrank($this->getVar('rank'), $this->getVar('posts')); } return $this->_rank; }