Пример #1
0
 function display($tpl = null)
 {
     // Initialise variables.
     $app = JFactory::getApplication();
     $user = JFactory::getUser();
     $userId = $user->get('id');
     $dispatcher = JDispatcher::getInstance();
     $this->print = JRequest::getBool('print');
     $this->state = $this->get('State');
     $this->user = $user;
     $this->user = ideary::getUserInfoById($this->user->id);
     $userextra = Ideary::getExtraUserData($_GET["id"]);
     $this->assignRef('userextra', $userextra);
     $this->userDatafinal = Ideary::getuserData($this->user->id);
     $this->userDatafinal = $this->userDatafinal[0];
     $this->userExtraData = Ideary::getExtraUserData($this->user->id);
     $this->period = isset($_POST['period']) ? $_POST['period'] : 'LAST-WEEK';
     $this->messages = Ideary::getUserMessages($this->user->id);
     $user_followers = Ideary::getUserFollowers($this->user->id);
     $followers = array();
     foreach ($user_followers as $follower) {
         $followers[] = $follower->follower_id;
     }
     $this->user_followers = $followers;
     $this->messages_sent = Ideary::getUserMessagesSent($this->user->id);
     $this->inbox_messages = Ideary::getMessagesOfFollowedUsersByUserId($this->user->id);
     $this->unknown_users_messages = Ideary::getMessagesOfNoFollowedUsersByUserId($this->user->id);
     $this->sent_messages = Ideary::getMessagesSentByUserId($this->user->id);
     Ideary::setAllMailsAsReaded($this->user->id);
     //$this->_prepareDocument();
     parent::display($tpl);
 }
Пример #2
0
 function display($tpl = null)
 {
     // Initialise variables.
     $app = JFactory::getApplication();
     $dispatcher = JDispatcher::getInstance();
     $user_id = $this->get('id');
     $loggedUser = JFactory::getUser();
     $loggedUserId = $loggedUser->get('id');
     if (isset($_GET["id"])) {
         $user = ideary::getUserById($_GET["id"], $loggedUserId);
         $userextra = Ideary::getExtraUserData($_GET["id"]);
         $this->assignRef('userextra', $userextra);
     }
     $texts = ideary::getTextsByUserId($_GET["id"], $loggedUserId);
     $yes_clapped_texts = ideary::getUserPermission('clap_texts_visib', $_GET["id"], $loggedUserId);
     $this->assignRef('texts', $texts);
     $this->assignRef('yes_clapped_texts', $yes_clapped_texts);
     $this->assignRef('return', $return);
     $this->assignRef('user', $user);
     $this->assignRef('loggedUser', $loggedUser);
     $this->assignRef('lgid', $loggedUserId);
     $this->document->setTitle($user->name);
     parent::display($tpl);
 }
Пример #3
0
        <?php 
    foreach ($this->authors as $author) {
        ?>
		<?php 
        $sexo = "";
        $educacion = "";
        $ocupacion = "";
        $pais = "";
        $ciudad = "";
        $provincia = "";
        $frasepersonal = "";
        $website = "";
        $fechanac = "";
        $selectedM = "";
        $selectedF = "";
        $userExtraData = Ideary::getExtraUserData($author->id);
        ?>
	
	<?php 
        foreach ($userExtraData as $campo) {
            ?>
				
		<?php 
            switch ($campo->profile_key) {
                case "profile.address1":
                    $educacion = str_replace('"', '', $campo->profile_value);
                    break;
                case "profile.address2":
                    $ocupacion = str_replace('"', '', $campo->profile_value);
                    break;
                case "profile.website":
Пример #4
0
 /**
  * Method to display the view.
  *
  * @param	string	$tpl	The template file to include
  * @since	1.6
  */
 public function display($tpl = null)
 {
     // Get the view data.
     $this->data = $this->get('Data');
     $this->form = $this->get('Form');
     $this->state = $this->get('State');
     $this->params = $this->state->get('params');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode('<br />', $errors));
         return false;
     }
     // Check if a user was found.
     if (!$this->data->id) {
         JError::raiseError(404, JText::_('JERROR_USERS_PROFILE_NOT_FOUND'));
         return false;
     }
     $app = JFactory::getApplication();
     $this->user2 = JFactory::getUser();
     $getUserId = $_GET['user_id'] ? $_GET['user_id'] : $this->user2->id;
     if ($getUserId != $this->user2->id) {
         $app->redirect(JRoute::_('index.php'));
     }
     // Check for layout override
     $active = JFactory::getApplication()->getMenu()->getActive();
     if (isset($active->query['layout'])) {
         $this->setLayout($active->query['layout']);
     }
     $this->user = ideary::getUserInfoById($this->user2->id);
     $this->userData = ideary::getUserById($this->user2->id);
     $resultEN = strpos($this->user->params, 'en-GB');
     $resultES = strpos($this->user->params, 'es-ES');
     $resultPT = strpos($this->user->params, 'pt-BR');
     $userextra = Ideary::getExtraUserData($_GET["id"]);
     if ($resultEN != false && $resultEN != null) {
         $currentlang = 'en-GB';
     } elseif ($resultES != false && $resultES != null) {
         $currentlang = 'es-ES';
     } elseif ($resultPT != false && $resultPT != null) {
         $currentlang = 'pt-BR';
     }
     $this->assignRef('userextra', $userextra);
     $this->assignRef('currentlang', $currentlang);
     $this->userDatafinal = Ideary::getuserData($this->user->id);
     $this->userDatafinal = $this->userDatafinal[0];
     $this->userExtraData = Ideary::getExtraUserData($this->user->id);
     $this->cant_pub = Ideary::getUserCantTexts($this->user->id, 1);
     $this->cant_draft = Ideary::getUserCantTexts($this->user->id, 0);
     if ($_GET["layout"] == "edit") {
         $this->categories = Ideary::getCategories();
         $this->user_interests = Ideary::getUserInterests($this->user->id);
     }
     if ($_GET["layout"] == "userconfiguration") {
         $this->UserNotifSettings = Ideary::getUserNotifSettings($this->user->id);
         if (count($this->UserNotifSettings) > 0) {
             $this->UserNotifSettings = $this->UserNotifSettings[0];
         }
     }
     $pub = $_GET['draft'] == 1 ? 0 : 1;
     $text_type = $pub ? 'published' : 'draft';
     $texts = ideary::getTextsOfUser($this->user->id, $pub, 0, 10);
     $countAlltexts = ideary::getCountTextsByUserId($this->user->id, $pub);
     $this->assignRef('texts', $texts);
     $this->assignRef('countAlltexts', $countAlltexts);
     $this->assignRef('text_type', $text_type);
     //Escape strings for HTML output
     $this->pageclass_sfx = htmlspecialchars($this->params->get('pageclass_sfx'));
     $this->prepareDocument();
     parent::display($tpl);
 }