summaryrefslogtreecommitdiff
path: root/forum/utils/threads.php
diff options
context:
space:
mode:
Diffstat (limited to 'forum/utils/threads.php')
-rw-r--r--forum/utils/threads.php32
1 files changed, 20 insertions, 12 deletions
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()