summaryrefslogtreecommitdiff
path: root/forum/utils/threads.php
diff options
context:
space:
mode:
authordeva <deva>2010-03-13 13:43:39 +0000
committerdeva <deva>2010-03-13 13:43:39 +0000
commit008411240d192871d40bc2075911ff794ecb25a0 (patch)
treebde9072f0032977399104df3e2429b4572f11bb6 /forum/utils/threads.php
parent23e6eb95cd1d85587596f11df05b716b6f220dfb (diff)
Some layout changes on forum/threads.
Diffstat (limited to 'forum/utils/threads.php')
-rw-r--r--forum/utils/threads.php28
1 files changed, 22 insertions, 6 deletions
diff --git a/forum/utils/threads.php b/forum/utils/threads.php
index 0c4ef32..11c54ee 100644
--- a/forum/utils/threads.php
+++ b/forum/utils/threads.php
@@ -1,4 +1,4 @@
-<?php
+<?php /* -*- Mode: php; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
include_once($UTIL_DIR . "/convert.php");
@@ -20,14 +20,16 @@ class Thread {
public function show()
{
global $fid, $current_user;
+
$jumptonew = "";
- echo " <div class=\"thread\">\n";
+ $newcls = "";
if($this->lastseen[$current_user->uid] < $this->lastpost) {
- echo " <div class=\"new\"></div>";
+ $newcls = " thread_new";
$jumptonew = "#firstunread";
- } else {
- echo " <div class=\"nonew\"></div>\n";
- }
+ }
+
+ echo " <div class=\"thread\">\n";
+ echo " <span class=\"thread_icon".$newcls."\"></span>";
echo " <a href=\"?fid=" . $fid . "&amp;tid=" . $this->tid . $jumptonew."\">" . $this->name . "</a>\n";
echo " </div>\n";
}
@@ -117,6 +119,20 @@ class Threads {
return $thread;
}
+ public function getLatestThread()
+ {
+ $tid = -1;
+ $last = -1;
+ foreach($this->threads as $thread) {
+ if($thread->lastpost > $last) {
+ $last = $thread->lastpost;
+ $tid = $thread->tid;
+ }
+ }
+ if($tid != -1) return $this->getThread($tid);
+ return NULL;
+ }
+
public function show()
{
foreach($this->threads as $thread) {