- public function display_comment_link() {
- if ($this->number_of_comments > 0) {
- $anchor_text = "comments($this->number_of_comments)/";
- } else {
- $anchor_text = "comment?";
- }
- if (substr($this->url, (strlen($this->url)-1), strlen($this->url)) == '/') {
- $url = $this->url . 'comments/';
- } else {
- $url = $this->url . '/comments/';
- }
- echo "<a id='comment_link' href='$url'>$anchor_text</a>";
- }
-
- public function display_comments() {
- echo "<div id='comments'>";
- $sql= "SELECT date_posted, author, text
- FROM comments WHERE note = ?
- ORDER BY date_posted DESC";
- $result = $this->query($sql, 'd', $this->id);
- foreach ($result as $row => $entry) {
- $date_posted = $entry['date_posted'];
- $author = $entry['author'];
- $text = htmlspecialchars($entry['text']);
- $head = "<h3>" . htmlspecialchars($author) . "</h3>";
- echo "<div class='comment'>";
- echo $head;
- echo $text;
- echo "</div>";
- }
- echo "</div>";
- }
-
- public function display_comment_form() {
- $publickey = $this->recaptcha_publickey;
- require_once("view/comment-form.php");
- }