summaryrefslogtreecommitdiff
path: root/forum/utils/view.php
diff options
context:
space:
mode:
Diffstat (limited to 'forum/utils/view.php')
-rw-r--r--forum/utils/view.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/forum/utils/view.php b/forum/utils/view.php
new file mode 100644
index 0000000..0adb1a0
--- /dev/null
+++ b/forum/utils/view.php
@@ -0,0 +1,28 @@
+<?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>";
+ echo "<a href=\"?mode=editor&amp;task=new&amp;fid=".$fid.
+ "&amp;tid=".time()."&amp;pid=-1\">New thread</a>";
+
+ include_once("threads.php");
+ $threads = new Threads($FORUMS_DIR . "/" . $fid);
+ $threads->show();
+ } else {
+ echo "<h1>Forums</h1>";
+ include_once("forums.php");
+ $forums = new Forums($FORUMS_DIR . "/forums.xml");
+ $forums->show();
+ }
+?> \ No newline at end of file