summaryrefslogtreecommitdiff
path: root/forum
diff options
context:
space:
mode:
Diffstat (limited to 'forum')
-rw-r--r--forum/utils/posts.php10
-rw-r--r--forum/utils/threads.php13
2 files changed, 19 insertions, 4 deletions
diff --git a/forum/utils/posts.php b/forum/utils/posts.php
index 3b0e73b..59678de 100644
--- a/forum/utils/posts.php
+++ b/forum/utils/posts.php
@@ -193,9 +193,19 @@ class Posts {
*/
// Linear
+ $firstunread = false;
foreach($this->posts_linear as $post) {
+ if($post->date > $this->thread->lastseen[$current_user->uid] && $firstunread == false) {
+ $firstunread = true;
+ echo " <div id=\"firstunread\"></div>\n";
+ echo " <div class=\"unread\">\n";
+ }
$post->show(" ", false);
}
+
+ if($firstunread == true) {
+ echo " </div>\n";
+ }
$this->thread->lastseen[$current_user->uid] = time();
diff --git a/forum/utils/threads.php b/forum/utils/threads.php
index f65a1f8..0c4ef32 100644
--- a/forum/utils/threads.php
+++ b/forum/utils/threads.php
@@ -20,10 +20,15 @@ class Thread {
public function show()
{
global $fid, $current_user;
+ $jumptonew = "";
echo " <div class=\"thread\">\n";
- if($this->lastseen[$current_user->uid] < $this->lastpost) echo " <div class=\"new\"></div>";
- else echo " <div class=\"nonew\"></div>\n";
- echo " <a href=\"?fid=" . $fid . "&amp;tid=" . $this->tid . "\">" . $this->name . "</a>\n";
+ if($this->lastseen[$current_user->uid] < $this->lastpost) {
+ echo " <div class=\"new\"></div>";
+ $jumptonew = "#firstunread";
+ } else {
+ echo " <div class=\"nonew\"></div>\n";
+ }
+ echo " <a href=\"?fid=" . $fid . "&amp;tid=" . $this->tid . $jumptonew."\">" . $this->name . "</a>\n";
echo " </div>\n";
}
@@ -159,4 +164,4 @@ class Threads {
}
}
-?> \ No newline at end of file
+?>