Exemplo n.º 1
0
 /**
  * DEPRICATED, saved for backward compatibility
  */
 function serviceGetWallPostComment($aEvent)
 {
     $iId = (int) $aEvent['object_id'];
     $iOwner = (int) $aEvent['owner_id'];
     $sOwner = getNickName($iOwner);
     $aItem = $this->_oDb->getPostInfo($iId);
     if (empty($aItem) || !is_array($aItem)) {
         return array('perform_delete' => true);
     }
     if (!$this->oPrivacy->check('view', $iId, $this->_iVisitorID)) {
         return;
     }
     $aContent = unserialize($aEvent['content']);
     if (empty($aContent) || !isset($aContent['comment_id'])) {
         return '';
     }
     bx_import('Cmts', $this->_aModule);
     $oCmts = new BxBlogsCmts($this->_oConfig->getCommentSystemName(), $iId);
     if (!$oCmts->isEnabled()) {
         return '';
     }
     $aItem['url'] = $this->genUrl($aItem['ID'], $aItem['PostUri'], 'entry');
     $aComment = $oCmts->getCommentRow((int) $aContent['comment_id']);
     $sCss = '';
     if ($aEvent['js_mode']) {
         $sCss = $this->_oTemplate->addCss(array('wall_post.css', 'wall_post_phone.css', 'blogs_common.css'), true);
     } else {
         $this->_oTemplate->addCss(array('wall_post.css', 'wall_post_phone.css', 'blogs_common.css'));
     }
     $oTmpBlogSearch = false;
     $sPostUnit = $this->_GenPosts(5, 1, 'post', array('id' => $aItem['PostID']), 'last', $oTmpBlogSearch);
     if ($oTmpBlogSearch->aCurrent['paginate']['totalNum'] == 0) {
         return '';
     }
     $sTextWallObject = _t('_bx_blog_wall_object');
     return array('title' => _t('_bx_blog_wall_added_new_title_comment', $sOwner, $sTextWallObject), 'description' => $aComment['cmt_text'], 'content' => $sCss . $this->_oTemplate->parseHtmlByName('wall_post_comment.html', array('cpt_user_name' => $sOwner, 'cpt_added_new' => _t('_bx_blog_wall_added_new_comment'), 'cpt_object' => $sTextWallObject, 'cpt_item_url' => $aItem['url'], 'cnt_comment_text' => $aComment['cmt_text'], 'unit' => $sPostUnit, 'post_id' => $aEvent['id'])));
 }
Exemplo n.º 2
0
 function getCommentsBlock()
 {
     require_once $this->_oConfig->getClassPath() . 'BxBlogsCmts.php';
     $_oCmtsView = new BxBlogsCmts($this->_oConfig->getCommentSystemName(), $this->iViewingPostID);
     $sPostComm = $_oCmtsView->getExtraCss();
     $sPostComm .= $_oCmtsView->getExtraJs();
     $sPostComm .= !$_oCmtsView->isEnabled($this->aViewingPostInfo) ? MsgBox(_t('_bx_blog_Comments_is_disabled')) : $_oCmtsView->getCommentsFirst();
     return $sPostComm;
 }