本文整理汇总了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;
}
示例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()));
}
示例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;
}
示例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 '';
}
示例5: PageCompMainCode
/**
* page code function
*/
function PageCompMainCode()
{
$iObjectId = 1;
bx_import('BxDolCmts');
$oCmts = BxDolCmts::getObjectInstance('sample', $iObjectId);
if (!$oCmts->isEnabled()) {
return '';
}
return $oCmts->getCommentsBlock();
}
示例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');
}
示例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));
}
}
示例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);
}
示例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)));
}
示例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);
}
示例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;
}
示例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'));
}
}
示例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;
}
示例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);
}
示例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();
}
}