function execute($options = array()) { $options = array_merge($this->getOptions(), $options); if (!(isset($this->udm->uid) && $this->udm->uid)) { $list_format_function = $options['format_list']; if (is_callable(array($this, $list_format_function))) { return $this->{$list_format_function}($options); } if (is_callable($list_format_function)) { return $list_format_function($options, $this); } trigger_error(sprintf(AMP_TEXT_ERROR_METHOD_NOT_SUPPORTED, 'AMP', $list_format_function, get_class($this))); } else { $options['_linked_uid'] = $this->udm->uid; $output = $this->_listLink($options); $comment_source = new ArticleComment($this->dbcon); $comments = $comment_source->search($comment_source->makeCriteria(array('userdata_id' => $this->udm->uid))); if (!$comments) { return $output; } $display = new AMP_Content_Article_Comment_Public_Display_List($comments); return $output . $display->execute($options); } }
function _filter_by_article($article_id) { require_once 'AMP/Content/Article/Comment/ArticleComment.php'; $comment = new ArticleComment(AMP_Registry::getDbcon()); $this->criteria = join(' AND ', $comment->makeCriteria(array('displayable' => 1, 'article' => $article_id))); }