Ejemplo n.º 1
0
 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();
 }
Ejemplo n.º 2
0
}*/
if ($_GET["option"] != "com_contact" && ($_GET["option"] == "com_content" && $_GET["view"] != "article" && $_GET["view"] != "edit" && $_GET["view"] != "ranking") && $_GET["option"] != "com_users") {
    //si es home
    $user = JFactory::getUser();
    $category_post = $_POST["category"];
    $period_post = $_POST["period"];
    $text_search_post = $_POST["text-search"];
    $userId = $user->get('id');
    /*if((($category_post=="") || (is_null($category_post))) && ($userId!=0)){
    	   // $texts = ideary::getTextsAccordingToUser($userId);
    		//if(count($texts) == 0){
    			$texts = ideary::getTexts($category_post, $period_post, $text_search_post, $userId);
    		//}
    	}
    	else{
    		$texts = ideary::getTexts($category_post, $period_post, $text_search_post, $userId);
    	}*/
    if (!$text_search_post) {
        $text_search_post = $_GET['search'];
    }
    $limit = isset($_GET['offset']) ? $_GET['offset'] : 20;
    $texts = ideary::getTexts($category_post, $period_post, $text_search_post, $userId, 0, $limit);
    $offset = count($texts);
    $countAlltexts = ideary::getTextsCount($category_post, $period_post, $text_search_post, $userId);
    $users = array();
    if ($text_search_post) {
        $users = ideary::getWriterSearch($text_search_post, $userId);
    }
    $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'));
    require JModuleHelper::getLayoutPath('mod_list_text', $params->get('layout', 'default'));
}