当前位置: 首页>>代码示例>>PHP>>正文


PHP BxDolCmts类代码示例

本文整理汇总了PHP中BxDolCmts的典型用法代码示例。如果您正苦于以下问题:PHP BxDolCmts类的具体用法?PHP BxDolCmts怎么用?PHP BxDolCmts使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了BxDolCmts类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: post

function post($sSystem, $iId, $iCmtAuthorId, $iCmtParentId, $iMood, $sFileId)
{
    global $sIncPath;
    global $sModule;
    global $sHomeUrl;
    $iId = (int) $iId;
    $iCmtParentId = (int) $iCmtParentId;
    $iMood = (int) $iMood;
    bx_import('BxDolCmts');
    $oCmts = BxDolCmts::getObjectInstance($sSystem, $iId);
    if (!$oCmts) {
        return 0;
    }
    $sText = '<iframe width="100%" height="240" src="[ray_url]modules/video_comments/embed.php?id=' . $sFileId . '" frameborder="0" allowfullscreen></iframe>';
    $mixedOverrideResult = null;
    $oAlert = new BxDolAlerts('bx_video_comments', 'post', $sFileId, getLoggedId(), array('override' => &$mixedOverrideResult, 'text' => &$sText, 'file_id' => &$sFileId, 'object_id' => &$iId, 'author' => &$iCmtAuthorId, 'parent_id' => &$iCmtParentId, 'mood' => &$iMood));
    $oAlert->alert();
    if (null !== $mixedOverrideResult) {
        return $mixedOverrideResult;
    }
    $iCmtNewId = $oCmts->_oQuery->addComment($iId, $iCmtParentId, $iCmtAuthorId, $sText, $iMood);
    if (false === $iCmtNewId) {
        return 0;
    }
    bx_import('BxDolAlerts');
    $oZ = new BxDolAlerts($sSystem, 'commentPost', $oCmts->getId(), $oCmts->_getAuthorId(), array('comment_id' => $iCmtNewId, 'comment_author_id' => $iCmtAuthorId));
    $oZ->alert();
    $oCmts->_triggerComment();
    return $iCmtNewId;
}
开发者ID:Prashank25,项目名称:dolphin.pro,代码行数:30,代码来源:customFunctions.inc.php

示例2: serviceGetLiveUpdatesComments

 public function serviceGetLiveUpdatesComments($sSystem, $iContentId, $iProfileId)
 {
     bx_import('BxDolCmts');
     $oCmts = BxDolCmts::getObjectInstance($sSystem, $iContentId);
     if (!$oCmts || !$oCmts->isEnabled()) {
         return false;
     }
     return array('count' => $oCmts->getCommentsCount($iContentId, 0, BX_CMT_FILTER_OTHERS), 'method' => $oCmts->getJsObjectName() . '.showLiveUpdate(oData)', 'data' => array('code' => $oCmts->getNotification()));
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:9,代码来源:BxBaseCmtsServices.php

示例3: _deleteFile

 function _deleteFile($iFileId)
 {
     $aInfo = $this->serviceCheckDelete($iFileId);
     if (!$aInfo) {
         return false;
     }
     if ($this->_oDb->deleteData($iFileId)) {
         $aFilesPostfix = $this->_oConfig->aFilePostfix;
         //delete temp files
         $aFilesPostfix['temp'] = '';
         if (isset($aFilesPostfix['original'])) {
             $aFilesPostfix['original'] = $this->_getOriginalExt($aInfo, $aFilesPostfix['original']);
         }
         foreach ($aFilesPostfix as $sValue) {
             $sFilePath = $this->_oConfig->getFilesPath() . $iFileId . $sValue;
             @unlink($sFilePath);
         }
         bx_import('BxDolVoting');
         $oVoting = new BxDolVoting($this->_oConfig->getMainPrefix(), 0, 0);
         $oVoting->deleteVotings($iFileId);
         bx_import('BxDolCmts');
         $oCmts = new BxDolCmts($this->_oConfig->getMainPrefix(), $iFileId);
         $oCmts->onObjectDelete();
         bx_import('BxDolCategories');
         //tags & categories parsing
         $oTag = new BxDolTags();
         $oTag->reparseObjTags($this->_oConfig->getMainPrefix(), $iFileId);
         $oCateg = new BxDolCategories();
         $oCateg->reparseObjTags($this->_oConfig->getMainPrefix(), $iFileId);
         $bUpdateCounter = $aInfo['Approved'] == 'approved' ? true : false;
         $this->oAlbums->removeObjectTotal($iFileId, $bUpdateCounter);
         //delete all subscriptions
         $oSubscription = BxDolSubscription::getInstance();
         $oSubscription->unsubscribe(array('type' => 'object_id', 'unit' => $this->_oConfig->getMainPrefix(), 'object_id' => $iFileId));
         bx_import('BxDolAlerts');
         $oAlert = new BxDolAlerts($this->_oConfig->getMainPrefix(), 'delete', $iFileId, $this->_iProfileId, $aInfo);
         $oAlert->alert();
         $this->isAllowedDelete($aInfo, true);
     } else {
         return false;
     }
     return true;
 }
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:43,代码来源:BxDolFilesModule.php

示例4: serviceGetMenuItemAddonVote

 public function serviceGetMenuItemAddonVote($sSystem, $iId, $iCmtId)
 {
     bx_import('BxDolCmts');
     $oCmts = BxDolCmts::getObjectInstance($sSystem, $iId);
     $oVote = $oCmts->getVoteObject($iCmtId);
     if ($oVote !== false) {
         return $oVote->getCounter();
     }
     return '';
 }
开发者ID:Baloo7super,项目名称:dolphin,代码行数:10,代码来源:BxBaseCmtsServices.php

示例5: PageCompMainCode

/**
 * page code function
 */
function PageCompMainCode()
{
    $iObjectId = 1;
    bx_import('BxDolCmts');
    $oCmts = BxDolCmts::getObjectInstance('sample', $iObjectId);
    if (!$oCmts->isEnabled()) {
        return '';
    }
    return $oCmts->getCommentsBlock();
}
开发者ID:blas-dmx,项目名称:trident,代码行数:13,代码来源:comments.php

示例6: BxBaseCmtsView

 function BxBaseCmtsView($sSystem, $iId, $iInit = 1)
 {
     BxDolCmts::BxDolCmts($sSystem, $iId, $iInit);
     if (empty($sSystem) || !$this->_aSystem) {
         return;
     }
     $this->_sJsObjName = 'oCmts' . ucfirst($sSystem) . $iId;
     $this->_oPaginate = new BxDolPaginate(array('page_url' => 'javascript:void(0);', 'start' => 0, 'count' => $this->_oQuery->getObjectCommentsCount($this->getId(), 0), 'per_page' => $this->getPerView(), 'sorting' => $this->_sOrder, 'per_page_step' => 2, 'per_page_interval' => 3, 'on_change_page' => $this->_sJsObjName . '.changePage({start}, {per_page})', 'on_change_per_page' => $this->_sJsObjName . '.changePerPage(this)', 'on_change_sorting' => $this->_sJsObjName . '.changeOrder(this)', 'info' => false));
     $this->_sStylePrefix = isset($this->_aSystem['root_style_prefix']) ? $this->_aSystem['root_style_prefix'] : 'cmt';
     $GLOBALS['oSysTemplate']->addJsTranslation('_sys_txt_cmt_loading');
 }
开发者ID:gorenc,项目名称:dolphin.pro,代码行数:11,代码来源:BxBaseCmtsView.php

示例7: displaySearchUnit

 function displaySearchUnit($aData)
 {
     $oCmts = BxDolCmts::getObjectInstance($this->sModuleObjectComments, $aData['object_id']);
     $oCmts->addCssJs();
     if ($this->_bLiveSearch) {
         $aCnf =& $this->oModule->_oConfig->CNF;
         return $oCmts->getCommentLiveSearch($aData['id'], array('txt_sample_single' => isset($aCnf['T']['txt_sample_comment_single']) ? $aCnf['T']['txt_sample_comment_single'] : ''));
     } else {
         return $oCmts->getComment($aData['id'], array(), array('type' => BX_CMT_DISPLAY_FLAT, 'view_only' => true));
     }
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:11,代码来源:BxBaseModGeneralCmtsSearchResult.php

示例8: uninstall

 function uninstall($aParams, $bDisable = false)
 {
     // check if module is already waiting while files are deleting
     bx_import('BxDolInstallerUtils');
     if (BxDolInstallerUtils::isModulePendingUninstall($this->_aConfig['home_uri'])) {
         return array('message' => _t('_adm_err_modules_pending_uninstall_already'), 'result' => false);
     }
     // queue for deletion storage files
     $bSetModulePendingUninstall = false;
     foreach ($this->_aStorages as $s) {
         if (($o = BxDolStorage::getObjectInstance($s)) && $o->queueFilesForDeletionFromObject()) {
             $bSetModulePendingUninstall = true;
         }
     }
     // delete comments and queue for deletion comments attachments
     bx_import('BxDolCmts');
     $iFiles = 0;
     BxDolCmts::onModuleUninstall($this->_aConfig['name'], $iFiles);
     if ($iFiles) {
         $bSetModulePendingUninstall = true;
     }
     // if some files were added to the queue, set module as pending uninstall
     if ($bSetModulePendingUninstall) {
         BxDolInstallerUtils::setModulePendingUninstall($this->_aConfig['home_uri']);
         return array('message' => _t('_adm_err_modules_pending_uninstall'), 'result' => false);
     }
     // delete associated connections
     if ($this->_aConnections) {
         bx_import('BxDolConnection');
         foreach ($this->_aConnections as $sObjectConnections => $a) {
             $o = BxDolConnection::getObjectInstance($sObjectConnections);
             if (!$o) {
                 continue;
             }
             $sFuncSuffix = 'DeleteInitiatorAndContent';
             if (isset($a['conn']) && 'initiator' == $a['conn']) {
                 $sFuncSuffix = 'DeleteInitiator';
             } elseif (isset($a['conn']) && 'content' == $a['conn']) {
                 $sFuncSuffix = 'DeleteContent';
             }
             if (isset($a['type']) && 'profiles' == $a['type']) {
                 $sFunc = 'onModuleProfile' . $sFuncSuffix;
                 $o->{$sFunc}($this->_aConfig['name']);
             } else {
                 $sFunc = 'onModule' . $sFuncSuffix;
                 $o->{$sFunc}($a['table'], $a['field_id']);
             }
         }
     }
     return parent::uninstall($aParams, $bDisable);
 }
开发者ID:Baloo7super,项目名称:dolphin,代码行数:51,代码来源:BxBaseModGeneralInstaller.php

示例9: serviceGetLiveUpdatesComments

 public function serviceGetLiveUpdatesComments($sSystem, $iContentId, $iProfileId, $iCount = 0)
 {
     $oCmts = BxDolCmts::getObjectInstance($sSystem, $iContentId);
     if (!$oCmts || !$oCmts->isEnabled()) {
         return false;
     }
     $sKey = $oCmts->getNotificationId();
     bx_import('BxDolSession');
     if ((int) BxDolSession::getInstance()->getValue($sKey) == 1) {
         return false;
     }
     $iCountNew = $oCmts->getCommentsCount($iContentId, -1, BX_CMT_FILTER_OTHERS);
     if ($iCountNew <= $iCount) {
         return false;
     }
     return array('count' => $iCountNew, 'method' => $oCmts->getJsObjectName() . '.showLiveUpdate(oData)', 'data' => array('code' => $oCmts->getNotification($iCount, $iCountNew)));
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:17,代码来源:BxBaseCmtsServices.php

示例10: delete

 function delete($iContentId, $aContentInfo = array())
 {
     $CNF =& $this->_oModule->_oConfig->CNF;
     // delete associated files
     if (!empty($CNF['OBJECT_STORAGE'])) {
         bx_import('BxDolStorage');
         $oStorage = BxDolStorage::getObjectInstance($CNF['OBJECT_STORAGE']);
         if ($oStorage) {
             $oStorage->queueFilesForDeletionFromGhosts($aContentInfo[$CNF['FIELD_AUTHOR']], $iContentId);
         }
     }
     // delete associated objects data
     if (!empty($CNF['OBJECT_VIEWS'])) {
         bx_import('BxDolView');
         $o = BxDolView::getObjectInstance($CNF['OBJECT_VIEWS'], $iContentId);
         if ($o) {
             $o->onObjectDelete();
         }
     }
     if (!empty($CNF['OBJECT_VOTES'])) {
         bx_import('BxDolVote');
         $o = BxDolVote::getObjectInstance($CNF['OBJECT_VOTES'], $iContentId);
         if ($o) {
             $o->onObjectDelete();
         }
     }
     if (!empty($CNF['OBJECT_COMMENTS'])) {
         bx_import('BxDolCmts');
         $o = BxDolCmts::getObjectInstance($CNF['OBJECT_COMMENTS'], $iContentId);
         if ($o) {
             $o->onObjectDelete();
         }
     }
     if (!empty($CNF['OBJECT_METATAGS'])) {
         bx_import('BxDolMetatags');
         $oMetatags = BxDolMetatags::getObjectInstance($CNF['OBJECT_METATAGS']);
         $oMetatags->onDeleteContent($iContentId);
     }
     // delete db record
     return parent::delete($iContentId);
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:41,代码来源:BxBaseModGeneralFormEntry.php

示例11: serviceDeleteFileAssociations

 public function serviceDeleteFileAssociations($iFileId)
 {
     $CNF =& $this->_oConfig->CNF;
     if (!($aMediaInfo = $this->_oDb->getMediaInfoSimpleByFileId($iFileId))) {
         // file is already deleted
         return true;
     }
     if (!$this->_oDb->deassociateFileWithContent(0, $iFileId)) {
         return false;
     }
     if (!empty($CNF['OBJECT_VIEWS_MEDIA'])) {
         $o = BxDolView::getObjectInstance($CNF['OBJECT_VIEWS_MEDIA'], $aMediaInfo['id']);
         if ($o) {
             $o->onObjectDelete();
         }
     }
     if (!empty($CNF['OBJECT_VOTES_MEDIA'])) {
         $o = BxDolVote::getObjectInstance($CNF['OBJECT_VOTES_MEDIA'], $aMediaInfo['id']);
         if ($o) {
             $o->onObjectDelete();
         }
     }
     if (!empty($CNF['OBJECT_COMMENTS_MEDIA'])) {
         $o = BxDolCmts::getObjectInstance($CNF['OBJECT_COMMENTS_MEDIA'], $aMediaInfo['id']);
         if ($o) {
             $o->onObjectDelete();
         }
     }
     if (!empty($CNF['OBJECT_METATAGS_MEDIA'])) {
         $oMetatags = BxDolMetatags::getObjectInstance($CNF['OBJECT_METATAGS_MEDIA']);
         $oMetatags->onDeleteContent($aMediaInfo['id']);
     }
     if (!empty($CNF['OBJECT_METATAGS_MEDIA_CAMERA'])) {
         $oMetatags = BxDolMetatags::getObjectInstance($CNF['OBJECT_METATAGS_MEDIA_CAMERA']);
         $oMetatags->onDeleteContent($aMediaInfo['id']);
     }
     return true;
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:38,代码来源:BxAlbumsModule.php

示例12: ActionDeleteAdvertisement

 /**
  * Deleting Advertisement from `bx_ads_main`
  *
  * @param $iID	ID of deleting Advertisement
  * @return Text presentation of result
  */
 function ActionDeleteAdvertisement($iID)
 {
     $iDeleteAdvertisementID = (int) $iID;
     $iAdvOwner = $this->_oDb->getOwnerOfAd($iDeleteAdvertisementID);
     if (!$this->isAllowedDelete($iAdvOwner)) {
         return $this->_oTemplate->displayAccessDenied();
     }
     if ($iDeleteAdvertisementID > 0) {
         $sSuccDel = _t("_bx_ads_Ad_succ_deleted");
         $sFailDel = _t("_bx_ads_Ad_fail_delete");
         $sRetHtml = '';
         $sMediaIDs = $this->_oDb->getMediaOfAd($iDeleteAdvertisementID);
         if ($sMediaIDs != '') {
             $aChunks = explode(',', $sMediaIDs);
             foreach ($aChunks as $sMedId) {
                 $iMedId = (int) $sMedId;
                 if ($iMedId) {
                     $sMediaFileName = $this->_oDb->getMediaFile($iMedId);
                     if ($sMediaFileName != '') {
                         @unlink(BX_DIRECTORY_PATH_ROOT . $this->sUploadDir . 'img_' . $sMediaFileName);
                         @unlink(BX_DIRECTORY_PATH_ROOT . $this->sUploadDir . 'thumb_' . $sMediaFileName);
                         @unlink(BX_DIRECTORY_PATH_ROOT . $this->sUploadDir . 'big_thumb_' . $sMediaFileName);
                         @unlink(BX_DIRECTORY_PATH_ROOT . $this->sUploadDir . 'icon_' . $sMediaFileName);
                     }
                     $this->_oDb->deleteMedia($iMedId);
                 }
             }
         }
         if ($this->_oDb->deleteAd($iDeleteAdvertisementID)) {
             $this->isAllowedDelete($iAdvOwner, true);
             // perform action
             $oCmts = new BxDolCmts('ads', $iDeleteAdvertisementID);
             $oCmts->onObjectDelete();
             //reparse tags
             bx_import('BxDolTags');
             $oTags = new BxDolTags();
             $oTags->reparseObjTags('ad', $iDeleteAdvertisementID);
             // delete views
             bx_import('BxDolViews');
             $oViews = new BxDolViews('ads', $iDeleteAdvertisementID, false);
             $oViews->onObjectDelete();
             bx_import('BxDolAlerts');
             $oZ = new BxDolAlerts('ads', 'delete', $iDeleteAdvertisementID, $iDeleteAdvertisementID);
             $oZ->alert();
             $sRetHtml .= MsgBox(_t($sSuccDel));
         } else {
             $sRetHtml .= MsgBox(_t($sFailDel));
         }
         return $sRetHtml;
     } else {
         return MsgBox(_t('_Error Occured'));
     }
 }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:59,代码来源:BxAdsModule.php

示例13: actionProcessStorages

 /**
  * 
  * Storage objects to automatically delete files from upon module uninstallation.
  * Note. Don't add storage objects used in transcoder objects.
  * @param string $sOperation - operation type.
  */
 protected function actionProcessStorages($sOperation)
 {
     if (empty($this->_aConfig['storages'])) {
         return BX_DOL_STUDIO_INSTALLER_FAILED;
     }
     // check if module is already waiting while files are deleting
     if (self::isModulePendingUninstall($this->_aConfig['home_uri'])) {
         return array('code' => BX_DOL_STUDIO_INSTALLER_FAILED, 'content' => _t('_adm_err_modules_pending_uninstall_already'));
     }
     $bSetModulePendingUninstall = false;
     // queue for deletion storage files
     foreach ($this->_aConfig['storages'] as $s) {
         if (($o = BxDolStorage::getObjectInstance($s)) && $o->queueFilesForDeletionFromObject()) {
             $bSetModulePendingUninstall = true;
         }
     }
     // delete comments and queue for deletion comments attachments
     $iFiles = 0;
     BxDolCmts::onModuleUninstall($this->_aConfig['name'], $iFiles);
     if ($iFiles) {
         $bSetModulePendingUninstall = true;
     }
     // if some files were added to the queue, set module as pending uninstall
     if ($bSetModulePendingUninstall) {
         self::setModulePendingUninstall($this->_aConfig['home_uri']);
         return array('code' => BX_DOL_STUDIO_INSTALLER_FAILED, 'content' => _t('_adm_err_modules_pending_uninstall'));
     }
     return BX_DOL_STUDIO_INSTALLER_SUCCESS;
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:35,代码来源:BxDolStudioInstaller.php

示例14: _entityComments

 protected function _entityComments($sObject, $iId = 0)
 {
     if (!$iId) {
         $iId = bx_process_input(bx_get('id'), BX_DATA_INT);
     }
     if (!$iId) {
         return false;
     }
     $oCmts = BxDolCmts::getObjectInstance($sObject, $iId);
     if (!$oCmts || !$oCmts->isEnabled()) {
         return false;
     }
     return $oCmts->getCommentsBlock(0, 0, false);
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:14,代码来源:BxBaseModTextModule.php

示例15: deleteUserGallery

 function deleteUserGallery($iUser, $logged)
 {
     $iUser = (int) $iUser;
     $sqlQuery = "SELECT `{$this->aTableFields['medID']}` from `{$this->sMainTable}` WHERE `{$this->aTableFields['medProfId']}`={$iUser}";
     $rFiles = db_res($sqlQuery);
     while ($aFile = mysql_fetch_assoc($rFiles)) {
         $this->deleteMedia($aFile[$this->aTableFields['medID']], $logged);
         $oCmts = new BxDolCmts('shared' . ucfirst($this->sType), $iFile);
         $oCmts->onObjectDelete();
     }
 }
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:11,代码来源:BxDolSharedMedia.php


注:本文中的BxDolCmts类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。