function getBlockCode_Comments()
 {
     bx_import('BxTemplCmtsView');
     $this->oTemplate->addCss('cmts.css');
     $oCmtsView = new BxTemplCmtsView($this->oConfig->getMainPrefix() . '_albums', $this->aInfo['ID']);
     if (!$oCmtsView->isEnabled()) {
         return '';
     }
     return $oCmtsView->getCommentsFirst();
 }
 /**
  * DEPRICATED, saved for backward compatibility
  */
 function serviceGetWallPostComment($aEvent, $aParams = array())
 {
     $iId = (int) $aEvent['object_id'];
     $iOwner = (int) $aEvent['owner_id'];
     $sOwner = getNickName($iOwner);
     $aItem = $this->serviceGetEntry($iId, 'browse');
     if (empty($aItem) || !is_array($aItem)) {
         return array('perform_delete' => true);
     }
     $aContent = unserialize($aEvent['content']);
     if (empty($aContent) || !isset($aContent['comment_id'])) {
         return '';
     }
     if (!$this->oPrivacy->check('album_view', (int) $aItem['album_id'], $this->oModule->_iProfileId)) {
         return '';
     }
     bx_import('BxTemplCmtsView');
     $oCmts = new BxTemplCmtsView($this->oModule->_oConfig->getMainPrefix(), $iId);
     if (!$oCmts->isEnabled()) {
         return '';
     }
     $aComment = $oCmts->getCommentRow((int) $aContent['comment_id']);
     $sCss = '';
     $sUri = $this->oModule->_oConfig->getUri();
     if ($aEvent['js_mode']) {
         $sCss = $this->oModule->_oTemplate->addCss('wall_post.css', true);
     } else {
         $this->oModule->_oTemplate->addCss('wall_post.css');
     }
     $sTextAddedNew = _t('_bx_' . $sUri . '_wall_added_new_comment');
     $sTextWallObject = _t('_bx_' . $sUri . '_wall_object');
     $sTmplName = isset($aParams['templates']['main']) ? $aParams['templates']['main'] : 'modules/boonex/wall/|timeline_comment.html';
     $sTmplNameSnippet = isset($aParams['templates']['snippet']) ? $aParams['templates']['snippet'] : 'modules/boonex/wall/|timeline_comment_files.html';
     return array('title' => $sOwner . ' ' . $sTextAddedNew . ' ' . $sTextWallObject, 'description' => $aComment['cmt_text'], 'content' => $sCss . $this->oModule->_oTemplate->parseHtmlByName($sTmplName, array('mod_prefix' => 'bx_' . $sUri, 'cpt_user_name' => $sOwner, 'cpt_added_new' => $sTextAddedNew, 'cpt_object' => $sTextWallObject, 'cpt_item_url' => $aItem['url'], 'cnt_comment_text' => $aComment['cmt_text'], 'snippet' => $this->oModule->_oTemplate->parseHtmlByName($sTmplNameSnippet, array('mod_prefix' => 'bx_' . $sUri, 'cnt_item_page' => $aItem['url'], 'cnt_item_icon' => $aItem['file'], 'cnt_item_title' => $aItem['title'], 'cnt_item_title_attr' => bx_html_attribute($aItem['title']), 'cnt_item_description' => $aItem['description'], 'post_id' => $aEvent['id'])))));
 }
Exemple #3
0
 function getBlockCode_ViewComments()
 {
     bx_import('BxTemplCmtsView');
     $this->oTemplate->addCss('cmts.css');
     $oCmtsView = new BxTemplCmtsView('bx_files', $this->aFileInfo['medID']);
     if (!$oCmtsView->isEnabled()) {
         return '';
     }
     return $oCmtsView->getCommentsFirst();
 }
 function getBlockCode_ViewComments()
 {
     if ($this->_oConfig->isCommentsAllowed() && $this->_oSites->oPrivacy->check('comments', $this->_aSite['id'], $this->_oSites->iOwnerId)) {
         bx_import('BxTemplCmtsView');
         $o = new BxTemplCmtsView('bx_sites', $this->_aSite['id']);
         if ($o->isEnabled()) {
             return $o->getCommentsFirst();
         }
     }
     return '';
 }
 function serviceGetWallPostComment($aEvent)
 {
     $iId = (int) $aEvent['object_id'];
     $iOwner = (int) $aEvent['owner_id'];
     $sOwner = getNickName($iOwner);
     $aItem = $this->serviceGetFileArray($iId);
     if (empty($aItem) || !is_array($aItem)) {
         return array('perform_delete' => true);
     }
     $aContent = unserialize($aEvent['content']);
     if (empty($aContent) || !isset($aContent['comment_id'])) {
         return '';
     }
     bx_import('BxTemplCmtsView');
     $oCmts = new BxTemplCmtsView($this->oModule->_oConfig->getMainPrefix(), $iId);
     if (!$oCmts->isEnabled()) {
         return '';
     }
     $aComment = $oCmts->getCommentRow((int) $aContent['comment_id']);
     $sCss = '';
     if ($aEvent['js_mode']) {
         $sCss = $this->oModule->_oTemplate->addCss('wall_post.css', true);
     } else {
         $this->oModule->_oTemplate->addCss('wall_post.css');
     }
     $sTextAddedNew = _t('_bx_files_wall_added_new_comment');
     $sTextWallObject = _t('_bx_files_wall_object');
     $aTmplVars = array('cpt_user_name' => $sOwner, 'cpt_added_new' => $sTextAddedNew, 'cpt_object' => $sTextWallObject, 'cpt_item_url' => $aItem['url'], 'cnt_comment_text' => $aComment['cmt_text'], 'cnt_item_page' => $aItem['url'], 'cnt_item_width' => $aItem['width'], 'cnt_item_height' => $aItem['height'], 'cnt_item_icon' => $aItem['file'], 'cnt_item_title' => $aItem['title'], 'cnt_item_description' => $aItem['description'], 'post_id' => $aEvent['id']);
     return array('title' => $sOwner . ' ' . $sTextAddedNew . ' ' . $sTextWallObject, 'description' => $aComment['cmt_text'], 'content' => $sCss . $this->oModule->_oTemplate->parseHtmlByName('wall_post_comment.html', $aTmplVars));
 }
if (isset($_GET['action']) && $_GET['action'] == 'get_prof_status_mess') {
    if ($iLoggedID) {
        bx_import('BxDolUserStatusView');
        header('Content-Type: text/html; charset=utf-8');
        echo BxDolUserStatusView::getStatusPageLight($iLoggedID);
    }
    exit;
}
$sAction = bx_get('action');
if ($sAction !== false && $sAction == 'get_prof_comment_block') {
    $iProfileID = (int) bx_get('id');
    if ($iProfileID) {
        $sCloseC = _t('_Close');
        bx_import('BxTemplCmtsView');
        $oCmtsView = new BxTemplCmtsView('profile', $iProfileID);
        if (!$oCmtsView->isEnabled()) {
            exit;
        }
        $sCloseImg = getTemplateImage('close.gif');
        $sCaptionItem = <<<BLAH
<div class="dbTopMenu">
    <i class="login_ajx_close sys-icon times"></i>
</div>
BLAH;
        $sCommentsBlock = $GLOBALS['oFunctions']->transBox(DesignBoxContent(_t('_Comments'), $oCmtsView->_getPostReplyBox(), 1, $sCaptionItem), false);
        echo <<<EOF
<style>
    div.cmt-post-reply {
        position: relative;
    }
</style>
Exemple #7
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->getPollInfo($iId);
     if (empty($aItem)) {
         return array('perform_delete' => true);
     }
     if (!$this->oPrivacy->check('view', $iId, getLoggedId())) {
         return '';
     }
     $aContent = unserialize($aEvent['content']);
     if (empty($aContent) || !isset($aContent['comment_id'])) {
         return '';
     }
     bx_import('BxTemplCmtsView');
     $oCmts = new BxTemplCmtsView('bx_poll', $iId);
     if (!$oCmts->isEnabled()) {
         return '';
     }
     $aItem = array_shift($aItem);
     $aItem['url'] = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . '&action=show_poll_info&id=' . $aItem['id_poll'];
     $aComment = $oCmts->getCommentRow((int) $aContent['comment_id']);
     if (empty($aComment) || !is_array($aComment)) {
         return array('perform_delete' => true);
     }
     $sCss = '';
     if ($aEvent['js_mode']) {
         $sCss = $this->_oTemplate->addCss('wall_post.css', true);
     } else {
         $this->_oTemplate->addCss('wall_post.css');
     }
     $sTextWallObject = _t('_bx_poll_wall_object');
     return array('title' => _t('_bx_poll_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_poll_wall_added_new_comment'), 'cpt_object' => $sTextWallObject, 'cpt_item_url' => $aItem['url'], 'cnt_comment_text' => $aComment['cmt_text'], 'cnt_item_page' => $aItem['url'], 'cnt_item_title' => $aItem['poll_question'], 'cnt_item_description' => $this->_getWallContent($aItem), 'post_id' => $aEvent['id'])));
 }