Ejemplo n.º 1
0
?>
;"></div>
        
		<?php 
if ($user->id != $this->writer->id) {
    $userProfileUrl = "index.php?option=com_contact&view=public&id=" . $this->writer->id;
} else {
    $userProfileUrl = "index.php?option=com_users&view=profile";
}
?>
		<a href="<?php 
echo $userProfileUrl;
?>
">
		<img src="<?php 
echo ideary::getUserImagePath($this->writer->id, "200");
?>
" style="
			float: left; height: 88px; width: 88px; margin-right: 12px; border: 2px solid lightgray;
		" />
		</a>
		
        <div id="text-view-text-title"><?php 
echo $this->item->title;
?>
</div>
        <div id="text-view-text-author">
			<?php 
echo JText::_('BY');
?>
 
Ejemplo n.º 2
0
 public function generateTextContent($item, $userId, $index, $inProfile = false, $authorsection = false, $inHome = false, $type = 'default', $follower = false)
 {
     $draftClass = '';
     if ($type == 'draft') {
         $draftClass = ' draft';
     }
     $authorId = $item->created_by;
     $html = '<div class="text' . $draftClass . '" data-index="' . $index . '">';
     if (!$inProfile) {
         if ($item->first) {
             $html .= '<div class="category-color" style="background: #E02424"></div>';
         }
     }
     // #00B60E = green, #E65151 = red
     //else if($follower === true)
     //	$html .= '<div class="category-color" style="background: #00B60E"></div>'; //#c1c2c2 = gray
     if ($inProfile == false) {
         $html .= '<div class="save-container" data-text-id="' . $item->id . '">';
         if ($item->pinned) {
             $html .= '<div class="text-pinned-icon" title="' . JText::_('PINNED') . '" ></div>';
         }
         $html .= '</div>';
     }
     $html .= '<div class="text-data" >';
     $html .= '<div class="text-title-container">';
     if ($inHome) {
         $user_picture = ideary::getUserImagePath($authorId, "200");
         if ($userId != $item->created_by) {
             $authorLink .= JRoute::_('index.php?option=com_contact&view=public&id=' . $item->created_by);
         } else {
             $authorLink .= JRoute::_('index.php?option=com_users&view=profile&user_id=' . $item->created_by);
         }
         $html .= '<a class="text-img-avatar" href="' . $authorLink . '">';
         $html .= "<img src='{$user_picture}'>";
         $html .= '</a>';
     }
     if ($type == 'draft') {
         $html .= '<a href="' . JRoute::_("index.php?option=com_content&Itemid=101&a_id=" . $item->id . "&task=article.edit") . '">';
     } else {
         $html .= '<a style="display: inline-block; margin-left: 10px; background: transparent; " href="' . JRoute::_("index.php?option=com_content&view=article&id=" . $item->id) . '">';
     }
     $html .= '<div class="text-title">';
     $html .= $item->title;
     $html .= '</div>';
     $html .= '</a>';
     $html .= '</div>';
     $html .= '<div class="text-actions">';
     $html .= '<div class="text-content">';
     //$html .= strip_tags(html_entity_decode($item->introtext));
     $html .= strip_tags($item->introtext, "<br>");
     $html .= '</div>';
     $html .= '<div class="text-bottom">';
     $html .= '<div class="text-bottom-content">';
     if ($type == 'draft') {
         $html .= '<div class="draft-bottom-left">';
         $html .= '<a href="' . JRoute::_("index.php?option=com_content&Itemid=101&a_id=" . $item->id . "&task=article.edit") . '">';
         $html .= '<div class="draft-edit" title="' . JTEXT::_('EDIT_DRAFT') . '"></div>';
         $html .= '</a>';
         $html .= '<div class="draft-delete" data-text-id="' . $item->id . '" title="' . JTEXT::_('DELETE_DRAFT') . '"></div>';
         $html .= '</div>';
         $html .= '<div class="draft-bottom-right">';
         $html .= JTEXT::_('DRAFT');
         $html .= '</div>';
     } else {
         if ($type == 'mine') {
             $html .= '<a href="' . JRoute::_("index.php?option=com_content&Itemid=101&a_id=" . $item->id . "&task=article.edit") . '">';
             $html .= '<div class="edit-text" title="' . JTEXT::_('EDIT_TEXT') . '"></div>';
             $html .= '</a>';
         } else {
             /*  $taglist = ideary::getTextTags($item->id,3);
             			   if ($taglist!=""){
             					$html .= '<div class="text-author" style="font-weight:normal;">';
             					$html .= "Tags: " . $taglist;
             					$html .= '</div>';
             			    }
             				*/
             if ($authorsection == false) {
                 $html .= '<div class="text-author">';
                 $author = $item->author;
                 $author = $item->created_by_alias ? $item->created_by_alias : $author;
                 $html .= JText::_('BY') . "&nbsp;";
                 //if($follower)
                 //	$html .= "<strong>";
                 if ($userId != $item->created_by) {
                     $html .= JHtml::_('link', JRoute::_('index.php?option=com_contact&view=public&id=' . $item->created_by), $author);
                 } else {
                     $html .= JHtml::_('link', JRoute::_('index.php?option=com_users&view=profile&user_id=' . $item->created_by), $author);
                 }
                 //if($follower)
                 //	$html .= "</strong>";
                 if ($item->created != "0000-00-00 00:00:00") {
                     $timeZone = 'America/Buenos_Aires';
                     $curDate = date_create();
                     $textDate = date_create($item->created);
                     if ($textDate > $curDate) {
                         $textDate = new DateTime($item->created, new DateTimeZone('GMT'));
                         $textDate->setTimeZone(new DateTimeZone($timeZone));
                     }
                     $dateDiff = $textDate->diff($curDate);
                     if ($dateDiff->days > 14) {
                         $dateDiff = "";
                     } else {
                         if ($dateDiff->days > 1) {
                             $dateDiff = str_replace('{X}', $dateDiff->days, $dateDiff->days > 1 ? JTEXT::_('X_DAYS_AGO') : JTEXT::_('X_DAY_AGO'));
                         } else {
                             if ($dateDiff->days > 0) {
                                 $dateDiff = JTEXT::_('YESTERDAY');
                             } else {
                                 if ($dateDiff->h > 0) {
                                     $dateDiff = str_replace('{X}', $dateDiff->h, $dateDiff->h > 1 ? JTEXT::_('X_HOURS_AGO') : JTEXT::_('X_HOUR_AGO'));
                                 } else {
                                     if ($dateDiff->i > 0) {
                                         $dateDiff = str_replace('{X}', $dateDiff->i, $dateDiff->i > 1 ? JTEXT::_('X_MINUTES_AGO') : JTEXT::_('X_MINUTE_AGO'));
                                     } else {
                                         $dateDiff = str_replace('{X}', $dateDiff->s, $dateDiff->s > 1 ? JTEXT::_('X_SECONDS_AGO') : JTEXT::_('X_SECOND_AGO'));
                                     }
                                 }
                             }
                         }
                     }
                     $dateDiff = strtolower($dateDiff);
                     $html .= "&nbsp;<div class=\"age\" >{$dateDiff}</div>";
                 }
                 $html .= "</div>";
             }
         }
         //if($inHome){
         $countComments = Ideary::getCommentsCountByTextId($item->id);
         if ($countComments > 0) {
             $comment_label = $countComments > 1 ? 'X-COMMENTS' : 'X-COMMENT';
             // $html .= '<a href="'.JRoute::_("index.php?option=com_content&view=article&id=".$item->id."#comments-section").'" style="text-decoration: none;">';
             $html .= '<div class="comments-count-container" title="' . str_replace('{x}', $countComments, JText::_($comment_label)) . '">';
             $html .= '<div class="comments-count-bg"></div>';
             $html .= '<div class="comments-count-num">' . $countComments . '</div>';
             $html .= '</div>';
             // $html .= '</a>';
         }
         //}
         $countApplauses = ideary::getCountApplausesByTextId($item->id);
         if ($countApplauses > 0) {
             $clap_label = $countApplauses > 1 ? 'X-APPLAUSES' : 'X-APPLAUSE';
             $html .= '<div class="applauses applauses-clickable" data-text-id="' . $item->id . '" data-text-title="' . $item->title . '" title="' . str_replace('{x}', $countApplauses, JText::_($clap_label)) . '">';
             $html .= '<div class="icon_applauses"></div>';
             $html .= '<div class="count_applauses">' . $countApplauses . '</div>';
             $html .= '</div>';
         }
     }
     $html .= '</div>';
     $html .= '</div>';
     $html .= '</div>';
     $html .= '</div>';
     $html .= '</div>';
     return $html;
 }