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


PHP Publication::commentsEnabled方法代码示例

本文整理汇总了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;
 }
开发者ID:sourcefabric,项目名称:newscoop,代码行数:13,代码来源:MetaArticle.php

示例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();
 }
开发者ID:nistormihai,项目名称:Newscoop,代码行数:8,代码来源:MetaArticle.php

示例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
开发者ID:nistormihai,项目名称:Newscoop,代码行数:31,代码来源:edit.php


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