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 if (JFactory::getUser()->get('id') > 0 && ideary::getUserImpact($user->id) > 10) { ?> texts.push('<?php echo addslashes(ideary::removeNewLinesFromString(ideary::generateMyStatsBox())); ?> '); <?php } ?> <?php } ?> <?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