summaryrefslogtreecommitdiff
path: root/htdocs/src/base.inc.php
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2011-05-12 16:59:36 -0700
committerJesse Morgan <jesse@jesterpm.net ; true>2011-05-12 16:59:36 -0700
commitdd24e2c973a7979894971bdc38d904d2aecc7d5d (patch)
tree2f8474d22cbf29749219bd6dd543bb22b959465e /htdocs/src/base.inc.php
parente159ae5209a561043ceb89aa640b207df15181b7 (diff)
Well, you can see posts on the moderation panel now
Diffstat (limited to 'htdocs/src/base.inc.php')
-rw-r--r--htdocs/src/base.inc.php45
1 files changed, 45 insertions, 0 deletions
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 @@
+<?php
+
+/* Foursquare Community Site
+ *
+ * Copyright (C) 2011 Foursquare Church.
+ *
+ * Developers: Jesse Morgan <jmorgan@foursquarestaff.com>
+ *
+ */
+
+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";
+}
+
+
+?>