本文整理汇总了PHP中BxDolCmts::getObjectInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP BxDolCmts::getObjectInstance方法的具体用法?PHP BxDolCmts::getObjectInstance怎么用?PHP BxDolCmts::getObjectInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BxDolCmts
的用法示例。
在下文中一共展示了BxDolCmts::getObjectInstance方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: PageCompMainCode
/**
* page code function
*/
function PageCompMainCode()
{
$iObjectId = 1;
bx_import('BxDolCmts');
$oCmts = BxDolCmts::getObjectInstance('sample', $iObjectId);
if (!$oCmts->isEnabled()) {
return '';
}
return $oCmts->getCommentsBlock();
}
示例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: 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));
}
}
示例6: 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)));
}
示例7: 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);
}
示例8: 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;
}
示例9: bx_import
/**
* Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
* CC-BY License - http://creativecommons.org/licenses/by/3.0/
*
* @defgroup TridentCore Trident Core
* @{
*/
require_once './inc/header.inc.php';
require_once BX_DIRECTORY_PATH_INC . "design.inc.php";
bx_import('BxDolLanguages');
check_logged();
$sSys = isset($_REQUEST['sys']) ? bx_process_input($_REQUEST['sys']) : '';
$iObjectId = isset($_REQUEST['id']) ? bx_process_input($_REQUEST['id'], BX_DATA_INT) : 0;
$sAction = isset($_REQUEST['action']) && preg_match('/^[A-Za-z_-]+$/', $_REQUEST['action']) ? bx_process_input($_REQUEST['action']) : '';
$oCmts = BxDolCmts::getObjectInstance($sSys, $iObjectId, true);
if ($oCmts && $sSys && $iObjectId) {
if ($sAction) {
header('Content-Type: text/html; charset=utf-8');
$sMethod = 'action' . $sAction;
echo $oCmts->{$sMethod}();
exit;
}
$iCmtId = bx_get('cmt_id');
if ($iCmtId !== false) {
$sObjectTitle = $oCmts->getObjectTitle($iObjectId);
$sHeader = _t('_cmt_page_view_header', $sObjectTitle);
$sTitle = _t('_cmt_page_view_title', $oCmts->getBaseUrl(), $sObjectTitle);
$sContent = DesignBoxContent($sTitle, $oCmts->getCommentBlock($iCmtId), BX_DB_PADDING_DEF);
$oTemplate = BxDolTemplate::getInstance();
$oTemplate->setPageNameIndex(BX_PAGE_DEFAULT);
示例10: getCmtsObject
public function getCmtsObject($sSystem, $iId)
{
if (empty($sSystem) || (int) $iId == 0) {
return false;
}
bx_import('BxDolCmts');
$oCmts = BxDolCmts::getObjectInstance($sSystem, $iId);
if (!$oCmts->isEnabled()) {
return false;
}
return $oCmts;
}
示例11: getCmtsObject
public function getCmtsObject($sSystem, $iId)
{
if (empty($sSystem) || (int) $iId == 0) {
return false;
}
$oCmts = BxDolCmts::getObjectInstance($sSystem, $iId, true, $this->_oTemplate);
if (!$oCmts->isEnabled()) {
return false;
}
return $oCmts;
}
示例12: _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);
}
示例13: serviceGetTimelinePost
/**
* Entry post for Timeline
*/
public function serviceGetTimelinePost($aEvent)
{
$aContentInfo = $this->_oDb->getContentInfoById($aEvent['object_id']);
if (empty($aContentInfo) || !is_array($aContentInfo)) {
return '';
}
$CNF =& $this->_oConfig->CNF;
bx_import('BxDolPermalinks');
$sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]);
//--- Image(s)
$sImage = '';
if (isset($aContentInfo[$CNF['FIELD_THUMB']]) && $aContentInfo[$CNF['FIELD_THUMB']]) {
bx_import('BxDolStorage');
$oStorage = BxDolStorage::getObjectInstance($CNF['OBJECT_STORAGE']);
if ($oStorage) {
$sImage = $oStorage->getFileUrlById($aContentInfo[$CNF['FIELD_THUMB']]);
}
}
//--- Votes
bx_import('BxDolVote');
$oVotes = BxDolVote::getObjectInstance($CNF['OBJECT_VOTES'], $aEvent['object_id']);
$aVotes = array();
if ($oVotes && $oVotes->isEnabled()) {
$aVotes = array('system' => $CNF['OBJECT_VOTES'], 'object_id' => $aContentInfo[$CNF['FIELD_ID']], 'count' => $aContentInfo['votes']);
}
//--- Comments
bx_import('BxDolCmts');
$oCmts = BxDolCmts::getObjectInstance($CNF['OBJECT_COMMENTS'], $aEvent['object_id']);
$aComments = array();
if ($oCmts && $oCmts->isEnabled()) {
$aComments = array('system' => $CNF['OBJECT_COMMENTS'], 'object_id' => $aContentInfo[$CNF['FIELD_ID']], 'count' => $aContentInfo['comments']);
}
return array('owner_id' => $aContentInfo[$CNF['FIELD_AUTHOR']], 'content' => array('sample' => _t($CNF['T']['txt_sample_single']), 'url' => $sUrl, 'title' => isset($aContentInfo[$CNF['FIELD_TITLE']]) ? $aContentInfo[$CNF['FIELD_TITLE']] : strmaxtextlen($aContentInfo[$CNF['FIELD_TEXT']], 20, '...'), 'text' => $aContentInfo[$CNF['FIELD_TEXT']], 'images' => array(array('url' => $sUrl, 'src' => $sImage))), 'votes' => $aVotes, 'comments' => $aComments, 'title' => '', 'description' => '');
}
示例14: check_logged
<?php
/**
* Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
* CC-BY License - http://creativecommons.org/licenses/by/3.0/
*/
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('BxDolCmts');
$aSystems = BxDolCmts::getSystems();
if ($sSys && $sAction && $iId && ($oCmts = BxDolCmts::getObjectInstance($sSys, $iId, true))) {
header('Content-Type: text/html; charset=utf-8');
$sMethod = 'action' . $sAction;
echo $oCmts->{$sMethod}();
}