本文整理汇总了PHP中BxDolCmts类的典型用法代码示例。如果您正苦于以下问题:PHP BxDolCmts类的具体用法?PHP BxDolCmts怎么用?PHP BxDolCmts使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BxDolCmts类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: 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();
// delete associated locations
if (BxDolModule::getInstance('BxWmapModule')) {
BxDolService::call('wmap', 'response_entry_delete', array($this->_oConfig->getUri(), $iDeleteAdvertisementID));
}
//delete all subscriptions
$oSubscription = BxDolSubscription::getInstance();
$oSubscription->unsubscribe(array('type' => 'object_id', 'unit' => 'ads', 'object_id' => $iDeleteAdvertisementID));
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:newton27,项目名称:dolphin.pro,代码行数:66,代码来源:BxAdsModule.php
示例17: GenAnyBlockContent
function GenAnyBlockContent($sOrder = 'last', $iProfileID = 0, $sLimit = "LIMIT 5")
{
global $site;
global $short_date_format;
$php_date_format = getParam('php_date_format');
$iBlogLimitChars = (int) getParam("max_blog_preview");
$sClockIcon = getTemplateIcon('clock.gif');
$sOrderS = '';
switch ($sOrder) {
case 'last':
$sOrderS = "ORDER BY `DateTime` DESC";
break;
case 'latest':
$sOrderS = "ORDER BY `DateTime` DESC";
break;
case 'rand':
$sOrderS = "ORDER BY RAND()";
break;
case 'top':
$sOrderS = "ORDER BY `CommCount` DESC";
break;
}
$sProfileS = $iProfileID > 0 ? "`ClassifiedsAdvertisements`.`IDProfile` = '{$iProfileID}'" : '1';
$sTimeAddon = $iProfileID > 0 ? '' : "AND DATE_ADD(`ClassifiedsAdvertisements`.`DateTime` , INTERVAL `ClassifiedsAdvertisements`.`LifeTime` DAY) > NOW()";
$oCmts = new BxDolCmts('classifieds', 0, 0);
$sQuery = "\r\n\t\t\tSELECT DISTINCT\r\n\t\t\t`ClassifiedsAdvertisements`.`ID`,\r\n\t\t\t`ClassifiedsAdvertisements`.`Subject`,\r\n\t\t\t`ClassifiedsAdvertisements`.`EntryUri`,\r\n\t\t\t`ClassifiedsAdvertisements`.`Media`,\r\n\t\t\t`Profiles`.`NickName`,\r\n\t\t\tUNIX_TIMESTAMP( `ClassifiedsAdvertisements`.`DateTime` ) as `DateTime_f`,\r\n\t\t\t`ClassifiedsAdvertisements`.`DateTime`,\r\n\t\t\t`Classifieds`.`Name`, `Classifieds`.`CEntryUri`, `Classifieds`.`ID` AS `CatID`,\r\n\t\t\t`ClassifiedsSubs`.`NameSub`, `ClassifiedsSubs`.`SEntryUri`, `ClassifiedsSubs`.`ID` AS `SubCatID`,\r\n\t\t\t`ClassifiedsAdvertisements`.`Message`,\r\n\t\t\tCOUNT(`tc`.`cmt_id`) AS 'CommCount'\r\n\t\t\tFROM `ClassifiedsAdvertisements`\r\n\t\t\tLEFT JOIN `ClassifiedsSubs`\r\n\t\t\tON `ClassifiedsSubs`.`ID`=`ClassifiedsAdvertisements`.`IDClassifiedsSubs`\r\n\t\t\tLEFT JOIN `Classifieds`\r\n\t\t\tON `Classifieds`.`ID`=`ClassifiedsSubs`.`IDClassified`\r\n\t\t\tLEFT JOIN `Profiles` ON `Profiles`.`ID`=`ClassifiedsAdvertisements`.`IDProfile`\r\n\t\t\tLEFT JOIN `" . $oCmts->getCommentsTableName() . "` AS `tc` ON `tc`.`cmt_object_id`=`ClassifiedsAdvertisements`.`ID`\r\n\t\t\tWHERE\r\n\t\t\t{$sProfileS}\r\n\t\t\tAND `ClassifiedsAdvertisements`.`Status` = 'active'\r\n\t\t\t{$sTimeAddon}\r\n\t\t\tGROUP BY `ClassifiedsAdvertisements`.`ID`\r\n\t\t\t{$sOrderS}\r\n\t\t\t{$sLimit}\r\n\t\t";
$rBlogs = db_res($sQuery);
if (!mysql_num_rows($rBlogs)) {
return '';
}
$sBlocks = '';
while ($aBlog = mysql_fetch_assoc($rBlogs)) {
if ($sOrder == 'top' && $aBlog['CommCount'] == 0) {
continue;
}
$sPic = $this->getImageCode($aBlog['Media'], TRUE);
$sGenUrl = $this->genUrl($aBlog['ID'], $aBlog['EntryUri']);
$sGenCUrl = $this->bUseFriendlyLinks && $this->bAdminMode == false ? $site['url'] . 'ads/cat/' . $aBlog['CEntryUri'] : "{$this->sCurrBrowsedFile}?bClassifiedID={$aBlog['CatID']}";
$sGenSCUrl = $this->bUseFriendlyLinks && $this->bAdminMode == false ? $site['url'] . 'ads/subcat/' . $aBlog['SEntryUri'] : "{$this->sCurrBrowsedFile}?bSubClassifiedID={$aBlog['SubCatID']}";
$sLinkMore = '';
if (strlen($aBlog['Message']) > $iBlogLimitChars) {
$sLinkMore = "... <a href=\"{$sGenUrl}\">" . _t('_Read more') . "</a>";
}
$sBlogSnippet = mb_substr(strip_tags($aBlog['Message']), 0, $iBlogLimitChars) . $sLinkMore;
$sDataTimeFormatted = date($php_date_format, $aBlog['DateTime_f']);
$sInCatFormatted = _t('_in Category', getTemplateIcon('ad_category.gif'), $sGenCUrl, process_line_output($aBlog['Name']));
$sSubNameF = process_line_output($aBlog['NameSub']);
$sCommentsF = _t('_comments N', getTemplateIcon('add_comment.gif'), $aBlog['CommCount']);
$sSubjectF = process_line_output($arr['Subject']);
$sBlocks .= <<<EOF
<div class="blog_block">
\t<div class="icon_block">
\t\t<div class="thumbnail_block" style="float:left;">
\t\t\t<a href="{$sGenUrl}" class="bottom_text">
\t\t\t\t{$sPic}
\t\t\t</a>
\t\t</div>
\t</div>
\t<div class="blog_wrapper_n">
\t\t<div class="blog_subject_n">
\t\t\t<a href="{$sGenUrl}" class="bottom_text">
\t\t\t\t{$sSubjectF}
\t\t\t</a>
\t\t</div>
\t\t<div class="blogInfo">
\t\t\t<span><img src="{$sClockIcon}" alt="" />{$sDataTimeFormatted} </span>
\t\t\t<span>{$sInCatFormatted} / <a href="{$sGenCUrl}">{$sSubNameF}</a></span>
\t\t\t<span>{$sCommentsF}</span>
\t\t</div>
\t\t<div class="blogSnippet">
\t\t\t{$sBlogSnippet}
\t\t</div>
\t</div>
</div>
<div class="clear_both"></div>
EOF;
}
return $sBlocks;
}
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:79,代码来源:BxDolClassifieds.php
示例18: check_logged
* 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 [email protected]
***************************************************************************/
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 . 'utils.inc.php';
check_logged();
$sSys = isset($_REQUEST['sys']) ? $_REQUEST['sys'] : '';
$sAction = isset($_REQUEST['action']) && preg_match('/^[A-Za-z_-]+$/', $_REQUEST['action']) ? $_REQUEST['action'] : '';
$iId = (int) $_REQUEST['id'];
bx_import('BxTemplCmtsView');
$aSystems =& BxDolCmts::getSystems();
if ($sSys && $sAction && $iId && isset($aSystems[$sSys])) {
$oCmts = null;
if ($aSystems[$sSys]['class_name']) {
require_once BX_DIRECTORY_PATH_ROOT . $aSystems[$sSys]['class_file'];
$sClassName = $aSystems[$sSys]['class_name'];
$oCmts = new $sClassName($sSys, $iId, true);
} else {
$oCmts = new BxTemplCmtsView($sSys, $iId, true);
}
$sMethod = 'action' . $sAction;
echo $oCmts->{$sMethod}();
}
开发者ID:dalinhuang,项目名称:shopexts,代码行数:31,代码来源:cmts.php
示例19: delete
/**
* Delete profile.
* @param $ID - optional profile id to delete
* @param $bForceDelete - force deletetion is case of account profile deletion
* @return false on error, or true on success
*/
function delete($ID = false, $bForceDelete = false)
{
$ID = (int) $ID;
if (!$ID) {
$ID = $this->_iProfileID;
}
$aProfileInfo = $this->_oQuery->getInfoById($ID);
if (!$aProfileInfo) {
return false;
}
// delete system profiles (accounts) is not allowed, instead - delete whole account
if (!$bForceDelete && 'system' == $aProfileInfo['type']) {
return false;
}
// switch profile context if deleted profile is active profile context
bx_import('BxDolAccount');
$oAccount = BxDolAccount::getInstance($aProfileInfo['account_id']);
$aAccountInfo = $oAccount->getInfo();
if (!$bForceDelete && $ID == $aAccountInfo['profile_id']) {
$oProfileAccount = BxDolProfile::getInstanceAccountProfile($aProfileInfo['account_id']);
$oAccount->updateProfileContext($oProfileAccount->id());
}
// create system event before deletion
$isStopDeletion = false;
bx_alert('profile', 'before_delete', $ID, 0, array('stop_deletion' => &$isStopDeletion));
if ($isStopDeletion) {
return false;
}
// delete associated comments
bx_import('BxDolCmts');
BxDolCmts::onAuthorDelete($ID);
// delete connections
bx_import('BxDolConnection');
$oConn = BxDolConnection::getObjectInstance('sys_profiles_friends');
$oConn->onDeleteInitiatorAndContent($ID);
$oConn = BxDolConnection::getObjectInstance('sys_profiles_subscriptions');
$oConn->onDeleteInitiatorAndContent($ID);
// delete profile's acl levels
bx_import('BxDolAcl');
BxDolAcl::getInstance()->onProfileDelete($ID);
// delete profile
if (!$this->_oQuery->delete($ID)) {
return false;
}
// create system event
bx_alert('profile', 'delete', $ID);
// unset class instance to prevent creating the instance again
$this->_iProfileID = 0;
$sClass = get_class($this) . '_' . $ID;
unset($GLOBALS['bxDolClasses'][$sClass]);
return true;
}
开发者ID:blas-dmx,项目名称:trident,代码行数:58,代码来源:BxDolProfile.php
示例20: profile_delete
function profile_delete($ID, $isDeleteSpammer = false)
{
//global $MySQL;
global $dir;
//recompile global profiles cache
$GLOBALS['MySQL']->cleanCache('sys_browse_people');
$ID = (int) $ID;
if (!$ID) {
return false;
}
if (!($aProfileInfo = getProfileInfo($ID))) {
return false;
}
$iLoggedInId = getLoggedId();
db_res("DELETE FROM `sys_admin_ban_list` WHERE `ProfID`='" . $ID . "' LIMIT 1");
db_res("DELETE FROM `sys_greetings` WHERE `ID` = '{$ID}' OR `Profile` = '{$ID}'");
db_res("DELETE FROM `sys_block_list` WHERE `ID` = '{$ID}' OR `Profile` = '{$ID}'");
db_res("DELETE FROM `sys_messages` WHERE Recipient = {$ID} OR `Sender` = {$ID}");
db_res("DELETE FROM `sys_fave_list` WHERE ID = {$ID} OR Profile = {$ID}");
db_res("DELETE FROM `sys_friend_list` WHERE ID = {$ID} OR Profile = {$ID}");
db_res("DELETE FROM `sys_acl_levels_members` WHERE `IDMember` = {$ID}");
db_res("DELETE FROM `sys_tags` WHERE `ObjID` = {$ID} AND `Type` = 'profile'");
db_res("DELETE FROM `sys_sbs_entries` WHERE `subscriber_id` = {$ID} AND `subscriber_type` = '1'");
// delete profile votings
require_once BX_DIRECTORY_PATH_CLASSES . 'BxDolVoting.php';
$oVotingProfile = new BxDolVoting('profile', 0, 0);
$oVotingProfile->deleteVotings($ID);
// delete profile comments
require_once BX_DIRECTORY_PATH_CLASSES . 'BxDolCmts.php';
$oCmts = new BxDolCmts('profile', $ID);
$oCmts->onObjectDelete();
// delete all comments in all comments' systems, this user posted
$oCmts->onAuthorDelete($ID);
$iPossibleCoupleID = (int) db_value("SELECT `ID` FROM `Profiles` WHERE `Couple` = '{$ID}'");
if ($iPossibleCoupleID) {
db_res("DELETE FROM `Profiles` WHERE `ID` = '{$iPossibleCoupleID}'");
//delete cache file
deleteUserDataFile($iPossibleCoupleID);
}
// delete associated locations
if (BxDolModule::getInstance('BxWmapModule')) {
BxDolService::call('wmap', 'response_entry_delete', array('profiles', $ID));
}
//delete all subscriptions
$oSubscription = BxDolSubscription::getInstance();
$oSubscription->unsubscribe(array('type' => 'object_id', 'unit' => 'profile', 'object_id' => $ID));
db_res("DELETE FROM `Profiles` WHERE `ID` = '{$ID}'");
if ($isDeleteSpammer) {
bx_import('BxDolStopForumSpam');
$oBxDolStopForumSpam = new BxDolStopForumSpam();
$oBxDolStopForumSpam->submitSpammer(array('username' => $aProfileInfo['NickName'], 'email' => $aProfileInfo['Email'], 'ip' => bx_member_ip_get_last($ID)));
}
// delete moxiemanager files
$sMoxieFilesPath = BX_DIRECTORY_PATH_ROOT . 'media/moxie/files/' . substr($aProfileInfo['NickName'], 0, 1) . '/' . substr($aProfileInfo['NickName'], 0, 2) . '/' . substr($aProfileInfo['NickName'], 0, 3) . '/' . $aProfileInfo['NickName'];
bx_rrmdir($sMoxieFilesPath);
// create system event
$oZ = new BxDolAlerts('profile', 'delete', $ID, 0, array('profile_info' => $aProfileInfo, 'logged_in' => $iLoggedInId, 'delete_spammer' => $isDeleteSpammer));
$oZ->alert();
//delete cache file
deleteUserDataFile($ID);
}
开发者ID:newton27,项目名称:dolphin.pro,代码行数:61,代码来源:admin.inc.php
注:本文中的BxDolCmts类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论