public function get_texts_applauded_by_author() { // Get the application object. $app = JFactory::getApplication(); $author_id = JRequest::getInt('author_id'); $user_id = JRequest::getInt('user_id'); $authorsection = JRequest::getInt('authorsection'); $texts = ideary::getTextsApplaudedByUser($author_id); $countAllTexts = ideary::getCountTextsApplaudedByUser($author_id); $textHtmlArray = array(); if (!empty($texts)) { foreach ($texts as $index => $text) { $textHtmlArray[] = ideary::removeNewLinesFromString(ideary::generateTextContent($text, $author_id, $index, true, $authorsection)); } } /*else{ $textHtmlArray[] = '<div class="text"><div class="text-data" style="margin-left: 0px !important;">Aun no has aplaudido ningun texto</div></div>'; }*/ echo json_encode(array('texts' => $textHtmlArray, 'countAllTexts' => $countAllTexts)); $app->close(); }
if (!empty($this->texts)) { ?> <?php if ($_GET['draft'] == 1) { $textContentType = 'draft'; } else { $textContentType = 'mine'; } ?> <script type="text/javascript"> <?php foreach ($this->texts as $index => $text) { ?> texts.push('<?php echo addslashes(ideary::removeNewLinesFromString(ideary::generateTextContent($text, $this->user->id, $index, true, false, false, $textContentType))); ?> '); <?php } ?> </script> <?php } ?> </div> <div style="clear: both;"></div> </div>
public function get_more_texts_of_author() { // Get the application object. $app = JFactory::getApplication(); $userId = JRequest::getInt('userId'); $offset = JRequest::getInt('offset'); $text_type = JRequest::getString('text_type'); switch ($text_type) { case "published": $texts = ideary::getTextsOfUser($userId, 1, $offset); $profile = 1; $authorsection = 1; $type = 'mine'; break; case "draft": $texts = ideary::getTextsOfUser($userId, 0, $offset); $profile = 1; $authorsection = 1; $type = 'draft'; break; case "favourites": $texts = ideary::getFavArchTexts(1, $offset); $profile = 1; $authorsection = 0; $type = 'default'; break; case "applauded": $texts = ideary::getTextsApplaudedByUser($userId, $offset); $profile = 1; $authorsection = 0; $type = 'default'; break; case "archived": $texts = ideary::getFavArchTexts(0, $offset); $profile = 0; $authorsection = 0; $type = 'default'; break; } $textHtmlArray = array(); if (!empty($texts)) { foreach ($texts as $index => $text) { $textHtmlArray[] = ideary::removeNewLinesFromString(ideary::generateTextContent($text, $userId, $offset + $index, $profile, $authorsection, false, $type)); } } echo json_encode(array('texts' => $textHtmlArray)); $app->close(); }
</div> <div id="public-profile-right-container"> <div id="h-scroll-container"></div> <?php if (!empty($this->texts)) { ?> <script type="text/javascript"> <?php foreach ($this->texts as $index => $text) { ?> texts.push('<?php echo addslashes(ideary::removeNewLinesFromString(ideary::generateTextContent($text, $this->loggedUser->get('id'), $index))); ?> '); <?php } ?> </script> <?php } ?> </div> <div style="clear: both;"></div> </div>
public function get_more_texts() { // Get the application object. $app = JFactory::getApplication(); $texts_array_html = array(); $category_post = JRequest::getString('category_post'); $period_post = JRequest::getString('period_post'); $text_search_post = JRequest::getString('text_search_post'); $userId = JRequest::getString('userId'); $offset = JRequest::getInt('offset'); $texts = ideary::getTexts($category_post, $period_post, $text_search_post, $userId, $offset); $userId = JFactory::getUser()->get('id'); $followers = ideary::getUsersWhoIAmFollowingId($userId); foreach ($texts as $index => $text) { $isFollower = in_array($text->created_by, $followers); $texts_array_html[] = ideary::removeNewLinesFromString(ideary::generateTextContent($text, $userId, $index + $offset, false, false, true, "default", $isFollower)); } echo json_encode(array('texts_array_html' => $texts_array_html)); $app->close(); }
} ?> <?php $followers = ideary::getUsersWhoIAmFollowingId($userId); ?> <?php foreach ($texts as $index => $text) { ?> <?php $isFollower = in_array($text->created_by, $followers); ?> texts.push('<?php echo addslashes(ideary::removeNewLinesFromString(ideary::generateTextContent($text, $user->get('id'), $index, false, false, true, "default", $isFollower))); ?> '); //texts.push('<?php //echo addslashes(ideary::removeNewLinesFromString(require JModuleHelper::getLayoutPath('mod_list_text', 'item'))) ?> '); <?php } ?> </script>