summaryrefslogtreecommitdiff
path: root/htdocs/index.php
blob: 3871c4b940c956b80703512222b7d80956e1118c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?php
include_once("config.php");

if($mode == "imagecache") {
  include_once($UTIL_DIR. "/imagecache.php");
  getCachedImage($uri, $mw, $mh);
  return;
}

include_once($MODULES_DIR . "/config.php");

$config = new Config($DATA_DIR . "/config.xml");

header("Content-Type: text/html; charset=UTF-8");

include_once($UTIL_DIR . "/login.php");
if($page == "admin") checklogin();

include_once($MODULES_DIR . "/pages.php");

$pages = new Pages($DATA_DIR . "/pages.xml");
?>
<?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 $config->value('title');?></title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<meta name="MSSmartTagsPreventParsing" content="true"/>
	<meta http-equiv="Content-Type" content="text/html"/>
	<link rel="alternate" type="application/rss+xml" title="RSS" href="rss.xml" />
	<link rel="author" title="Bent Bisballe Nyeng" href="http://www.aasimon.org"/>
	<link href="/favicon.ico" rel="shortcut icon"/>
	<link rel="stylesheet" type="text/css" href="style.css" media="screen"/>
	<link rel="stylesheet" type="text/css" href="handheld.css" media="handheld"/>
	<link rel="stylesheet" type="text/css" href="admin.css" media="screen"/>
	<script type="text/javascript">
	// <!--
    function externalLinks() {
    	if (!document.getElementsByTagName) return;
    	var anchors = document.getElementsByTagName("a");
    	for (var i=0; i<anchors.length; i++) {
    		var anchor = anchors[i];
    		if (anchor.getAttribute("href") &&
    				anchor.getAttribute("rel") == "external")
    			anchor.target = "_blank";
    	}
    }
    window.onload = externalLinks;
// -->
  </script>
</head>
<body>
<div style="display: none;">
<?php
$_ps = $config->value('preload');
foreach($_ps as $_p) {
	echo "	<img alt=\"preload\" src=\"".$_p."\"/>\n";
}
?>
</div>
<?php if(strstr($_SERVER['HTTP_USER_AGENT'], "MSIE 6.0")) echo "<center><table><tr><td>"; ?>
<div class="page">
  <div class="menu" <?php if(strstr($_SERVER['HTTP_USER_AGENT'], "MSIE 6.0")) 
		 echo "style=\"width: 848px;\"";
		 ?>>
<?php
$menu = $config->value('menu');
if(sizeof($menu)) {
	$idx = 1;
	foreach($menu as $_m => $_t) {
		if($idx != 1) {
			echo "    <div class=\"seperator\"></div>\n";
		}
		echo "    <a href=\"?page=".$_m."\" class=\"menu_entry_".$_m."\"></a>\n";
		echo "    <a href=\"?page=".$_m."\" class=\"menutitle\">".$_t."</a>\n";
		$idx++;
	}
}
?>
  </div>
  <div class="wrapper" <?php if(strstr($_SERVER['HTTP_USER_AGENT'], "MSIE 6.0")) 
		 echo "style=\"width: 848px; margin-top: -102px;\"";
		 ?>>
  <div class="content" <?php if(strstr($_SERVER['HTTP_USER_AGENT'], "MSIE 6.0")) 
		 echo "style=\"width: 599px;\"";
		 ?>>
<?php
if($page == "admin") {
	include($UTIL_DIR."/admin.php");
} else {
	if($page) $_p = $pages->getPage($page);
	else $_p = $pages->getPage($config->value('default'));
	if($_p) $_p->show();
}
?>
  </div>
  <div class="column" <?php if(strstr($_SERVER['HTTP_USER_AGENT'], "MSIE 6.0")) 
		 echo "style=\"width: 249px;\"";
		 ?>>
<?php
$_p = $pages->getPage("column");
if($_p) $_p->show();
?>
  </div>
  </div>
  <div class="footer">
<?php
$_p = $pages->getPage("footer");
if($_p) $_p->show();
?>
  </div>
</div>
<?php if(strstr($_SERVER['HTTP_USER_AGENT'], "MSIE 6.0")) echo "</td></tr></table></center>"; ?>
<div>
<a href="?page=admin" class="admin_link"></a>
<a href="?page=admin" class="admin_link_text">Admin</a>
</div>
</body>
</html>