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();
 }
 function isRemoveAllowedAll()
 {
     if ($this->_iId == $this->_getAuthorId() && getParam('enable_cmts_profile_delete') == 'on') {
         return true;
     }
     return parent::isRemoveAllowedAll();
 }
Exemple #3
0
 function isRemoveAllowedAll()
 {
     $oMain = $this->getMain();
     $aDataEntry = $oMain->_oDb->getEntryById($this->getId());
     if ($oMain->isAllowedCreatorCommentsDeleteAndEdit($aDataEntry)) {
         return true;
     }
     return parent::isRemoveAllowedAll();
 }
Exemple #4
0
 function isPostReplyAllowed()
 {
     if (!parent::isPostReplyAllowed()) {
         return false;
     }
     $oMain = $this->getMain();
     $aAdPost = $oMain->_oDb->getAdInfo($this->getId());
     return $oMain->isAllowedComments($aAdPost);
 }
 function isRemoveAllowedAll()
 {
     $oMain = $this->getMain();
     $aBlogPost = $oMain->_oDb->getPostInfo($this->getId(), 0, true);
     if ($oMain->isAllowedCreatorCommentsDeleteAndEdit($aBlogPost)) {
         return true;
     }
     return parent::isRemoveAllowedAll();
 }
Exemple #6
0
 function isRemoveAllowedAll()
 {
     $oMain = $this->getMain();
     $aEvent = $oMain->_oDb->getEntryByIdAndOwner($this->getId(), 0, true);
     if ($oMain->isAllowedCreatorCommentsDeleteAndEdit($aEvent)) {
         return true;
     }
     return parent::isRemoveAllowedAll();
 }
Exemple #7
0
 function isPostReplyAllowed()
 {
     if (!parent::isPostReplyAllowed()) {
         return false;
     }
     $oMain = BxDolModule::getInstance('BxAdsModule');
     $aAdPost = $oMain->_oDb->getAdInfo($this->getId());
     return $oMain->isAllowedComments($aAdPost);
 }
Exemple #8
0
 function actionCmtPost()
 {
     $mixedResult = parent::actionCmtPost();
     if (empty($mixedResult)) {
         return $mixedResult;
     }
     $aEvent = $this->_oModule->_oDb->getEvents(array('browse' => 'id', 'object_id' => (int) $this->getId()));
     if (isset($aEvent['owner_id']) && (int) $aEvent['owner_id'] > 0) {
         //--- Wall -> Update for Alerts Engine ---//
         bx_import('BxDolAlerts');
         $oAlert = new BxDolAlerts('bx_' . $this->_oModule->_oConfig->getUri(), 'update', $aEvent['owner_id']);
         $oAlert->alert();
         //--- Wall -> Update for Alerts Engine ---//
     }
     return $mixedResult;
 }
Exemple #9
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 __construct($sSystem, $iId, $iInit = 1)
 {
     parent::__construct($sSystem, $iId, $iInit);
     $this->_oModule = null;
 }
 /**
  * Constructor
  */
 function __construct($sSystem, $iId)
 {
     parent::__construct($sSystem, $iId);
     $this->_oModule = BxDolModule::getInstance('BxSitesModule');
 }
 /**
  * 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'])))));
 }
 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));
 }
$iLoggedID = getLoggedId();
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;
    }
 function BxDolTextCmts($sSystem, $iId, $iInit = 1)
 {
     parent::BxTemplCmtsView($sSystem, $iId, $iInit);
     $this->_oModule = null;
 }
Exemple #17
0
 /**
  * Constructor
  */
 function BxPollCmts($sSystem, $iId)
 {
     parent::BxTemplCmtsView($sSystem, $iId);
     $this->_oModule = BxDolModule::getInstance('BxPollModule');
 }
Exemple #18
0
 /**
  * Constructor
  */
 function BxSitesCmts($sSystem, $iId)
 {
     parent::BxTemplCmtsView($sSystem, $iId);
 }
 function getWallPostOutline($aEvent, $sIcon = 'save', $aParams = array())
 {
     $sPrefix = $this->_oConfig->getMainPrefix();
     $sPrefixAlbum = $sPrefix . '_albums';
     $aOwner = getProfileInfo((int) $aEvent['owner_id']);
     $aObjectIds = strpos($aEvent['object_id'], ',') !== false ? explode(',', $aEvent['object_id']) : array($aEvent['object_id']);
     rsort($aObjectIds);
     $iItems = count($aObjectIds);
     $iItemsLimit = isset($aParams['grouped']['items_limit']) ? (int) $aParams['grouped']['items_limit'] : 3;
     if ($iItems > $iItemsLimit) {
         $aObjectIds = array_slice($aObjectIds, 0, $iItemsLimit);
     }
     $bSave = false;
     $aContent = array();
     if (!empty($aEvent['content'])) {
         $aContent = unserialize($aEvent['content']);
     }
     if (!isset($aContent['idims'])) {
         $aContent['idims'] = array();
     }
     $sClassName = $this->_oConfig->getClassPrefix() . 'Search';
     bx_import('Search', $this->_aModule);
     $oSearch = new $sClassName();
     $sItemThumbnailType = isset($aParams['thumbnail_type']) ? $aParams['thumbnail_type'] : 'browse';
     $iDeleted = 0;
     $aItems = $aTmplItems = array();
     foreach ($aObjectIds as $iId) {
         $aItem = $oSearch->serviceGetItemArray($iId, $sItemThumbnailType);
         if (empty($aItem)) {
             $iDeleted++;
         } else {
             if ($aItem['status'] == 'approved' && $this->oAlbumPrivacy->check('album_view', $aItem['album_id'], $this->oModule->_iProfileId)) {
                 if (!isset($aContent['idims'][$iId])) {
                     $sPath = isset($aItem['file_path']) && file_exists($aItem['file_path']) ? $aItem['file_path'] : $aItem['file'];
                     $aContent['idims'][$iId] = BxDolImageResize::instance()->getImageSize($sPath);
                     $bSave = true;
                 }
                 $aItem['dims'] = $aContent['idims'][$iId];
                 $aItems[] = $aItem;
                 $aItem2x = $oSearch->serviceGetItemArray($iId, $sItemThumbnailType . '2x');
                 $aTmplItems[] = array_merge($aItem, array('mod_prefix' => $sPrefix, 'item_width' => $aItem['dims']['w'], 'item_height' => $aItem['dims']['h'], 'item_icon' => $aItem['file'], 'item_icon_2x' => !empty($aItem2x['file']) ? $aItem2x['file'] : $aItem['file'], 'item_page' => $aItem['url'], 'item_title' => $aItem['title']));
             }
         }
     }
     if ($iDeleted == count($aObjectIds)) {
         return array('perform_delete' => true);
     }
     if (empty($aOwner) || empty($aItems)) {
         return "";
     }
     $aResult = array();
     if ($bSave) {
         $aResult['save']['content'] = serialize($aContent);
     }
     $sCss = "";
     if ($aEvent['js_mode']) {
         $sCss = $this->_oTemplate->addCss('wall_outline.css', true);
     } else {
         $this->_oTemplate->addCss('wall_outline.css');
     }
     $iOwner = (int) $aEvent['owner_id'];
     $sOwner = getNickName($iOwner);
     $sOwnerLink = getProfileLink($iOwner);
     //--- Grouped events
     $iItems = count($aItems);
     if ($iItems > 1) {
         $aExtra = unserialize($aEvent['content']);
         $sAlbumUri = $aExtra['album'];
         $oAlbum = new BxDolAlbums($sPrefix);
         $aAlbumInfo = $oAlbum->getAlbumInfo(array('fileUri' => $sAlbumUri, 'owner' => $iOwner));
         $oAlbumCmts = new BxTemplCmtsView($sPrefixAlbum, $aAlbumInfo['ID']);
         $aAlbumInfo['comments_count'] = (int) $oAlbumCmts->getObjectCommentsCount();
         $aAlbumInfo['Url'] = $oSearch->getCurrentUrl('album', $aAlbumInfo['ID'], $aAlbumInfo['Uri']) . '/owner/' . getUsername($iOwner);
         $sTmplName = isset($aParams['templates']['grouped']) ? $aParams['templates']['grouped'] : 'modules/boonex/wall/|outline_item_image_grouped.html';
         $aResult['content'] = $sCss . $this->_oTemplate->parseHtmlByName($sTmplName, array('mod_prefix' => $sPrefix, 'mod_icon' => $sIcon, 'user_name' => $sOwner, 'user_link' => $sOwnerLink, 'bx_repeat:items' => $aTmplItems, 'album_url' => $aAlbumInfo['Url'], 'album_title' => $aAlbumInfo['Caption'], 'album_description' => strmaxtextlen($aAlbumInfo['Description'], 200), 'album_comments' => (int) $aAlbumInfo['comments_count'] > 0 ? _t('_wall_n_comments', $aAlbumInfo['comments_count']) : _t('_wall_no_comments'), 'album_comments_link' => $aAlbumInfo['Url'] . '#cmta-' . $sPrefixAlbum . '-' . $aAlbumInfo['ID'], 'post_id' => $aEvent['id'], 'post_ago' => $aEvent['ago']));
         return $aResult;
     }
     //--- Single public event
     $aItem = $aItems[0];
     $aTmplItem = $aTmplItems[0];
     $sTmplName = isset($aParams['templates']['single']) ? $aParams['templates']['single'] : 'modules/boonex/wall/|outline_item_image.html';
     $aResult['content'] = $sCss . $this->_oTemplate->parseHtmlByName($sTmplName, array_merge($aTmplItem, array('mod_prefix' => $sPrefix, 'mod_icon' => $sIcon, 'user_name' => $sOwner, 'user_link' => $sOwnerLink, 'item_page' => $aItem['url'], 'item_title' => $aItem['title'], 'item_description' => strmaxtextlen($aItem['description'], 200), 'item_comments' => (int) $aItem['comments_count'] > 0 ? _t('_wall_n_comments', $aItem['comments_count']) : _t('_wall_no_comments'), 'item_comments_link' => $aItem['url'] . '#cmta-' . $sPrefix . '-' . $aItem['id'], 'post_id' => $aEvent['id'], 'post_ago' => $aEvent['ago'])));
     return $aResult;
 }
Exemple #20
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'])));
 }
* Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 
* http://creativecommons.org/licenses/by/3.0/
*
* Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the Creative Commons Attribution 3.0 License for more details. 
* You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 
* see license.txt file; if not, write to marketing@boonex.com
***************************************************************************/
require_once 'inc/header.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'design.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'profiles.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'members.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'utils.inc.php';
require_once BX_DIRECTORY_PATH_ROOT . "templates/tmpl_{$tmpl}/scripts/BxTemplCmtsView.php";
if (!($logged['admin'] = member_auth(1, false))) {
    if (!($logged['member'] = member_auth(0, false))) {
        if (!($logged['aff'] = member_auth(2, false))) {
            $logged['moderator'] = member_auth(3, false);
        }
    }
}
$sSys = isset($_REQUEST['sys']) ? $_REQUEST['sys'] : '';
$sAction = isset($_REQUEST['action']) && preg_match('/^[A-Za-z_-]+$/', $_REQUEST['action']) ? $_REQUEST['action'] : '';
$iId = (int) $_REQUEST['id'];
$oCmts = new BxTemplCmtsView('', 0);
if ($sSys && $sAction && $iId && $oCmts->isValidSystem($sSys)) {
    $oCmts = new BxTemplCmtsView($sSys, $iId, true);
    $sMethod = 'action' . $sAction;
    echo $oCmts->{$sMethod}();
}
 function BxDolFilesCmtsAlbums($sSystem, $iId, $iInit = 1)
 {
     parent::BxTemplCmtsView($sSystem, $iId, $iInit);
     $this->_oModule = null;
 }