summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--htdocs/config.php.defaults30
-rw-r--r--htdocs/index.php118
-rw-r--r--utils/config.php21
3 files changed, 85 insertions, 84 deletions
diff --git a/htdocs/config.php.defaults b/htdocs/config.php.defaults
index 2bc5373..401e2e7 100644
--- a/htdocs/config.php.defaults
+++ b/htdocs/config.php.defaults
@@ -1,19 +1,39 @@
<?php
$PAGE_DIR = "../pages";
-
$DATA_DIR = "../data";
-
$ALBUMS_DIR = "gfx/albums";
-
$UTIL_DIR = "../utils";
-
$MODULES_DIR = $UTIL_DIR . "/modules";
$MODULES = array("news", "events", "pages", "gallery");
$DEFAULT_PAGE = "news";
-$ADMIN_TIMEOUT = 60*60 // 60 min timeout
+$ADMIN_TIMEOUT = 60*60; // 60 min timeout
+
+$TITLE = "blah";
+
+$PRELOAD = array("gfx/biography_hover.jpg",
+ "gfx/contact_hover.jpg",
+ "gfx/discography_hover.jpg",
+ "gfx/downloads_hover.jpg",
+ "gfx/gallery_hover.jpg",
+ "gfx/guestbook_hover.jpg",
+ "gfx/live_hover.jpg",
+ "gfx/members_hover.jpg",
+ "gfx/news_hover.jpg",
+ "gfx/shop_hover.jpg");
+
+$MENU = array("news" => "News",
+ "shop" => "Shop",
+ "downloads" => "Downloads",
+ "biography" => "Biography",
+ "live" => "Concerts",
+ "discography" => "Discography",
+ "guestbook" => "Guestbook",
+ "members" => "Members",
+ "gallery" => "Gallery",
+ "contact" => "Contact");
?> \ No newline at end of file
diff --git a/htdocs/index.php b/htdocs/index.php
index 240554d..4f8d946 100644
--- a/htdocs/index.php
+++ b/htdocs/index.php
@@ -1,5 +1,6 @@
<?php
include_once("config.php");
+include_once($UTIL_DIR . "/config.php");
include_once($UTIL_DIR . "/guestbook.php");
header("Content-Type: text/html; charset=UTF-8");
@@ -15,65 +16,52 @@ $pages = new Pages($DATA_DIR . "/pages.xml");
<!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>ExecutionRoom.com - Official DIE website</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" src="external.js"></script>
+ <title><?php echo config('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;">
-<img alt="preload" src="gfx/biography_hover.jpg"/>
-<img alt="preload" src="gfx/contact_hover.jpg"/>
-<img alt="preload" src="gfx/discography_hover.jpg"/>
-<img alt="preload" src="gfx/downloads_hover.jpg"/>
-<img alt="preload" src="gfx/gallery_hover.jpg"/>
-<img alt="preload" src="gfx/guestbook_hover.jpg"/>
-<img alt="preload" src="gfx/live_hover.jpg"/>
-<img alt="preload" src="gfx/members_hover.jpg"/>
-<img alt="preload" src="gfx/news_hover.jpg"/>
-<img alt="preload" src="gfx/shop_hover.jpg"/>
+<?php
+$ps = config('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;\"";
?>>
- <a href="?page=news" class="menu_entry_news"></a>
- <a href="?page=news" class="menutitle">News</a>
-
- <a href="?page=shop" class="menu_entry_shop"></a>
- <a href="?page=shop" class="menutitle">Shop</a>
-
- <a href="?page=downloads" class="menu_entry_downloads"></a>
- <a href="?page=downloads" class="menutitle">Downloads</a>
-
- <a href="?page=biography" class="menu_entry_biography"></a>
- <a href="?page=biography" class="menutitle">Biography</a>
-
- <a href="?page=live" class="menu_entry_live"></a>
- <a href="?page=live" class="menutitle">Live Shows</a>
-
- <a href="?page=discography" class="menu_entry_discography"></a>
- <a href="?page=discography" class="menutitle">Discography</a>
-
- <a href="?page=guestbook" class="menu_entry_guestbook"></a>
- <a href="?page=guestbook" class="menutitle">Guestbook</a>
-
- <a href="?page=members" class="menu_entry_members"></a>
- <a href="?page=members" class="menutitle">Members</a>
-
- <a href="?page=gallery" class="menu_entry_gallery"></a>
- <a href="?page=gallery" class="menutitle">Gallery</a>
-
- <a href="?page=contact" class="menu_entry_contact"></a>
- <a href="?page=contact" class="menutitle">Contact</a>
+<?php
+$menu = config('menu');
+foreach($menu as $m => $t) {
+ echo " <a href=\"?page=".$m."\" class=\"menu_entry_".$m."\"></a>\n";
+ echo " <a href=\"?page=".$m."\" class=\"menutitle\">".$t."</a>\n";
+ echo "\n";
+}
+?>
</div>
<div class="wrapper" <?php if(strstr($_SERVER['HTTP_USER_AGENT'], "MSIE 6.0"))
echo "style=\"width: 848px; margin-top: -102px;\"";
@@ -88,37 +76,9 @@ if($page == "admin") {
include($PAGE_DIR."/admin.php");
} else {
if($page) $p = $pages->getPage($page);
- else $p = $pages->getPage($DEFAULT_PAGE);
+ else $p = $pages->getPage(config('default'));
if($p) $p->show();
}
-
-/*
-switch($page) {
-case "news": include($PAGE_DIR."/news.php"); break;
-case "shop": include($PAGE_DIR."/shop.php"); break;
-case "downloads": include($PAGE_DIR."/downloads.php"); break;
-case "biography": include($PAGE_DIR."/biography.php"); break;
-case "live": include($PAGE_DIR."/live.php"); break;
-case "discography": include($PAGE_DIR."/discography.php"); break;
-case "members": include($PAGE_DIR."/members.php"); break;
-case "guestbook": include($PAGE_DIR."/guestbook.php"); break;
-case "gallery": include($PAGE_DIR."/gallery.php"); break;
-case "contact": include($PAGE_DIR."/contact.php"); break;
-
-// Hidden pages
-case "lyrics": include($PAGE_DIR."/lyrics.php"); break;
-case "links": include($PAGE_DIR."/links.php"); break;
-case "admin": include($PAGE_DIR."/admin.php"); break;
-case "rss": include($PAGE_DIR."/rss.php"); break;
-
-// Paypal result pages
-case "thanx": include($PAGE_DIR."/thanx.php"); break;
-case "cancel": include($PAGE_DIR."/cancel.php"); break;
-
-// Default
-default: include($PAGE_DIR."/news.php"); break;
-}
-*/
?>
</div>
<div class="column" <?php if(strstr($_SERVER['HTTP_USER_AGENT'], "MSIE 6.0"))
diff --git a/utils/config.php b/utils/config.php
new file mode 100644
index 0000000..8bdbd15
--- /dev/null
+++ b/utils/config.php
@@ -0,0 +1,21 @@
+<?php
+/* -*- Mode: php; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+
+function config($var)
+{
+ global $TITLE, $PRELOAD, $DEFAULT_PAGE, $MENU;
+ switch($var) {
+ case 'title':
+ return $TITLE;
+ case 'preload':
+ return $PRELOAD;
+ case 'default':
+ return $DEFAULT_PAGE;
+ case 'menu':
+ return $MENU;
+ default:
+ return $var;
+ }
+}
+
+?> \ No newline at end of file