commentsEnabled() public méthode

Alias for getCommentsEnabled
public commentsEnabled ( ) : boolean
Résultat boolean
 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;
 }
Exemple #2
0
 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();
 }
Exemple #3
0
$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