예제 #1
0
 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();
 }
예제 #2
0
    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>
예제 #3
0
 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();
 }
예제 #4
0
</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>
예제 #5
0
 public function get_more_texts_ranking()
 {
     // Get the application object.
     $app = JFactory::getApplication();
     $texts_array_html = array();
     $period = JRequest::getString('period');
     $userId = JRequest::getString('userId');
     $offset = JRequest::getInt('offset');
     $texts = ideary::getTextsRanking($userId, $period, $offset);
     $index = 1;
     foreach ($texts as $text) {
         $texts_array_html[] = ideary::removeNewLinesFromString(ideary::generateTextRankingHTML($text, $index + $offset));
         $index++;
     }
     echo json_encode(array('texts_array_html' => $texts_array_html));
     $app->close();
 }
예제 #6
0
    }
    ?>

			<?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>