function smarty_modifier_xoops_user($uid, $key, $flag = 2) { require_once XOOPS_MODULE_PATH . '/profile/class/handler/Definitions.class.php'; $handler = xoops_gethandler('member'); $user = $handler->getUser(intval($uid)); if (in_array($key, Profile_DefinitionsHandler::getReservedNameList())) { if ($key == 'user_name') { return Legacy_Utils::getUserName($uid); } if (is_object($user) && $user->isActive()) { return $flag == 2 ? $user->getShow($key) : $user->get($key); } } else { $profileHandler = Legacy_Utils::getModuleHandler('data', 'profile'); $profile = $profileHandler->get($uid); if (is_object($profile) && is_object($user) && $user->isActive()) { return $profile->showField($key, $flag); } } return null; }
/** * _getPageTitle * * @param void * * @return string **/ protected function _getPagetitle() { return Legacy_Utils::getUserName($this->_getId()); }
/** * _getPageTitle * * @param void * * @return string **/ protected function _getPagetitle() { return Legacy_Utils::getUserName(Legacy_Utils::getUid()); }
/** * getClientFeed Legacy_ActivityClient.{dirname}.GetClientFeed * * @param mixed &$list * string[] $list['title'] entry's title * string[] $list['link'] link to entry * string[] $list['id'] entry's id(=permalink to entry) * int[] $list['updated'] unixtime * int[] $list['published'] unixtime * string[] $list['author'] * string[] $list['content'] * @param string $dirname client module's dirname * @param string $dataname client module's dataname(tablename) * @param int $dataId client module's primary key * * @return void */ public static function getClientFeed(&$list, $dirname, $dataname, $dataId) { $handler = Legacy_Utils::getModuleHandler($dataname, $dirname); if (!$handler) { return; } //setup client module info $obj = $handler->get($dataId); $list['title'] = $obj->get('title'); $list['link'] = Legacy_Utils::renderUri($dirname, $dataname, $dataId); $list['id'] = Legacy_Utils::renderUri($dirname, $dataname, $dataId); $list['published'] = $obj->get('posttime'); $list['updated'] = $obj->get('updatetime'); $list['author'] = Legacy_Utils::getUserName($obj->get('uid')); $list['content'] = null; }
/** * getPlace * * @param string $key id/title/uri * * @return mixed * $place['id'] int * $place['title'] string * $place['uri'] string */ public function getPlace($key = null) { if ($this->get('group_id') > 0) { $this->loadGroup(); $place = array('id' => $this->get('group_id'), 'title' => $this->mGroup->getShow('title'), 'uri' => Legacy_Utils::renderUri($this->getDirname, 'group', $this->get('group_id'))); } elseif ($this->get('conv_id') > 0) { $place = array('id' => $this->get('conv_id'), 'title' => $this->mConv->getShow('title'), 'uri' => Legacy_Utils::renderUri($this->getDirname, 'conv', $this->get('group_id'))); } else { $place = array('id' => $this->get('uid'), 'title' => Legacy_Utils::getUserName($this->get('uid')), 'uri' => Legacy_Utils::renderUri($this->getDirname, 'player', $this->get('uid'))); } return $key === null ? $place : $place[$key]; }