public function finishBuild() { global $mainframe; $userData = TuiyoAPI::get("user"); $profile = TuiyoUser::getUserFromRequest(); $document = JFactory::getDocument(); $template = JFilterInput::clean($mainframe->getTemplate(), 'cmd'); $userStyle = TUIYO_STYLES . DS . $userData->id . DS . $template . ".ini"; if (file_exists($userStyle) && is_file($userStyle) && is_readable($userStyle)) { $content = file_get_contents($userStyle); $params = new JParameter($content); $session = JSession::getInstance('none', array()); $session->set("TUIYO_STYLE", $params); } //User Avatar $mainframe->addMetaTag("thumb70", $userData->getUserAvatar()->thumb70); $mainframe->addMetaTag("thumb35", $userData->getUserAvatar()->thumb35); }
/** * Method to display the users profile * Profile ID must be specified, or else redirected to own profile * @access public */ public function view($tpl = null) { //1. Requirements $thisuser = $GLOBALS['API']->get('user'); $redirect = JRoute::_(TUIYO_INDEX . "&view=welcome"); $thatuser = TuiyoUser::getUserFromRequest(); $thatuser = !is_object($thatuser) ? $thisuser : $thatuser; $profileID = $thatuser->id; $view = $this->getView('profile', "html"); $fModel = $this->getModel('friends'); $pModel = $this->getModel('profile'); //3. Check Privacy Settings; $uPrivacy =& $GLOBALS['API']->get('privacy'); $tPrivacy = array("canViewProfile" => $uPrivacy->canViewProfile($thatuser->id, $thisuser->id), "canViewProfileEx" => $uPrivacy->canViewExtendedProfile($thatuser->id, $thisuser->id), "canViewProfileSb" => $uPrivacy->canViewProfileInformation($thatuser->id, $thisuser->id), "canViewProfileFrs" => $uPrivacy->canViewProfileFriends($thatuser->id, $thisuser->id), "canRateProfile" => $uPrivacy->canRateUser($thatuser->id, $thisuser->id), "canAddAsFriend" => $uPrivacy->canAddAsFriends($thatuser->id, $thisuser->id)); //If guest profile? if ($thatuser->joomla->get('guest')) { $this->setRedirect($redirect); $this->redirect(); } //4. Load Extended Profile, $uFriends = $fModel->getFriendLists($thatuser->id, $thisuser->id, 1); //Bread crumbs and Page Title $GLOBALS['mainframe']->addMetaTag("pid", $thatuser->id); //Assign Variables $view->assignRef("friends", $uFriends); $view->assignRef("privacy", $tPrivacy); $view->assignRef("thisuser", $thisuser); $view->assignRef("thatuser", $thatuser); $view->assignRef("controller", $this); $pModel->incrementViews($thatuser->id, +1); //onProfileView $GLOBALS["events"]->trigger("onProfileView", $this); $view->display($tpl, $thatuser->id, $tPrivacy); }