Beispiel #1
0
        ?>
			<div>
			<link rel="stylesheet" href="<?php 
        echo JURI::root();
        ?>
plugins/community/activitycomment/style.css" type="text/css" />
			<script type="text/javascript" src="<?php 
        echo JURI::root();
        ?>
plugins/community/activitycomment/activitycomment.js"></script>
			<?php 
        JPlugin::loadLanguage('plg_activitycomment', JPATH_ADMINISTRATOR);
        require_once JPATH_PLUGINS . DS . 'community' . DS . 'activitycomment' . DS . 'helper.php';
        $my =& CFactory::getUser();
        $rows = ActivityComments::getComments($act->id);
        $likes = ActivityComments::getLikes($act->id);
        ?>
			<?php 
        if ($my->id != 0) {
            $params = ActivityComments::getParams();
            $showLikeIcon = $params->get('uselikeicon', 1) == 1 ? '' : ' noicon';
            $showCommentIcon = $params->get('usecommenticon', 1) == 1 ? '' : ' noicon';
            ?>
			<span class="small"><a class="activity-comments<?php 
            echo $showCommentIcon;
            ?>
" href="javascript:void(0);" onclick="activityShowComment('<?php 
            echo $act->id;
            ?>
');"><?php 
            echo JText::_('ADD COMMENT');
Beispiel #2
0
 function rebuildItemString($id)
 {
     require_once JPATH_PLUGINS . DS . 'community' . DS . 'activitycomment' . DS . 'helper.php';
     $items = ActivityComments::getLikes($id);
     $rows = count($items);
     $i = 0;
     $text = '';
     $comma = ' , ';
     $my =& CFactory::getUser();
     if ($items) {
         foreach ($items as $item) {
             $i++;
             $user =& CFactory::getUser($item->userid);
             $name = $my->id == $item->userid ? JText::_('YOU') : $user->getDisplayName();
             if ($i == 1) {
                 $comma = '';
             } elseif ($i == $rows) {
                 $comma = ' ' . JText::_('AND') . ' ';
             } else {
                 $comma = ' , ';
             }
             $text .= '<span id="like-' . $id . '-' . $my->id . '">' . $comma . '<a href="' . CRoute::_('index.php?option=com_community&view=profile&userid=' . $my->id) . '">' . $name . '</a></span>';
         }
         $text .= '<span>' . JText::_('LIKE THIS') . '</span>';
     }
     return $text;
 }