news_page -- useful perhaps for caching news pages with a cache class -- Outputs valid XHTML Copyright © 2003-2005 Joshua Dechant. All Rights Reserved. Released under the GNU General Public License */ class newsDisplay { var $news_page; function newsDisplay() { $this->reset(); } function reset() { $this->news_page = ''; } function newsHeader($header, $date, $links_array = false) { $this->news_page .= '' . "\n"; $this->news_page .= '
' . $not_found_text . '
' . "\n"; return true; } function articleHeading($heading) { $this->news_page .= '' . $heading . '
' . "\n"; return true; } function articleByLine($by_author_text, $comments_url = false, $comments_url_text = false) { $this->news_page .= '' . $comments_url_text . ''; } $this->news_page .= '
' . "\n"; return true; } function articleText($text, $image = '', $html_text = true, $clearbreak = true) { if ($image != '') { $this->news_page .= $image; } if ($html_text) { $this->news_page .= $text . "\n"; } else { $this->news_page .= nl2br($text) . "\n"; } if ($clearbreak) { $this->news_page .= ' '; if ($comments_url && $comments_url_text) { $this->news_page .= ' |' . $article_name . '
' . $article_summary_text . '
' . $not_found_text . '
' . "\n"; return true; } function articleComments($commentor, $comments, $date_added, $subject = false, $html_text = true) { $this->news_page .= '' . $comments . '
' . "\n"; } else { $this->news_page .= '' . nl2br($comments) . '
' . "\n"; } $this->news_page .= '
'; if ($subject) { $this->news_page .= '' . $subject . '
' . "\n"; $this->news_page .= ''; } $this->news_page .= $commentor . '
' . $date_added . '
' . "\n"; $this->news_page .= '