Example #1
0
 function is_article_commentable()
 {
     $comment_data = $this->getValues();
     if (!(isset($comment_data['articleid']) && $comment_data['articleid'])) {
         return true;
     }
     require_once 'AMP/Content/Article.inc.php';
     $article = new Article(AMP_dbcon(), $comment_data['articleid']);
     return $article->acceptingNewComments();
 }
Example #2
0
 function execute()
 {
     $output = '<hr><p class="subtitle"><a name="comments"></a>Comments</p>';
     $article = new Article(AMP_dbcon(), $this->comment_set->getArticleId());
     if ($article && $article->acceptingNewComments()) {
         $output .= $this->_HTML_addCommentLink($this->comment_set->getArticleId());
     } else {
         $output .= "<p>" . AMP_TEXT_COMMENTS_CLOSED . "</p>";
     }
     if (AMP_CONTENT_TRACKBACKS_ENABLED) {
         $output .= '  |  ' . $this->_HTML_trackback($this->comment_set->getArticleId());
     }
     if (!$this->comment_set->makeReady()) {
         return $output;
     }
     $output .= '<ol>';
     while ($data = $this->comment_set->getData()) {
         $output .= $this->_HTML_comment($this->_HTML_p_commaJoin(array($this->_HTML_author($data['author'], $data['author_url']), $this->_HTML_date($data['date']))) . $this->_HTML_commentBody($data['comment']));
     }
     $output .= '</ol>';
     return $output;
 }