summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--forum/htdocs/index.php54
-rw-r--r--forum/utils/contacts.php6
-rw-r--r--forum/utils/forums.php10
-rw-r--r--forum/utils/posts.php10
-rw-r--r--forum/utils/threads.php10
-rw-r--r--forum/utils/view.php10
6 files changed, 52 insertions, 48 deletions
diff --git a/forum/htdocs/index.php b/forum/htdocs/index.php
index 163537c..23b9d36 100644
--- a/forum/htdocs/index.php
+++ b/forum/htdocs/index.php
@@ -1,5 +1,6 @@
<?php
header("Content-Type: text/html; charset=UTF-8");
+session_cache_limiter('nocache');
include_once("config.php");
@@ -28,26 +29,25 @@ include_once($UTIL_DIR . "/clientinfo.php");
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<title><?php echo $FORUM_TITLE; ?></title>
-<meta name="MSSmartTagsPreventParsing" content="true"/>
-<meta http-equiv="Content-Type" content="text/html"/>
-<link rel="author" title="Bent Bisballe Nyeng" href="http://www.aasimon.org"/>
-<link rel="stylesheet" type="text/css" href="forum.css"/>
-<?php if($mode == "editor") {?><script language="javascript" src="lib.js" type="text/javascript"></script><?php } ?>
-</head>
-<body>
-<div class="menu">
- <a href="?mode=forum">Forum</a>
- <a href="?mode=filehandler">Filehandler</a>
- <a href="?mode=calendar">Calendar</a>
- <a href="?mode=addressbook">Addressbook</a>
- <a href="?mode=profile">Profile</a><?php
- if($current_user->uid == 0) {
-?> <a href="?mode=diagnostics">Diagnostics</a><?php
- }
-?></div>
-
+ <head>
+ <title><?php echo $FORUM_TITLE; ?></title>
+ <meta name="MSSmartTagsPreventParsing" content="true"/>
+ <meta http-equiv="Content-Type" content="text/html"/>
+ <meta http-equiv="Pragma" content="no-cache">
+ <meta http-equiv="Expires" content="-1">
+ <link rel="author" title="Bent Bisballe Nyeng" href="http://www.aasimon.org"/>
+ <link rel="stylesheet" type="text/css" href="forum.css"/>
+<?php if($mode == "editor") {?> <script language="javascript" src="lib.js" type="text/javascript"></script><?php } ?>
+ </head>
+ <body>
+ <div class="menu">
+ <a href="?mode=forum">Forum</a>
+ <a href="?mode=filehandler">Filehandler</a>
+ <a href="?mode=calendar">Calendar</a>
+ <a href="?mode=addressbook">Addressbook</a>
+ <a href="?mode=profile">Profile</a>
+<?php if($current_user->uid == 0) {?> <a href="?mode=diagnostics">Diagnostics</a><?php } ?>
+ </div>
<?php
// Globals:
@@ -57,7 +57,7 @@ include_once($UTIL_DIR . "/clientinfo.php");
// $task
if($current_user) {
- echo "<p>Logged in as: " . $current_user->name . " - <a href=\"?action=logout\">Logout</a></p>";
+ echo " <p>Logged in as: " . $current_user->name . " - <a href=\"?action=logout\">Logout</a></p>\n";
switch($mode) {
case "profile":
@@ -95,13 +95,13 @@ if($current_user) {
}
} else {
?>
-<form action="?action=login" method="post">
-<p>UserID: <input name="current_username"/></p>
-<p>Password: <input name="current_password" type="password"/></p>
-<p><button type="submit">Login</button></p>
-</form>
+ <form action="?action=login" method="post">
+ <p>UserID: <input name="current_username"/></p>
+ <p>Password: <input name="current_password" type="password"/></p>
+ <p><button type="submit">Login</button></p>
+ </form>
<?php
}
?>
-</body>
+ </body>
</html>
diff --git a/forum/utils/contacts.php b/forum/utils/contacts.php
index a83e3f5..7458108 100644
--- a/forum/utils/contacts.php
+++ b/forum/utils/contacts.php
@@ -130,13 +130,17 @@ class ContactGroup {
public function showshort()
{
+ global $client_is_mobile_device;
$ness = 0;
foreach($this->contacts as $contact) {
if($contact->essential) $ness += 1;
}
echo " <div class=\"contactgroup\">\n";
- echo " <div class=\"title\"><a href=\"?mode=addressbook&amp;gid=" . $this->gid . "\">" . $this->name . "</a> - ".sizeof($this->contacts)." contacts (". sprintf("%d", sizeof($this->contacts) - $ness)." hidden)</div>\n";
+ echo " <div class=\"title\"><a href=\"?mode=addressbook&amp;gid=" . $this->gid . "\">" . $this->name . "</a>";
+ if(!$client_is_mobile_device)
+ echo " - ".sizeof($this->contacts)." contacts (". sprintf("%d", sizeof($this->contacts) - $ness)." hidden)";
+ echo "</div>\n";
echo " <div class=\"contacts\">\n";
foreach($this->contacts as $contact) {
if($contact->essential) $contact->showshort();
diff --git a/forum/utils/forums.php b/forum/utils/forums.php
index 1ee2eb9..1827e3c 100644
--- a/forum/utils/forums.php
+++ b/forum/utils/forums.php
@@ -16,11 +16,11 @@ class Forum {
public function show()
{
- echo "<div class=\"forum\">";
- if($this->newStuff) echo "<div class=\"new\"></div>";
- else echo "<div class=\"nonew\"></div>";
- echo "<a href=\"?fid=" . $this->fid . "\">" . $this->name . "</a>";
- echo "</div>";
+ echo " <div class=\"forum\">\n";
+ if($this->newStuff) echo " <div class=\"new\"></div>\n";
+ else echo " <div class=\"nonew\"></div>\n";
+ echo " <a href=\"?fid=" . $this->fid . "\">" . $this->name . "</a>\n";
+ echo " </div>\n";
}
public function Forum($fid, $name)
diff --git a/forum/utils/posts.php b/forum/utils/posts.php
index e9a5d1d..3a2ecc5 100644
--- a/forum/utils/posts.php
+++ b/forum/utils/posts.php
@@ -45,7 +45,7 @@ class Post {
return $result;
}
- public function show($indent = "", $recurse = true)
+ public function show($indent = " ", $recurse = true)
{
global $users, $fid, $tid, $current_user, $client_is_mobile_device;
$user = $users->getUser($this->user);
@@ -72,7 +72,7 @@ class Post {
echo parse($this->message, $indent . " ") . "\n";
if($user->signature != "\n " && $user->signature != "") {
echo $indent . " <div class=\"signature\">\n";
- echo parse("\n------------------\n" . $user->signature, $indent . " ") . "\n";
+ echo parse("------------------\n" . $user->signature, $indent . " ") . "\n";
echo $indent . " </div>\n";
}
echo $indent . " </div>\n";
@@ -184,7 +184,7 @@ class Posts {
public function show()
{
global $current_user;
- echo "<h1 id=\"top\">" . $this->thread->name . "</h1>";
+ echo " <h1 id=\"top\">" . $this->thread->name . "</h1>\n";
/* // Recursive
foreach($this->posts as $post) {
@@ -194,14 +194,14 @@ class Posts {
// Linear
foreach($this->posts_linear as $post) {
- $post->show("", false);
+ $post->show(" ", false);
}
$this->thread->lastseen[$current_user->uid] = time();
$this->write();
- echo "<p><a href=\"#top\">Back to the top</a></p>";
+ echo " <p><a href=\"#top\">Back to the top</a></p>\n";
}
private function recurser($parentpost, $element)
diff --git a/forum/utils/threads.php b/forum/utils/threads.php
index e3f0996..f65a1f8 100644
--- a/forum/utils/threads.php
+++ b/forum/utils/threads.php
@@ -20,11 +20,11 @@ class Thread {
public function show()
{
global $fid, $current_user;
- echo "<div class=\"thread\">";
- if($this->lastseen[$current_user->uid] < $this->lastpost) echo "<div class=\"new\"></div>";
- else echo "<div class=\"nonew\"></div>";
- echo "<a href=\"?fid=" . $fid . "&amp;tid=" . $this->tid . "\">" . $this->name . "</a>";
- echo "</div>";
+ 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";
+ echo " </div>\n";
}
private function loadLastSeen($lastseen)
diff --git a/forum/utils/view.php b/forum/utils/view.php
index 9ff3143..d22c8d8 100644
--- a/forum/utils/view.php
+++ b/forum/utils/view.php
@@ -1,5 +1,5 @@
<?php
-echo "<div class=\"navigation\">";
+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>";
@@ -12,15 +12,15 @@ echo "</div>\n";
$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>";
+ 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>";
+ echo " <h1>Forums</h1>\n";
include_once("forums.php");
$forums = new Forums($FORUMS_DIR . "/forums.xml");