本文整理汇总了PHP中Publication::commentsEnabled方法的典型用法代码示例。如果您正苦于以下问题:PHP Publication::commentsEnabled方法的具体用法?PHP Publication::commentsEnabled怎么用?PHP Publication::commentsEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Publication
的用法示例。
在下文中一共展示了Publication::commentsEnabled方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCommentsEnabled
protected function getCommentsEnabled()
{
$cacheService = \Zend_Registry::get('container')->getService('newscoop.cache');
$cacheKey = $cacheService->getCacheKey(array('are_comments_enabled', $this->m_dbObject->getProperty('IdPublication'), $this->m_dbObject->getProperty('Type'), $this->m_dbObject->getArticleNumber(), $this->m_dbObject->getLanguageId()), 'publication');
if ($cacheService->contains($cacheKey)) {
return $cacheService->fetch($cacheKey);
}
$publicationObj = new Publication($this->m_dbObject->getProperty('IdPublication'));
$articleTypeObj = new ArticleType($this->m_dbObject->getProperty('Type'));
$commentsEnabled = $publicationObj->commentsEnabled() && $articleTypeObj->commentsEnabled() && $this->m_dbObject->commentsEnabled();
$cacheService->save($cacheKey, $commentsEnabled);
return $commentsEnabled;
}
示例2: getCommentsEnabled
protected function getCommentsEnabled()
{
$publicationObj = new Publication($this->m_dbObject->getProperty('IdPublication'));
$articleTypeObj = new ArticleType($this->m_dbObject->getProperty('Type'));
return $publicationObj->commentsEnabled()
&& $articleTypeObj->commentsEnabled()
&& $this->m_dbObject->commentsEnabled();
}
示例3: getdate
$today = getdate();
$savedOn = getdate($lastModified);
$savedToday = true;
if ($today['year'] != $savedOn['year'] || $today['mon'] != $savedOn['mon'] || $today['mday'] != $savedOn['mday']) {
$savedToday = FALSE;
}
$showComments = FALSE;
$showCommentControls = FALSE;
if ($f_publication_id > 0) {
$publicationObj = new Publication($f_publication_id);
$issueObj = new Issue($f_publication_id, $f_language_id, $f_issue_number);
$sectionObj = new Section($f_publication_id, $f_issue_number, $f_language_id, $f_section_number);
$languageObj = new Language($articleObj->getLanguageId());
$showCommentControls = ($publicationObj->commentsEnabled() && $articleType->commentsEnabled());
$showComments = $showCommentControls && $articleObj->commentsEnabled();
}
if ($showComments) {
require_once($GLOBALS['g_campsiteDir'].'/classes/ArticleComment.php');
if (SystemPref::Get("UseDBReplication") == 'Y') {
$dbReplicationObj = new DbReplication();
$connectedToOnlineServer = $dbReplicationObj->connect();
if ($connectedToOnlineServer == true) {
// Fetch the comments attached to this article
// (from replication database)
$comments = ArticleComment::GetArticleComments($f_article_number, $f_language_id);
}
} else {
// Fetch the comments attached to this article