From 42c62cb041a2b2b95c9cda0c20fcf70334fd244c Mon Sep 17 00:00:00 2001
From: deva <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 "    <div class=\"thread\">\n";
-    echo "      <span class=\"thread_icon".$newcls."\">&nbsp;</span>\n";
-		echo "      <a class=\"thread_title\" href=\"?fid=" . $fid .
-      "&amp;tid=" .	$this->tid . $jumptonew."\">" . $this->name . "</a>\n";
-    echo "      <span class=\"thread_numposts\">".$this->numposts." posts";
+		$str .=  "    <div class=\"thread\">\n";
+    $str .=  "      <span class=\"thread_icon".$newcls."\">&nbsp;</span>\n";
+		$str .=  "      <span class=\"thread_title\"><a href=\"?fid=" . $fid .
+      "&amp;tid=" .	$this->tid . $jumptonew."\">" . $this->name . "</a></span>\n";
+    $str .=  "      <span class=\"thread_numposts\">".$this->numposts." posts";
     if($this->numunread != 0) {
-      echo " <strong>(".$this->numunread." unread)</strong>";
+      $str .=  " <strong>(".$this->numunread." unread)</strong>";
     }
-    echo "</span>\n";
-    echo "      <span class=\"thread_lastpost\">Last post: ".
+    $str .=  "</span>\n";
+    $str .=  "      <span class=\"thread_lastpost\">Last post: ".
       date("j. M Y - G:i", $this->lastpost)."</span>\n";
 		$user = $users->getUser($this->first_user);
-    echo "      <span class=\"thread_createdby\">By ".$user->name;
-    echo " at ". date("j. M Y - G:i", $this->first_date)."</span>\n";
-		echo "    </div>\n";
+    $str .=  "      <span class=\"thread_createdby\">By ".$user->name;
+    $str .=  " at ". date("j. M Y - G:i", $this->first_date)."</span>\n";
+		$str .=  "    </div>\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