Пример #1
0
        <?php 
    if ($act->commentCount > 0) {
        ?>
            <?php 
        #echo $act->commentLast;
        $comments = $act->commentsAll;
        #echo "<pre>";var_dump($comments);die();
        #$comments = $comments[$act->id];
        $commentLimit = $config->get('stream_default_comments');
        $comments = array_reverse($comments);
        if ($act->commentCount > $commentLimit) {
            $comments = array_slice($comments, sizeof($comments) - $commentLimit, $commentLimit);
        }
        foreach ($comments as $comment) {
            $comment->params = new CParameter($comment->params);
            echo CWall::formatComment($comment);
        }
        ?>
        <?php 
    }
    ?>
    </div>

    <?php 
    if ($allowComment) {
        ?>
        <div class="joms-comment__reply joms-js--newcomment joms-js--newcomment-<?php 
        echo $act->id;
        ?>
" data-id="<?php 
        echo $act->id;
Пример #2
0
 /**
  * Fill up the 'all comment fields with.. all comments
  *
  */
 public function ajaxStreamShowComments($actid, $type = false)
 {
     if ($type) {
         $this->ajaxWallShowComments($actid, $type);
         return;
     }
     $filter = JFilterInput::getInstance();
     $actid = $filter->clean($actid, 'int');
     $wallModel = CFactory::getModel('wall');
     // Pull the activity record and find out the actor
     // only allow comment if the actor is a friend of current user
     $act = JTable::getInstance('Activity', 'CTable');
     $act->load($actid);
     $params = new CParameter($act->params);
     if ($act->comment_type == 'photos' && $params->get('batchcount', 0) > 1) {
         $act->comment_type = 'albums';
         $act->comment_id = $act->cid;
     } else {
         if ($act->comment_type == 'videos.linking') {
             $act->comment_type = 'videos';
             $act->comment_id = $act->cid;
         }
     }
     $comments = $wallModel->getAllPost($act->comment_type, $act->comment_id);
     $commentsHTML = '';
     CWall::triggerWallComments($comments, false);
     foreach ($comments as $row) {
         $row->params = new CParameter($row->get('params', '{}'));
         if ($row->type == 'albums' && $row->params->get('activityId', NULL) != $actid && $params->get('batchcount', 0) > 1) {
             continue;
         }
         $commentsHTML .= CWall::formatComment($row);
     }
     $json = array();
     $json['success'] = true;
     $json['html'] = $commentsHTML;
     die(json_encode($json));
 }
Пример #3
0
 /**
  *
  */
 public function getLastComment()
 {
     //return $this->_comment_last;
     CFactory::load('libraries', 'wall');
     $wall = new stdClass();
     $wall->id = $this->_comment_last_id;
     $wall->date = $this->_comment_date;
     $wall->post_by = $this->_comment_last_by;
     $wall->comment = $this->_comment_last;
     return CWall::formatComment($wall);
 }
Пример #4
0
 /**
  *
  */
 public function getLastComment()
 {
     //return $this->_comment_last;
     $wall = new stdClass();
     $wall->id = $this->_comment_last_id;
     $wall->date = $this->_comment_date;
     $wall->post_by = $this->_comment_last_by;
     $wall->comment = $this->_comment_last;
     $wall->contentid = $this->id;
     $wall->type = $this->_comment_type;
     $wall->params = new CParameter($this->_comment_params);
     return CWall::formatComment($wall);
 }
Пример #5
0
 /**
  * Fill up the 'all comment fields with.. all comments
  *
  */
 public function ajaxStreamShowComments($actid)
 {
     $filter = JFilterInput::getInstance();
     $actid = $filter->clean($actid, 'int');
     $objResponse = new JAXResponse();
     $wallModel = CFactory::getModel('wall');
     CFactory::load('libraries', 'wall');
     CFactory::load('libraries', 'activities');
     // Pull the activity record and find out the actor
     // only allow comment if the actor is a friend of current user
     $act =& JTable::getInstance('Activity', 'CTable');
     $act->load($actid);
     $comments = $wallModel->getAllPost($act->comment_type, $act->comment_id);
     $commentsHTML = '';
     foreach ($comments as $row) {
         $commentsHTML .= CWall::formatComment($row);
     }
     $objResponse->addScriptCall('joms.miniwall.loadall', $actid, $commentsHTML);
     return $objResponse->sendResponse();
 }