summaryrefslogtreecommitdiff
path: root/forum/utils/view.php
diff options
context:
space:
mode:
authordeva <deva>2010-05-21 12:38:09 +0000
committerdeva <deva>2010-05-21 12:38:09 +0000
commita7b6200402e341e97472ec401eabe4cf49f1161c (patch)
tree8a519821ab488d3f66488bd26565e2e95e4c0a40 /forum/utils/view.php
parent78e8418d39975e22043b3ffe1df04a439c9ee25c (diff)
More info in views.
Diffstat (limited to 'forum/utils/view.php')
-rw-r--r--forum/utils/view.php86
1 files changed, 48 insertions, 38 deletions
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 @@
<?php
echo " <div class=\"navigation\">";
-if($fid) echo "<a href=\"?\">forums</a>";
-if($tid) echo ":: <a href=\"?fid=" . $fid . "\">threads</a>";
-if($pid) echo ":: <a href=\"?fid=" . $fid . "&amp;tid=" . $tid . "\">posts</a>";
-echo "</div>\n";
-
-
- if($fid && $tid) {
- // echo "<h1>Posts</h1>";
- include_once("posts.php");
- $posts = new Posts($FORUMS_DIR . "/" . $fid . "/" . $tid . ".xml");
- $posts->show();
- } else if($fid) {
- echo " <h1>Threads</h1>\n";
- echo " <a href=\"?mode=editor&amp;task=new&amp;fid=".$fid.
- "&amp;tid=".time()."&amp;pid=-1\">New thread</a>\n";
-
- include_once("threads.php");
- $threads = new Threads($FORUMS_DIR . "/" . $fid);
- $threads->show();
- } else {
- echo " <h1>Forums</h1>\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: <a href=\"?\">Forums</a>";
+ if($tid) {
+ include_once("forums.php");
+ $forums = new Forums($FORUMS_DIR . "/forums.xml");
+ $forum = $forums->getForum($fid);
+ echo " :: <a href=\"?fid=" . $fid . "\">".$forum->name."</a>";
+
+ 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 " <h1>Threads in '".$forum->name."'</h1>\n";
+ echo " <a href=\"?mode=editor&amp;task=new&amp;fid=".$fid.
+ "&amp;tid=".time()."&amp;pid=-1\">New thread</a>\n";
+
+ include_once("threads.php");
+ $threads = new Threads($FORUMS_DIR . "/" . $fid);
+ $threads->show();
+ }
+} else {
+ echo "Legend: Forums";
+ echo " <h1>Forums</h1>\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) {
?>
<form method="post" action="?mode=forum&amp;action=addforum">
Add new forum: <input name="title" value=""><button type="submit">Add</button>
</form>
<?php
- }
-
- }
+ }
+}
+echo "</div>\n";
?> \ No newline at end of file