diff --git a/components/contents.php b/components/contents.php
index 5696351d38a3718a9f4f3b9ac9c84e7c58f50cc5..64e673f94869d6dbe127d1b66779389e870d51eb 100644
--- a/components/contents.php
+++ b/components/contents.php
@@ -1,15 +1,15 @@
 <?php
 
 function listdir($mypath, $recurse, $summaries) {
-	global $DB, $base;
+	global $DB, $settings;
 
-	$dirlist = @scandir($base."static".$mypath);
+	$dirlist = @scandir($settings['base']."static".$mypath);
 	$output = array();
 	if (is_array($dirlist)) foreach($dirlist as $file) {
 		// Hide files starting with a .
 		if ($file[0]!=".") {
 			$element = array();
-			if (!is_dir($base."static".$mypath."/".$file)) {
+			if (!is_dir($settings['base']."static".$mypath."/".$file)) {
 				$pagename = ereg_replace("\.txt", "", $file);
 				if ($summaries) $element['summary'] = $DB->GetOne("select summary from static where path=?", array($mypath."/".$pagename));
 				if ($pagename!=@$lastdir) $output[$pagename]=$element;
@@ -36,7 +36,7 @@ if ($path==$component['path']) {
 	include("static.php");
 
 	if ($title!="File not found") {
-		if (!is_dir($base."static".$path)) {
+		if (!is_dir($settings['base']."static".$path)) {
 			$pos = strrpos($path, "/");
 			$path = substr($path, 0, $pos);
 		}
diff --git a/components/library.php b/components/library.php
index 8cf6f043b3c807902a9c439a5d6fa33c6c02a16e..b6cfee1458150f4cdb4025e64c2e587a8ab1ff0b 100644
--- a/components/library.php
+++ b/components/library.php
@@ -87,7 +87,7 @@ if (isset($_REQUEST['search']) && (trim($_REQUEST['search']) != "")) {
 			// someone wants to check out this book
 			$msgbody = "User {$session->username} would like to take out";
 			$msgbody .= " {$book['title']} by {$book['author']} from the library.\n\n";
-			$msgbody .= "Visit https://$preferred_hostname$path to process this request.";
+			$msgbody .= "Visit https://$settings['preferred_hostname']$path to process this request.";
 			mail($librarian_mail, "Book Request", $msgbody);
 			
 			$smarty->assign("checkout_request", true);
diff --git a/components/milliways.php b/components/milliways.php
index 90b5edb32d5a0c01529811f95614f4a3fd559309..98ac2202d56d2ab34fe8d58d8a76d42f043d483e 100644
--- a/components/milliways.php
+++ b/components/milliways.php
@@ -12,7 +12,7 @@ foreach ($wholist as $person) {
 }
 
 $smarty->assign("people",$people);
-$output = $smarty->fetch($base."templates/milliways.tpl");
+$output = $smarty->fetch($settings['base']."templates/milliways.tpl");
 $smarty->assign("title", "Milliways");
 $smarty->assign("body", $output);
 $smarty->assign("refresh", 120);
diff --git a/components/mw.php b/components/mw.php
index 77f4aed691630470b91f1cc1d4a24c3dcb166e15..bc3bc0185b1ab725072cdbe5d3d874323857922c 100755
--- a/components/mw.php
+++ b/components/mw.php
@@ -176,7 +176,7 @@ if (isset($pathlist[3])) {
 				$sub = fetch_sub($all, $all[$artno]['ref']);
 				$smarty->assign_by_ref("articles", $sub);
 				$smarty->assign("howmany",count($sub));
-				$output = $smarty->fetch($base."templates/mw-article.tpl");
+				$output = $smarty->fetch($settings['base']."templates/mw-article.tpl");
 
 			}
 		} else {
@@ -200,7 +200,7 @@ if (isset($pathlist[3])) {
 
 			$smarty->assign("title", htmlentities("Milliways - Folder $name"));
 			$smarty->assign_by_ref("articles", $top);
-			$output = $smarty->fetch($base."templates/mw-list.tpl");
+			$output = $smarty->fetch($settings['base']."templates/mw-list.tpl");
 		}
 	} else {
 		$output = "Error, no such folder $name";
@@ -218,7 +218,7 @@ if (isset($pathlist[3])) {
 		$folders[$k]['lastpost'] = $lastone['date'];
 	}
 	$smarty->assign("title", "Milliways - Topic List");
-	$output = $smarty->fetch($base."templates/mw-folders.tpl");
+	$output = $smarty->fetch($settings['base']."templates/mw-folders.tpl");
 	$smarty->assign("body", $output);
 }
 
diff --git a/components/options.php b/components/options.php
index 7d5dd7e458a2d1019d7db01f89c2dff6613383b0..d439955e4c6b6d6fd0fc15059907962ba41db84b 100644
--- a/components/options.php
+++ b/components/options.php
@@ -143,8 +143,8 @@ function clearHackergotchi() {
 
 // construct the filesystem path to a user's hackergotchi picture
 function hackergotchiPath($username) {
-	global $base; 
-	$path = $base."htdocs/pictures/people/".$username.".png"; 
+	global $settings; 
+	$path = $settings['base']."htdocs/pictures/people/".$username.".png"; 
 	return $path;
 }
 
@@ -217,7 +217,7 @@ if ($session->loggedin === TRUE) {
 	// Some checking could be done here to ensure we have a members record. Ideally we should
 	// be able to assume this though if they are logged in.
 
-	if (is_file($base."htdocs/pictures/people/".$session->username.".png")) $smarty->assign('hackergotchi', TRUE);
+	if (is_file($settings['base']."htdocs/pictures/people/".$session->username.".png")) $smarty->assign('hackergotchi', TRUE);
 
 
 	$member = $sucsDB->GetRow("select * from members where username='".$session->username."'");
diff --git a/components/pagemap.php b/components/pagemap.php
index 613ee61ead243d5527a93346590bf729b1d080cb..801a327259e84196ec3977142f84ba4126072751 100644
--- a/components/pagemap.php
+++ b/components/pagemap.php
@@ -9,7 +9,7 @@ if (@$pathlist[3] == "Edit") {
 		$res = $DB->GetAll("SELECT * FROM pagemap where id=?", array($id));
 		if ($res && count($res) > 0) {
 			$smarty->assign("oldmap",$res[0]);
-			$output = $smarty->fetch($base."templates/pagemap_edit.tpl");
+			$output = $smarty->fetch($settings['base']."templates/pagemap_edit.tpl");
 		} else {
 			header("Location: /Admin/Pagemap");
 			exit;
@@ -22,7 +22,7 @@ if (@$pathlist[3] == "Edit") {
 
 if (!isset($output)) {
 	$smarty->assign("map",$DB->GetAll("SELECT * FROM pagemap ORDER BY depth, path"));
-	$output = $smarty->fetch($base."templates/pagemap.tpl");
+	$output = $smarty->fetch($settings['base']."templates/pagemap.tpl");
 }
 $smarty->assign("title", "Page Map");
 $smarty->assign("body", $output);
diff --git a/components/pastebin.php b/components/pastebin.php
index 6cdb785a4105a86ddabccadb525a9a81f9e5dd95..c90fd0b75c0eb348532c90af245fd0820f883402 100755
--- a/components/pastebin.php
+++ b/components/pastebin.php
@@ -230,7 +230,7 @@ if(!empty($pblang) && $pblang != 'NONE') {
 $smarty->assign('pasteLanguages', $LANGUAGES);
 
 // Load templates etc
-$smarty->assign("extra_styles", array("$baseurl/css/pastebin.css"));
+$smarty->assign("extra_styles", array("$settings['baseurl']/css/pastebin.css"));
 $result = $smarty->fetch('pastebin.tpl');
 $sidebar = $smarty->fetch('pastebin-sidebar.tpl');
 $smarty->assign('title', 'PasteBin');
diff --git a/components/planet.php b/components/planet.php
index 14cad13947a47fa5b0a938dc5d2666754f287f4f..b10274b58624a5bbd88e01bfa7eb41dff807eac2 100644
--- a/components/planet.php
+++ b/components/planet.php
@@ -4,7 +4,7 @@ $smarty->assign("title", "Planet SUCS");
 $smarty->assign("rss_url", "http://planet.sucs.org/rss20.xml");
 $smarty->assign("atom_url", "http://planet.sucs.org/atom.xml");
 // Read planet output from where (we hope) Planet wrote it
-$body = file_get_contents($base."static/Community/Planet.txt");
+$body = file_get_contents($settings['base']."static/Community/Planet.txt");
 $smarty->assign("body", $body);
 
 ?>
diff --git a/components/static.php b/components/static.php
index 5a98255b5aef03a1f83da11e93d45003292c7cf9..6dbe95555bfd923925a9ce64d9498e0d24ae085b 100644
--- a/components/static.php
+++ b/components/static.php
@@ -5,11 +5,11 @@
 $permission = "html";
 
 // Get the right filename...
-$myfile = $base."static".$path.$language['file'].".txt";
-$secondaryfile = $base."static".$path.$language['file']."-secondary.txt";
+$myfile = $settings['base']."static".$path.$language['file'].".txt";
+$secondaryfile = $settings['base']."static".$path.$language['file']."-secondary.txt";
 if (!file_exists($myfile)) {
-	$myfile = $base."static$path.txt";
-	$secondaryfile = $base."static$path-secondary.txt";
+	$myfile = $settings['base']."static$path.txt";
+	$secondaryfile = $settings['base']."static$path-secondary.txt";
 	// If the file doesn't exist...
 	if (!file_exists($myfile)) {
 		if (isset($session->groups[$permission]) && @$_REQUEST['action']=="create") {
@@ -31,7 +31,7 @@ if (!file_exists($myfile)) {
 			} else {
 				// ...serve a 404 error
 				header("HTTP/1.1 404 Not Found");
-				$body = @file_get_contents($base."static/404.txt");
+				$body = @file_get_contents($settings['base']."static/404.txt");
 				$smarty->assign("pathlist", array("", "Error"));
 				$title = "File not found";
 				$smarty->assign("title", $title);
diff --git a/htdocs/index.php b/htdocs/index.php
index 09800c2ec05eeb02a0aac12d6616b46e6a9993a7..38f659f6debec76895a5b8b3e5cdb58449859ac5 100644
--- a/htdocs/index.php
+++ b/htdocs/index.php
@@ -15,7 +15,7 @@ if (@$displaytime) {
    -------------------------------------------------------- */
 
 include("settings.php");
-if (!(isset($base) && isset($preferred_hostname) && isset($dbname))) {
+if (!(isset($settings))) {
 	echo "Website unconfigured";
 	exit();
 }
@@ -31,20 +31,20 @@ require("../lib/error.php");
 define('SMARTY_DIR', '/usr/share/Smarty/');
 require("/usr/share/Smarty/Smarty.class.php");
 $smarty = new Smarty;
-$smarty->template_dir = $base."templates";
-$smarty->compile_dir = $base."templates_c";
-$smarty->plugins_dir[] = $base."plugins";
+$smarty->template_dir = $settings['base']."templates";
+$smarty->compile_dir = $settings['base']."templates_c";
+$smarty->plugins_dir[] = $settings['base']."plugins";
 
-$smarty->assign("baseurl", $baseurl);
+$smarty->assign("baseurl", $settings['baseurl']);
 
 // Initialise the database
-require("/usr/share/adodb/adodb.inc.php");
+require("/var/www/adodb/adodb.inc.php");
 $DB = NewADOConnection('postgres8');
-$DB->Connect('dbname='.$dbname);
+$DB->Connect('dbname='.$settings['dbname']);
 $DB->SetFetchMode(ADODB_FETCH_ASSOC);
 
 // Include the session library
-require($base."lib/session.php");
+require($settings['base']."lib/session.php");
 $session = new Session;
 $smarty->assign_by_ref("session", $session);
 
@@ -90,7 +90,7 @@ $smarty->assign("language", $language);
 // SSL?
 $ssl_path = @$_SERVER['REQUEST_URI'];
 if (($n=strpos($ssl_path,"?"))!==FALSE) $ssl_path=substr($ssl_path,0,$n);
-$ssl_url = "https://".$preferred_hostname.$ssl_path;
+$ssl_url = "https://".$settings['preferred_hostname'].$ssl_path;
 $smarty->assign("ssl_url", $ssl_url);
 
 
@@ -130,10 +130,10 @@ if ($path == "") $path="/";
 $smarty->assign("title", "Set Me");
 $smarty->assign("body", "Empty Body");
 
-include($base."components/menu.php");
+include($settings['base']."components/menu.php");
 
 // Load the component
-$comppath = $base."components/".$component['component'].".php";
+$comppath = $settings['base']."components/".$component['component'].".php";
 $compoutput = "";
 if (file_exists($comppath)) {
 	ob_start();
diff --git a/settingstemplate b/settingstemplate
index f1899990b0d65de97700e5b1835d1c9ceebe3755..7dd51198c5a0afdcdfa9bedbb04f7ace4920b565 100644
--- a/settingstemplate
+++ b/settingstemplate
@@ -1,8 +1,15 @@
 <?php
+$settings = array(
 // root directory for website - *with* trailing /
-$base = "$BASEDIR/";
-$baseurl = "/~$USERNAME/sucssite";
-$preferred_hostname = "sucs.org";
-$dbname="beta";
+"base" => "$BASEDIR/",
 
+// path to root dir on web server
+"baseurl" => "/~$USERNAME/sucssite",
+
+// Hostname of the server
+"preferred_hostname" => "sucs.org",
+
+// Name of the database
+"dbname" => "beta"
+);
 ?>