diff options
-rw-r--r-- | index.php | 31 | ||||
-rw-r--r-- | themes/default/footer.php | 2 |
2 files changed, 18 insertions, 15 deletions
@@ -7,18 +7,10 @@ define('BAYONET_ROOT', basename(dirname('.'))); define('BAYONET_INCLUDE', BAYONET_ROOT . '/include');
define('BAYONET_CONFIG', BAYONET_ROOT . '/include/config.ini');
-require BAYONET_INCLUDE . '/config.php';
require BAYONET_INCLUDE . '/debug.php';
require BAYONET_INCLUDE . '/sql.class.php';
require BAYONET_INCLUDE . '/functions.php';
-$db = new Bayonet_SQL();
-$db->Connect(
- $config['sql']['hostname'],
- $config['sql']['username'],
- $config['sql']['password']
- );
-$db->Select_db($config['sql']['database']);
class Bayonet_Theme
{
@@ -38,7 +30,7 @@ class Bayonet_Theme {
if(!isset($_GET['theme']))
{
- self::$name = Bayonet_Config::$ini['Theme']['name'];
+ self::$name = Bayonet_Config::$ini['site']['theme'];
}
else
{
@@ -62,7 +54,7 @@ class Bayonet_Theme self::$header = self::$root_path . '/header.php';
self::$footer = self::$root_path . '/footer.php';
- decho(get_class_vars(Bayonet_Theme));
+ //decho(get_class_vars(Bayonet_Theme)); //do not re-enable this
self::load();
}
@@ -80,8 +72,19 @@ class Bayonet_Theme static function load()
{
- global $db;
-
+ global $db, $config;
+
+ // Globally referenced configuration and database variables
+ $config = Bayonet_Config::$ini;
+ $db = new Bayonet_SQL();
+
+ $db->Connect(
+ $config['sql']['hostname'],
+ $config['sql']['username'],
+ $config['sql']['password']
+ );
+ $db->Select_db($config['sql']['database']);
+
decho("Loading theme: '" . self::$name . "'");
require self::$index;
}
@@ -104,7 +107,7 @@ class Bayonet_Config }
class Bayonet
-{
+{
static function init()
{
decho('Initializing Bayonet');
@@ -113,8 +116,8 @@ class Bayonet }
}
-
Bayonet::init();
+
?>
\ No newline at end of file diff --git a/themes/default/footer.php b/themes/default/footer.php index cbbd2bd..e971b9f 100644 --- a/themes/default/footer.php +++ b/themes/default/footer.php @@ -34,7 +34,7 @@ $debug_output = sprintf("Page generated in %.3f seconds | Memory: real(%.3fmb) p <a href="admin/">Administrative Control Panel</a><br /> <?php echo $config['product']['name'] . ' ' . $config['product']['version'] . ' ' . $config['product']['release'] ?><br /> -<?php echo $config['product']['copyright']; ?><br /> +<?php echo stripslashes($config['product']['copyright']); ?><br /> <?php if($config['debug']['enabled']) echo $debug_output ?><br /> <a href="http://www.dreamhost.com/r.cgi?145892" target="_blank"><img src="http://www.dreamhost.com/images/rewards/80x15-e.png" /></a><br /><br /> |