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/threads.php | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'forum/utils/threads.php') diff --git a/forum/utils/threads.php b/forum/utils/threads.php index 52dda06..a30bf5c 100644 --- a/forum/utils/threads.php +++ b/forum/utils/threads.php @@ -35,6 +35,8 @@ class Thread { global $fid, $current_user; global $users; + $str = ""; + $jumptonew = ""; $newcls = " thread_nonew"; if($this->lastseen[$current_user->uid] < $this->lastpost) { @@ -42,21 +44,23 @@ class Thread { $jumptonew = "#firstunread"; } - echo "
\n"; - echo "  \n"; - echo " " . $this->name . "\n"; - echo " ".$this->numposts." posts"; + $str .= "
\n"; + $str .= "  \n"; + $str .= " " . $this->name . "\n"; + $str .= " ".$this->numposts." posts"; if($this->numunread != 0) { - echo " (".$this->numunread." unread)"; + $str .= " (".$this->numunread." unread)"; } - echo "\n"; - echo " Last post: ". + $str .= "\n"; + $str .= " Last post: ". date("j. M Y - G:i", $this->lastpost)."\n"; $user = $users->getUser($this->first_user); - echo " By ".$user->name; - echo " at ". date("j. M Y - G:i", $this->first_date)."\n"; - echo "
\n"; + $str .= " By ".$user->name; + $str .= " at ". date("j. M Y - G:i", $this->first_date)."\n"; + $str .= "
\n"; + + return $str; } public function processPost($pid, $title, $user, $date) @@ -190,9 +194,13 @@ class Threads { public function show() { + $str = ""; + foreach($this->threads as $thread) { - $thread->show(); + $str .= $thread->show(); } + + return $str; } public function newStuff() -- cgit v1.2.3