JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
silence more warnings
[wfpl-cms.git] / config.php
index 994bfb5..1c916a3 100644 (file)
@@ -6,16 +6,55 @@
 define('WFPL_DB', 'fixme');
 define('WFPL_DB_USER', 'fixme');
 define('WFPL_DB_PASS', 'fixme');
-# CMS login passwords are stored in the database. See admin_admins.php
+# CMS login passwords are stored in the database. See admin_users.php
 date_default_timezone_set('America/New_York');
 
+# If you change these, update style.styl too
+define('WFPL_SITE_WIDTH',        950); # "centerer_width" in style.styl
+define('WFPL_IMAGE_WIDTH_FULL',  WFPL_SITE_WIDTH);
+define('WFPL_IMAGE_WIDTH_SMALL', 250); # "sidebar_width" in style.styl
+define('WFPL_IMAGE_WIDTH_THUMB',  70);
+$GLOBALS['wfpl_image_widths'] = array(
+    WFPL_IMAGE_WIDTH_FULL,
+    WFPL_IMAGE_WIDTH_SMALL,
+    WFPL_IMAGE_WIDTH_THUMB
+);
+
 # Enable features, auto-includes
-require_once(DOCROOT . 'inc/wfpl/format.php');
-require_once(DOCROOT . 'inc/wfpl/db.php');
-require_once(DOCROOT . 'inc/wfpl/session_messages.php');
-require_once(DOCROOT . 'inc/session_auth.php');
-require_once(DOCROOT . 'inc/cms.php');
-require_once(DOCROOT . 'inc/misc.php');
+require_once(__DIR__.'/'.'inc/wfpl/format.php');
+require_once(__DIR__.'/'.'inc/wfpl/db.php');
+require_once(__DIR__.'/'.'inc/wfpl/persistent.php');
+require_once(__DIR__.'/'.'inc/wfpl/session_messages.php');
+require_once(__DIR__.'/'.'inc/session_auth.php');
+require_once(__DIR__.'/'.'inc/cms.php');
+require_once(__DIR__.'/'.'inc/misc.php');
 
 # Connect to the database
 db_connect(WFPL_DB, WFPL_DB_USER, WFPL_DB_PASS);
+
+# Create tables, update schema, etc as necessary
+require_once(__DIR__.'/'.'inc/db_upgrade.php');
+db_upgrade();
+
+# paypal_ipn.php calls these when it receives a valid payment
+$GLOBALS['payment_handlers'] = [
+    # the key (below) must be the first word in the paypal variable "custom"
+    # the file will be run with wfpl's file_run()
+    # example:
+    #'membership' => __DIR__.'/'.'inc/payment_membership.php'
+];
+
+$GLOBALS['email_templates'] = [
+    'backend_bug' => [
+        'title' => "Notification for site programmer(s)",
+        'description' => "This email template is used if/when the back-end code of this site encounters an unusual/suspicious situation that it's not sure how to cope with.",
+        'variables' => [
+            ['details', "details about the unusual/suspicious situation"]
+        ],
+        'subject' => "backend alert",
+        'content' => "Hi developer,\n\nPlease investigate the following debugging message from the site:\n\n~details~",
+        'from_addr' => 'noreply@example.com',
+        'to_addr' => 'fixme@example.com' # not all templates need this field
+    ]
+    # ...
+];