From 42c62cb041a2b2b95c9cda0c20fcf70334fd244c Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 1 Nov 2011 09:32:21 +0000 Subject: Rewl og krat... needs cleaning up - after port to GIT. --- forum/utils/forums.php | 52 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 39 insertions(+), 13 deletions(-) (limited to 'forum/utils/forums.php') diff --git a/forum/utils/forums.php b/forum/utils/forums.php index c9c48b5..c93cafb 100644 --- a/forum/utils/forums.php +++ b/forum/utils/forums.php @@ -7,8 +7,8 @@ include_once($UTIL_DIR . "/threads.php"); class Forum { public $fid; public $name; - private $newStuff; - private $numPosts; + public $newStuff; + public $numPosts; private $latestPost; public function setNewStuff($newStuff, $threads) @@ -25,15 +25,37 @@ class Forum { public function show() { + global $cache; + global $yeah; + + $str = ""; + $newcls = " forum_nonew"; - if($this->newStuff) $newcls = " forum_new"; - - echo "
\n"; - echo " \n"; - echo " fid . "\">" . $this->name . "\n"; - echo " ".$this->latestPost."\n"; - echo " ".sprintf("%d", $this->numPosts)." threads\n"; - echo "
\n"; + if($yeah) { + $lp = $cache->get("forum_lastpost"); + if($lp->value($this->fid)) $newcls = " forum_new"; + } else { + if($this->newStuff) $newcls = " forum_new"; + } + + $str .= "
\n"; + $str .= " \n"; + $str .= " fid . "\">" . $this->name . "\n"; + $str .= " ". + $this->latestPost . "\n"; + if($yeah) { + $fc = $cache->get("forum_numberofthreads"); + + $str .= " " . + $fc->value($this->fid) . " threads\n"; + } else { + $str .= " " + . sprintf("%d", $this->numPosts)." threads\n"; + } + $str .= "
\n"; + + return $str; } public function Forum($fid, $name) @@ -84,11 +106,15 @@ class Forums { public function show() { - echo "
\n"; + $str = ""; + + $str .= "
\n"; foreach($this->forums as $forum) { - $forum->show(); + $str .= $forum->show(); } - echo "
\n"; + $str .= "
\n"; + + return $str; } private function read() -- cgit v1.2.3