From a7b6200402e341e97472ec401eabe4cf49f1161c Mon Sep 17 00:00:00 2001 From: deva Date: Fri, 21 May 2010 12:38:09 +0000 Subject: More info in views. --- forum/utils/forums.php | 4 ++- forum/utils/threads.php | 11 +++++-- forum/utils/view.php | 86 +++++++++++++++++++++++++++---------------------- 3 files changed, 59 insertions(+), 42 deletions(-) diff --git a/forum/utils/forums.php b/forum/utils/forums.php index 06196a6..c9c48b5 100644 --- a/forum/utils/forums.php +++ b/forum/utils/forums.php @@ -25,7 +25,7 @@ class Forum { public function show() { - $newcls = ""; + $newcls = " forum_nonew"; if($this->newStuff) $newcls = " forum_new"; echo "
\n"; @@ -84,9 +84,11 @@ class Forums { public function show() { + echo "
\n"; foreach($this->forums as $forum) { $forum->show(); } + echo "
\n"; } private function read() diff --git a/forum/utils/threads.php b/forum/utils/threads.php index 11c54ee..258f97c 100644 --- a/forum/utils/threads.php +++ b/forum/utils/threads.php @@ -22,15 +22,19 @@ class Thread { global $fid, $current_user; $jumptonew = ""; - $newcls = ""; + $newcls = " thread_nonew"; if($this->lastseen[$current_user->uid] < $this->lastpost) { $newcls = " thread_new"; $jumptonew = "#firstunread"; } echo "
\n"; - echo " "; - echo " " . $this->name . "\n"; + echo "  \n"; + echo " " . $this->name . "\n"; + echo " Last post: ". + date("j. M Y - G:i", $this->lastpost)."\n"; + // echo " ".$this->numposts." posts\n"; echo "
\n"; } @@ -51,6 +55,7 @@ class Thread { $this->tid = $tid; $this->name = $name; $this->lastpost = $lastpost; + if($this->lastpost == "") $this->lastpost = 0; $this->loadLastSeen($lastseen); } } diff --git a/forum/utils/view.php b/forum/utils/view.php index d22c8d8..2673394 100644 --- a/forum/utils/view.php +++ b/forum/utils/view.php @@ -1,46 +1,56 @@ "; -if($fid) echo "forums"; -if($tid) echo ":: threads"; -if($pid) echo ":: posts"; -echo "
\n"; - - - if($fid && $tid) { - // echo "

Posts

"; - include_once("posts.php"); - $posts = new Posts($FORUMS_DIR . "/" . $fid . "/" . $tid . ".xml"); - $posts->show(); - } else if($fid) { - echo "

Threads

\n"; - echo " New thread\n"; - - include_once("threads.php"); - $threads = new Threads($FORUMS_DIR . "/" . $fid); - $threads->show(); - } else { - echo "

Forums

\n"; - include_once("forums.php"); - $forums = new Forums($FORUMS_DIR . "/forums.xml"); - - if($action == "addforum") { - $newfid = 1; - while($forums->getForum($newfid)) $newfid++; - - $forums->add(new Forum($newfid, $title)); - $forums->write(); - } - - $forums->show(); - - if($current_user->uid == 0) { +if($fid) { + echo "Legend: Forums"; + if($tid) { + include_once("forums.php"); + $forums = new Forums($FORUMS_DIR . "/forums.xml"); + $forum = $forums->getForum($fid); + echo " :: ".$forum->name.""; + + include_once("posts.php"); + $posts = new Posts($FORUMS_DIR . "/" . $fid . "/" . $tid . ".xml"); + echo " :: ".$posts->thread->name; + + $posts->show(); + + } else { + include_once("forums.php"); + $forums = new Forums($FORUMS_DIR . "/forums.xml"); + $forum = $forums->getForum($fid); + echo " :: ".$forum->name; + + echo "

Threads in '".$forum->name."'

\n"; + echo " New thread\n"; + + include_once("threads.php"); + $threads = new Threads($FORUMS_DIR . "/" . $fid); + $threads->show(); + } +} else { + echo "Legend: Forums"; + echo "

Forums

\n"; + include_once("forums.php"); + $forums = new Forums($FORUMS_DIR . "/forums.xml"); + + if($action == "addforum") { + $newfid = 1; + while($forums->getForum($newfid)) $newfid++; + + $forums->add(new Forum($newfid, $title)); + $forums->write(); + } + + $forums->show(); + + if($current_user->uid == 0) { ?>
Add new forum:
\n"; ?> \ No newline at end of file -- cgit v1.2.3