From dd24e2c973a7979894971bdc38d904d2aecc7d5d Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Thu, 12 May 2011 16:59:36 -0700 Subject: Well, you can see posts on the moderation panel now --- htdocs/src/base.inc.php | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 htdocs/src/base.inc.php (limited to 'htdocs/src/base.inc.php') diff --git a/htdocs/src/base.inc.php b/htdocs/src/base.inc.php new file mode 100644 index 0000000..d7a9354 --- /dev/null +++ b/htdocs/src/base.inc.php @@ -0,0 +1,45 @@ + + * + */ + +require_once('config.inc.php'); + +require_once('Cif_Database.inc.php'); + +/* Set the timezone for PHP */ +date_default_timezone_set('America/Los_Angeles'); + +/* Start Session */ +session_start(); + +/* Helper functions */ +$__DB = null; + +function getDatabase() { + global $CONFIG, $__DB; + + if ($__DB == null) { + try { + $__DB = new Cif_Database($CONFIG['dbhost'], $CONFIG['dbuser'], + $CONFIG['dbpass'], $CONFIG['dbname']); + + } catch (Cif_Database_Exception $e) { + die("Could not connect to database"); + } + } + + return $__DB; +} + +function __autoload($class) { + require_once "$class.inc.php"; +} + + +?> -- cgit v1.2.3