Fixed some upgrade bugs; added support for choosing one's own date/time formats; rebrand as 1.1.7
authorDan
Thu, 20 Aug 2009 20:01:55 -0400
changeset 1081 745200a9cc2a
parent 1080 6358f769ecb1
child 1082 d1c41601ef39
Fixed some upgrade bugs; added support for choosing one's own date/time formats; rebrand as 1.1.7
ajax.php
cron.php
includes/cache.php
includes/captcha.php
includes/captcha/engine_default.php
includes/captcha/engine_failsafe.php
includes/captcha/engine_potpourri.php
includes/clientside/jscompress.php
includes/clientside/jsres.php
includes/clientside/tinymce/tiny_mce_gzip.php
includes/comment.php
includes/common.php
includes/common_cli.php
includes/constants.php
includes/dbal.php
includes/diff.php
includes/diffiehellman.php
includes/email.php
includes/functions.php
includes/hmac.php
includes/http.php
includes/js-compressor.php
includes/lang.php
includes/log.php
includes/math.php
includes/namespaces/admin.php
includes/namespaces/api.php
includes/namespaces/default.php
includes/namespaces/file.php
includes/namespaces/special.php
includes/namespaces/template.php
includes/namespaces/user.php
includes/output.php
includes/pageprocess.php
includes/pageutils.php
includes/paths.php
includes/plugins.php
includes/render.php
includes/search.php
includes/sessions.php
includes/sql_parse.php
includes/stats.php
includes/tagcloud.php
includes/template.php
includes/wikiengine/Tables.php
includes/wikiengine/TagSanitizer.php
includes/wikiengine/parse_mediawiki.php
includes/wikiengine/render_xhtml.php
includes/wikiformat.php
index.php
install/includes/cli-core.php
install/includes/common.php
install/includes/libenanoinstall.php
install/includes/libenanoinstallcli.php
install/includes/payload.php
install/includes/stages/confirm.php
install/includes/stages/database.php
install/includes/stages/database_mysql.php
install/includes/stages/database_post.php
install/includes/stages/database_postgresql.php
install/includes/stages/finish.php
install/includes/stages/install.php
install/includes/stages/license.php
install/includes/stages/login.php
install/includes/stages/sysreqs.php
install/includes/stages/website.php
install/includes/ui.php
install/index.php
install/install-cli.php
install/install.php
install/readme.php
install/schemas/mysql_stage2.sql
install/schemas/postgresql_stage2.sql
install/schemas/upgrade/1.1.6-1.1.7-mysql.sql
install/schemas/upgrade/1.1.6-1.1.7-postgresql.sql
install/upgrade.php
language/english/user.json
plugins/PrivateMessages.php
plugins/SpecialAdmin.php
plugins/SpecialCSS.php
plugins/SpecialGroups.php
plugins/SpecialLog.php
plugins/SpecialPageFuncs.php
plugins/SpecialSearch.php
plugins/SpecialUpdownload.php
plugins/SpecialUserFuncs.php
plugins/SpecialUserPrefs.php
plugins/admin/CacheManager.php
plugins/admin/GroupManager.php
plugins/admin/Home.php
plugins/admin/LangManager.php
plugins/admin/PageEditor.php
plugins/admin/PageGroups.php
plugins/admin/PageManager.php
plugins/admin/PluginManager.php
plugins/admin/SecurityLog.php
plugins/admin/ThemeManager.php
plugins/admin/UserManager.php
plugins/admin/UserRanks.php
themes/enanium/css/babygrand.css
--- a/ajax.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/ajax.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
@@ -96,7 +95,7 @@
         $row =& $draft_row;
         $return['have_draft'] = true;
         $return['draft_author'] = $row['author'];
-        $return['draft_time'] = enano_date('d M Y h:i a', intval($row['time_id']));
+        $return['draft_time'] = enano_date(ED_DATE | ED_TIME, intval($row['time_id']));
         if ( isset($_GET['get_draft']) && @$_GET['get_draft'] === '1' )
         {
           $return['src'] = $row['page_text'];
@@ -286,7 +285,7 @@
           $return = array(
             'mode' => 'obsolete',
             'author' => $row['author'],
-            'date_string' => enano_date('d M Y h:i a', $row['time_id']),
+            'date_string' => enano_date(ED_DATE | ED_TIME, $row['time_id']),
             'time' => $row['time_id'] // time() ???
             );
           echo enano_json_encode($return);
--- a/cron.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/cron.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/includes/cache.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/cache.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/includes/captcha.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/captcha.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * captcha.php - visual confirmation system used during registration
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
--- a/includes/captcha/engine_default.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/captcha/engine_default.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * captcha.php - visual confirmation system used during registration
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
--- a/includes/captcha/engine_failsafe.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/captcha/engine_failsafe.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * captcha.php - visual confirmation system used during registration
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
--- a/includes/captcha/engine_potpourri.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/captcha/engine_potpourri.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * captcha.php - visual confirmation system used during registration
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
--- a/includes/clientside/jscompress.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/clientside/jscompress.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * jsres.php - the Enano client-side runtime, a.k.a. AJAX on steroids
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
--- a/includes/clientside/jsres.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/clientside/jsres.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * jsres.php - the Enano client-side runtime, a.k.a. AJAX on steroids
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
--- a/includes/clientside/tinymce/tiny_mce_gzip.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/clientside/tinymce/tiny_mce_gzip.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * tiny_mce_gzip.php - TinyMCE gzip and caching script, stock from MoxieCode with one modification
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
--- a/includes/comment.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/comment.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
@@ -157,7 +156,7 @@
             }
             
             // Format date
-            $row['time'] = enano_date('F d, Y h:i a', $row['time']);
+            $row['time'] = enano_date(ED_DATE | ED_TIME, $row['time']);
             
             // Format signature
             $row['signature'] = ( !empty($row['signature']) ) ? RenderMan::render($row['signature']) : '';
@@ -319,7 +318,7 @@
           if ( $appr === COMMENT_APPROVED && $spam_policy === 'moderate' && !$spamcheck )
             $appr = COMMENT_SPAM;
           $time = time();
-          $date = enano_date('F d, Y h:i a', $time);
+          $date = enano_date(ED_DATE | ED_TIME, $time);
           $ip = $_SERVER['REMOTE_ADDR'];
           if ( !is_valid_ip($ip) )
             die('Hacking attempt');
--- a/includes/common.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/common.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
@@ -44,7 +43,7 @@
 // be the expected output of enano_version(), which will always be in the
 // format of 1.0.2, 1.0.2a1, 1.0.2b1, 1.0.2RC1
 // You'll want to change this for custom distributions.
-$version = '1.1.6';
+$version = '1.1.7';
 
 /**
  * Returns a floating-point number with the current UNIX timestamp in microseconds. Defined very early because we gotta call it
--- a/includes/common_cli.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/common_cli.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/includes/constants.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/constants.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * constants.php - important defines used Enano-wide
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
@@ -103,6 +102,23 @@
 define('THIRD_SUNDAY', 3);
 define('LAST_SUNDAY', 4);
 
+// Date types
+define('DATE_1', 'y/m/d');
+define('DATE_2', 'y/d/m');
+define('DATE_3', 'Y-m-d');
+define('DATE_4', 'F d, Y');
+// 12 hour, no seconds
+define('TIME_12_NS', 'g:i A');
+// 12 hour, seconds
+define('TIME_12_S', 'g:i:s A');
+// 24 hour, no seconds
+define('TIME_24_NS', 'G:i');
+// 24 hour, seconds
+define('TIME_24_S', 'G:i:s');
+
+define('ED_DATE', 1);
+define('ED_TIME', 2);
+
 // Rendering options!
 
 /**
--- a/includes/dbal.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/dbal.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/includes/diff.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/diff.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/includes/diffiehellman.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/diffiehellman.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * diffiehellman.php - Diffie Hellman key exchange and supporting functions
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
--- a/includes/email.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/email.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
@@ -247,7 +246,7 @@
     {
       $this->mimeOut .= "From: ".$szFromAddress."\n";
       $this->mimeOut .= "To: ".$this->emailAddress."\n";
-      $this->mimeOut .= "Date: ".enano_date("D, d M Y H:i:s") . " UT\n";
+      $this->mimeOut .= "Date: ".enano_date('r') . " UT\n";
       $this->mimeOut .= "Reply-To:".$szFromAddress."\n";
       $this->mimeOut .= "Subject: ".$this->mailSubject."\n";
       $this->mimeOut .= "X-Mailer: PHP/".phpversion()."\n";
--- a/includes/functions.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/functions.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
@@ -258,6 +257,31 @@
   if ( !is_int($timestamp) && !is_double($timestamp) && strval(intval($timestamp)) !== $timestamp )
     $timestamp = time();
   
+  if ( is_int($string) )
+  {
+    global $session, $lang;
+    $date_fmt = is_object($session) ? $session->date_format : DATE_4;
+    $time_fmt = is_object($session) ? $session->time_format : TIME_24_NS;
+    
+    // within a week? use a relative date
+    if ( $timestamp + ( 86400 * 7 ) >= time() && $string & ED_DATE && is_object($lang) && is_object($session) )
+    {
+      $relative_date = get_relative_date($timestamp);
+      if ( $string === ED_DATE )
+        // why do more work if we're done?
+        return $relative_date;
+    }
+    
+    $flags = $string;
+    $string = array();
+    if ( $flags & ED_DATE && !isset($relative_date) )
+      $string[] = $date_fmt;
+    if ( $flags & ED_TIME )
+      $string[] = $time_fmt;
+    
+    $string = implode(' ', $string);
+  }
+  
   // perform timestamp offset
   global $timezone;
   // it's gonna be in minutes, so multiply by 60 to offset the unix timestamp
@@ -272,7 +296,63 @@
   }
   
   // Let PHP do the work for us =)
-  return gmdate($string, $timestamp);
+  $result = gmdate($string, $timestamp);
+  if ( isset($relative_date) )
+  {
+    $result = "$relative_date, $result";
+  }
+  return $result;
+}
+
+/**
+ * Get a relative date ("Today"/"Yesterday"/"N days ago")
+ * @param int Timestamp
+ * @return string
+ */
+
+function get_relative_date($time)
+{
+  global $lang, $session;
+  // Our formatting string to pass to enano_date()
+  // This should not include minute/second info, only today's date in whatever format suits your fancy
+  $formatstring = $session->date_format;
+  // Today's date
+  $today = enano_date($formatstring);
+  // Yesterday's date
+  $yesterday = enano_date($formatstring, (time() - (24*60*60)));
+  // Date on the input
+  $then = enano_date($formatstring, $time);
+  // "X days ago" logic
+  for ( $i = 2; $i <= 6; $i++ )
+  {
+    // hours_in_day * minutes_in_hour * seconds_in_minute * num_days
+    $offset = 24 * 60 * 60 * $i;
+    $days_ago = enano_date($formatstring, (time() - $offset));
+    // so does the input timestamp match the date from $i days ago?
+    if ( $then == $days_ago )
+    {
+      // yes, return $i
+      return $lang->get('userfuncs_ml_date_daysago', array('days_ago' => $i));
+    }
+  }
+  // either yesterday, today, or before 6 days ago
+  switch($then)
+  {
+    case $today:
+      return $lang->get('userfuncs_ml_date_today');
+    case $yesterday:
+      return $lang->get('userfuncs_ml_date_yesterday');
+    default:
+      return $then;
+  }
+  //     .--.
+  //    |o_o |
+  //    |!_/ |
+  //   //   \ \
+  //  (|     | )
+  // /'\_   _/`\
+  // \___)=(___/
+  return 'Linux rocks!';
 }
 
 /**
@@ -1233,7 +1313,8 @@
       '1.1.3'  => 'Caoineag alpha 3',
       '1.1.4'  => 'Caoineag alpha 4',
       '1.1.5'  => 'Caoineag alpha 5',
-      '1.1.6'  => 'Caoineag beta 1'
+      '1.1.6'  => 'Caoineag beta 1',
+      '1.1.7'  => 'Caoineag beta 2'
     );
   $version = enano_version();
   if ( isset($names[$version]) )
--- a/includes/hmac.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/hmac.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * hmac.php - HMAC cryptographic functions
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
--- a/includes/http.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/http.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * class_http.php - Pure PHP HTTP client library
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
--- a/includes/js-compressor.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/js-compressor.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * Javascript compression library - used to compact the client-side Javascript code (all 72KB of it!) to save some bandwidth
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
--- a/includes/lang.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/lang.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/includes/log.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/log.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * log.php - Logs table parsing and displaying
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
--- a/includes/math.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/math.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * diffiehellman.php - Diffie Hellman key exchange and supporting functions
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
--- a/includes/namespaces/admin.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/namespaces/admin.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/includes/namespaces/api.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/namespaces/api.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/includes/namespaces/default.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/namespaces/default.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
@@ -398,8 +397,8 @@
       echo '<div class="info-box" style="margin-left: 0; margin-top: 5px;">
               <b>' . $lang->get('page_msg_archived_title') . '</b><br />
               ' . $lang->get('page_msg_archived_body', array(
-                  'archive_date' => enano_date('F d, Y', $this->revision_time),
-                  'archive_time' => enano_date('h:i a', $this->revision_time),
+                  'archive_date' => enano_date(ED_DATE, $this->revision_time),
+                  'archive_time' => enano_date(ED_TIME, $this->revision_time),
                   'current_link' => makeUrlNS($this->namespace, $this->page_id),
                   'restore_link' => makeUrlNS($this->namespace, $this->page_id, 'do=edit&amp;revid='.$this->revision_id),
                   'restore_onclick' => 'ajaxEditor(\''.$this->revision_id.'\'); return false;',
@@ -580,7 +579,7 @@
       {
         $r = $db->fetchrow();
         $standard_404 .= '<p>' . $lang->get('page_msg_404_was_deleted', array(
-                  'delete_time' => enano_date('d M Y h:i a', $r['time_id']),
+                  'delete_time' => enano_date(ED_DATE | ED_TIME, $r['time_id']),
                   'delete_reason' => htmlspecialchars($r['edit_summary']),
                   'rollback_flags' => 'href="'.makeUrl($paths->page, 'do=rollback&amp;id='.$r['log_id']).'" onclick="ajaxRollback(\''.$r['log_id'].'\'); return false;"'
                 ))
--- a/includes/namespaces/file.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/namespaces/file.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
@@ -70,7 +69,7 @@
     }
     $r = $db->fetchrow();
     $mimetype = $r['mimetype'];
-    $datestring = enano_date('F d, Y h:i a', (int)$r['time_id']);
+    $datestring = enano_date(ED_DATE | ED_TIME, (int)$r['time_id']);
     $html .= '<div class="mdg-comment" style="margin-left: 0;">
             <h3>' . $lang->get('onpage_filebox_heading') . '</h3>
             <p>' . $lang->get('onpage_filebox_lbl_type') . ' '.$r['mimetype'].'<br />';
--- a/includes/namespaces/special.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/namespaces/special.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/includes/namespaces/template.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/namespaces/template.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/includes/namespaces/user.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/namespaces/user.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
@@ -201,7 +200,7 @@
                 ' . $lang->get('userpage_lbl_joined') . '
               </td>
               <td class="row1" style="text-align: left; width: 25%;">
-                ' . enano_date('F d, Y h:i a', $userdata['reg_time']) . '
+                ' . enano_date(ED_DATE | ED_TIME, $userdata['reg_time']) . '
               </td>';
       echo '  <td class="row2" style="text-align: right; width: 25%;">
                 ' . $lang->get('userpage_lbl_num_comments') . '
@@ -238,7 +237,7 @@
       {
         do 
         {
-          $row['time'] = enano_date('F d, Y', $row['time']);
+          $row['time'] = enano_date(ED_DATE, $row['time']);
           $comments[] = $row;
         }
         while ( $row = $db->fetchrow() );
--- a/includes/output.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/output.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,9 +2,8 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
  * output.php - Controls output format, messages of death, that kind of stuff
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/includes/pageprocess.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/pageprocess.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,9 +2,8 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
  * pageprocess.php - intelligent retrieval of pages
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
@@ -457,7 +456,7 @@
     $time = time();
     $edit_summary = ( strval($edit_summary) === $edit_summary ) ? $db->escape($edit_summary) : '';
     $minor_edit = ( $minor_edit ) ? '1' : '0';
-    $date_string = enano_date('d M Y h:i a');
+    $date_string = enano_date(ED_DATE | ED_TIME);
     
     // Insert log entry
     $sql = 'INSERT INTO ' . table_prefix . "logs ( time_id, date_string, log_type, action, page_id, namespace, author, page_text, edit_summary, minor_edit, page_format )\n"
@@ -590,7 +589,7 @@
     
     // Query 3: Log entry
     $db->sql_query('INSERT INTO ' . table_prefix."logs(time_id, date_string, log_type, action, author, page_id, namespace)\n"
-                   . "  VALUES ( " . time() . ", '" . enano_date('d M Y h:i a') . "', 'page', 'create', \n"
+                   . "  VALUES ( " . time() . ", 'DEPRECATED', 'page', 'create', \n"
                    . "          '" . $db->escape($session->username) . "', '" . $db->escape($this->page_id) . "', '" . $this->namespace . "');");
     if ( !$q )
       $db->_die('PageProcessor page creation - logging stage');
@@ -653,7 +652,7 @@
     $log_entry = $db->fetchrow();
     $db->free_result();
     
-    $dateline = enano_date('d M Y h:i a', $log_entry['time_id']);
+    $dateline = enano_date(ED_DATE | ED_TIME, $log_entry['time_id']);
     
     // Let's see, what do we have here...
     switch ( $log_entry['action'] )
@@ -1133,7 +1132,7 @@
     global $email;
     
     // Log it for crying out loud
-    $q = $db->sql_query('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,edit_summary,page_text) VALUES(\'security\', \'illegal_page\', '.time().', \''.enano_date('d M Y h:i a').'\', \''.$db->escape($session->username).'\', \''.$db->escape($_SERVER['REMOTE_ADDR']).'\', \'' . $db->escape(serialize(array($this->page_id, $this->namespace))) . '\')');
+    $q = $db->sql_query('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,edit_summary,page_text) VALUES(\'security\', \'illegal_page\', '.time().', \'DEPRECATED\', \''.$db->escape($session->username).'\', \''.$db->escape($_SERVER['REMOTE_ADDR']).'\', \'' . $db->escape(serialize(array($this->page_id, $this->namespace))) . '\')');
     
     $ob = '';
     //$template->tpl_strings['PAGE_NAME'] = 'Access denied';
--- a/includes/pageutils.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/pageutils.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * pageutils.php - a class that handles raw page manipulations, used mostly by AJAX requests or their old-fashioned form-based counterparts
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
@@ -205,7 +204,7 @@
     
     $qa = $db->sql_query('INSERT INTO ' . table_prefix.'pages(name,urlname,namespace,visible,protected,delvote_ips) VALUES(\'' . $db->escape($name) . '\', \'' . $db->escape($page_id) . '\', \'' . $namespace . '\', '. ( $visible ? '1' : '0' ) .', ' . $prot . ', \'' . $db->escape(serialize($ips)) . '\');');
     $qb = $db->sql_query('INSERT INTO ' . table_prefix.'page_text(page_id,namespace) VALUES(\'' . $db->escape($page_id) . '\', \'' . $namespace . '\');');
-    $qc = $db->sql_query('INSERT INTO ' . table_prefix.'logs(time_id,date_string,log_type,action,author,page_id,namespace) VALUES('.time().', \''.enano_date('d M Y h:i a').'\', \'page\', \'create\', \'' . $session->username . '\', \'' . $db->escape($page_id) . '\', \'' . $namespace . '\');');
+    $qc = $db->sql_query('INSERT INTO ' . table_prefix.'logs(time_id,date_string,log_type,action,author,page_id,namespace) VALUES('.time().', \'DEPRECATED\', \'page\', \'create\', \'' . $session->username . '\', \'' . $db->escape($page_id) . '\', \'' . $namespace . '\');');
     
     if($qa && $qb && $qc)
       return 'good';
@@ -332,7 +331,7 @@
         if($ticker < $numrows) echo '<td class="' . $cls . '" style="padding: 0;"><input ' . $s2 . 'name="diff2" type="radio" value="' . $r['time_id'] . '" id="diff2_' . $r['time_id'] . '" class="clsDiff2Radio" onclick="selectDiff2Button(this);" /></td>'."\n"; else echo '<td class="' . $cls . '"></td>';
         
         // Date and time
-        echo '<td class="' . $cls . '" style="white-space: nowrap;">' . enano_date('d M Y h:i a', intval($r['time_id'])) . '</td class="' . $cls . '">'."\n";
+        echo '<td class="' . $cls . '" style="white-space: nowrap;">' . enano_date(ED_DATE | ED_TIME, intval($r['time_id'])) . '</td class="' . $cls . '">'."\n";
         
         // User
         if ( $session->get_permissions('mod_misc') && is_valid_ip($r['author']) )
@@ -408,7 +407,7 @@
         echo '<tr>';
         
         // Date and time
-        echo '<td class="' . $cls . '">' . enano_date('d M Y h:i a', intval($r['time_id'])) . '</td class="' . $cls . '">';
+        echo '<td class="' . $cls . '">' . enano_date(ED_DATE | ED_TIME, intval($r['time_id'])) . '</td class="' . $cls . '">';
         
         // User
         echo '<td class="' . $cls . '"><a href="'.makeUrlNS('User', sanitize_page_id($r['author'])).'" ';
@@ -630,7 +629,7 @@
         $strings['SUBJECT'] = $s;
         
         // Date and time
-        $strings['DATETIME'] = enano_date('F d, Y h:i a', $row['time']);
+        $strings['DATETIME'] = enano_date(ED_DATE | ED_TIME, $row['time']);
         
         // User level
         switch($row['user_level'])
@@ -1011,7 +1010,7 @@
       $row = $db->fetchrow();
       $db->free_result();
       $minor_edit = ( ENANO_DBLAYER == 'MYSQL' ) ? 'false' : '0';
-      $q='INSERT INTO ' . table_prefix.'logs(log_type,action,time_id,date_string,page_id,namespace,page_text,char_tag,author,edit_summary,minor_edit) VALUES(\'page\', \'edit\', '.time().', \''.enano_date('d M Y h:i a').'\', \'' . $page_id . '\', \'' . $namespace . '\', \'' . $db->escape($row['page_text']) . '\', \'' . $row['char_tag'] . '\', \'' . $session->username . '\', \''."Automatic backup created when logs were purged".'\', '.$minor_edit.');';
+      $q='INSERT INTO ' . table_prefix.'logs(log_type,action,time_id,date_string,page_id,namespace,page_text,char_tag,author,edit_summary,minor_edit) VALUES(\'page\', \'edit\', '.time().', \''.enano_date(ED_DATE | ED_TIME).'\', \'' . $page_id . '\', \'' . $namespace . '\', \'' . $db->escape($row['page_text']) . '\', \'' . $row['char_tag'] . '\', \'' . $session->username . '\', \''."Automatic backup created when logs were purged".'\', '.$minor_edit.');';
       if(!$db->sql_query($q)) $db->_die('The history (log) entry could not be inserted into the logs table.');
     }
     return $lang->get('ajax_clearlogs_success');
@@ -1043,7 +1042,7 @@
       return $lang->get('etc_access_denied_need_reauth');
     }
     
-    $e = $db->sql_query('INSERT INTO ' . table_prefix.'logs(time_id,date_string,log_type,action,page_id,namespace,author,edit_summary) VALUES('.time().', \''.enano_date('d M Y h:i a').'\', \'page\', \'delete\', \'' . $page_id . '\', \'' . $namespace . '\', \'' . $session->username . '\', \'' . $db->escape(htmlspecialchars($reason)) . '\')');
+    $e = $db->sql_query('INSERT INTO ' . table_prefix.'logs(time_id,date_string,log_type,action,page_id,namespace,author,edit_summary) VALUES('.time().', \''.enano_date(ED_DATE | ED_TIME).'\', \'page\', \'delete\', \'' . $page_id . '\', \'' . $namespace . '\', \'' . $session->username . '\', \'' . $db->escape(htmlspecialchars($reason)) . '\')');
     if(!$e) $db->_die('The page log entry could not be inserted.');
     $e = $db->sql_query('DELETE FROM ' . table_prefix.'categories WHERE page_id=\'' . $page_id . '\' AND namespace=\'' . $namespace . '\'');
     if(!$e) $db->_die('The page categorization entries could not be deleted.');
@@ -1600,8 +1599,8 @@
     }
     $text1 = $row1['page_text'];
     $text2 = $row2['page_text'];
-    $time1 = enano_date('F d, Y h:i a', $row1['time_id']);
-    $time2 = enano_date('F d, Y h:i a', $row2['time_id']);
+    $time1 = enano_date(ED_DATE | ED_TIME, $row1['time_id']);
+    $time2 = enano_date(ED_DATE | ED_TIME, $row2['time_id']);
     $_ob = "
     <p>" . $lang->get('history_lbl_comparingrevisions') . " {$time1} &rarr; {$time2}</p>
     ";
--- a/includes/paths.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/paths.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /**
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * paths.php - The part of Enano that actually manages content. Everything related to page handling and namespaces is in here.
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
--- a/includes/plugins.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/plugins.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/includes/render.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/render.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * render.php - handles fetching pages and parsing them into HTML
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
--- a/includes/search.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/search.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * search.php - algorithm used to search pages
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
--- a/includes/sessions.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/sessions.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * sessions.php - everything related to security and user management
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
@@ -158,6 +157,20 @@
   var $auth_level = 1;
   
   /**
+   * Preference for date formatting
+   * @var string
+   */
+  
+  var $date_format = DATE_4;
+  
+  /**
+   * Preference for time formatting
+   * @var string
+   */
+  
+  var $time_format = TIME_24_NS;
+  
+  /**
    * State variable to track if a session timed out
    * @var bool
    */
@@ -724,11 +737,11 @@
       // This wasn't logged in <1.0.2, dunno how it slipped through
       if ( $level > USER_LEVEL_MEMBER )
         $this->sql('INSERT INTO ' . table_prefix . "logs(log_type,action,time_id,date_string,author,edit_summary,page_text) VALUES\n"
-                   . '  (\'security\', \'admin_auth_bad\', '.time().', \''.enano_date('d M Y h:i a').'\', \''.$db->escape($username).'\', '
+                   . '  (\'security\', \'admin_auth_bad\', '.time().', \''.enano_date(ED_DATE | ED_TIME).'\', \''.$db->escape($username).'\', '
                       . '\''.$db->escape($_SERVER['REMOTE_ADDR']).'\', ' . intval($level) . ')');
       else
         $this->sql('INSERT INTO ' . table_prefix . "logs(log_type,action,time_id,date_string,author,edit_summary) VALUES\n"
-                   . '  (\'security\', \'auth_bad\', '.time().', \''.enano_date('d M Y h:i a').'\', \''.$db->escape($username).'\', '
+                   . '  (\'security\', \'auth_bad\', '.time().', \''.enano_date(ED_DATE | ED_TIME).'\', \''.$db->escape($username).'\', '
                       . '\''.$db->escape($_SERVER['REMOTE_ADDR']).'\')');
       
       // Do we also need to increment the lockout countdown?
@@ -826,9 +839,9 @@
       if($sess)
       {
         if($level > USER_LEVEL_MEMBER)
-          $this->sql('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,edit_summary,page_text) VALUES(\'security\', \'admin_auth_good\', '.time().', \''.enano_date('d M Y h:i a').'\', \''.$db->escape($username).'\', \''.$db->escape($_SERVER['REMOTE_ADDR']).'\', ' . intval($level) . ')');
+          $this->sql('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,edit_summary,page_text) VALUES(\'security\', \'admin_auth_good\', '.time().', \''.enano_date(ED_DATE | ED_TIME).'\', \''.$db->escape($username).'\', \''.$db->escape($_SERVER['REMOTE_ADDR']).'\', ' . intval($level) . ')');
         else
-          $this->sql('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,edit_summary) VALUES(\'security\', \'auth_good\', '.time().', \''.enano_date('d M Y h:i a').'\', \''.$db->escape($username).'\', \''.$db->escape($_SERVER['REMOTE_ADDR']).'\')');
+          $this->sql('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,edit_summary) VALUES(\'security\', \'auth_good\', '.time().', \''.enano_date(ED_DATE | ED_TIME).'\', \''.$db->escape($username).'\', \''.$db->escape($_SERVER['REMOTE_ADDR']).'\')');
         
         $code = $plugins->setHook('login_success');
         foreach ( $code as $cmd )
@@ -849,9 +862,9 @@
     else
     {
       if($level > USER_LEVEL_MEMBER)
-        $this->sql('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,edit_summary,page_text) VALUES(\'security\', \'admin_auth_bad\', '.time().', \''.enano_date('d M Y h:i a').'\', \''.$db->escape($username).'\', \''.$db->escape($_SERVER['REMOTE_ADDR']).'\', ' . intval($level) . ')');
+        $this->sql('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,edit_summary,page_text) VALUES(\'security\', \'admin_auth_bad\', '.time().', \''.enano_date(ED_DATE | ED_TIME).'\', \''.$db->escape($username).'\', \''.$db->escape($_SERVER['REMOTE_ADDR']).'\', ' . intval($level) . ')');
       else
-        $this->sql('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,edit_summary) VALUES(\'security\', \'auth_bad\', '.time().', \''.enano_date('d M Y h:i a').'\', \''.$db->escape($username).'\', \''.$db->escape($_SERVER['REMOTE_ADDR']).'\')');
+        $this->sql('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,edit_summary) VALUES(\'security\', \'auth_bad\', '.time().', \''.enano_date(ED_DATE | ED_TIME).'\', \''.$db->escape($username).'\', \''.$db->escape($_SERVER['REMOTE_ADDR']).'\')');
         
       // Do we also need to increment the lockout countdown?
       if ( !defined('IN_ENANO_INSTALL') && $lockout_data['lockout_policy'] != 'disable' )
@@ -967,6 +980,7 @@
       // For now, make the cookie last forever, we can change this in 1.1.x
       setcookie( 'sid', $session_key, time()+15552000, scriptPath.'/', null, $GLOBALS['is_https']);
       $_COOKIE['sid'] = $session_key;
+      $this->sid = $session_key;
     }
     // $keyhash is stored in the database, this is for compatibility with the older DB structure
     $keyhash = md5($session_key);
@@ -1192,7 +1206,7 @@
                       . "           u.reg_time, u.account_active, u.activation_key, u.user_lang, u.user_timezone, u.user_title, u.user_dst,\n"
                       . "           k.salt, k.source_ip, k.time, k.auth_level, k.key_type, x.user_id, x.user_aim, x.user_yahoo, x.user_msn,\n"
                       . "           x.user_xmpp, x.user_homepage, x.user_location, x.user_job, x.user_hobbies, x.email_public,\n"
-                      . "           x.disable_js_fx";
+                      . "           x.disable_js_fx, x.date_format, x.time_format";
     
     $joins = "  LEFT JOIN " . table_prefix . "users AS u\n"
             . "    ON ( u.user_id=k.user_id )\n"
@@ -1221,14 +1235,14 @@
     
     if ( !$query && ( defined('IN_ENANO_INSTALL') or defined('IN_ENANO_UPGRADE') ) )
     {
-      $query = $this->sql('SELECT u.user_id AS uid,u.username,u.password,\'\' AS password_salt,u.email,u.real_name,u.user_level,u.theme,u.style,u.signature,u.reg_time,u.account_active,u.activation_key,k.source_ip,k.time,k.auth_level,COUNT(p.message_id) AS num_pms, 1440 AS user_timezone, \'0;0;0;0;60\' AS user_dst, ' . SK_SHORT . ' AS key_type FROM '.table_prefix.'session_keys AS k
+      $key_md5 = $loose_call ? $key : md5($key);
+      $query = $this->sql('SELECT u.user_id AS uid,u.username,u.password,\'\' AS password_salt,u.email,u.real_name,u.user_level,u.theme,u.style,u.signature,u.reg_time,u.account_active,u.activation_key,k.source_ip,k.time,k.auth_level,COUNT(p.message_id) AS num_pms, 1440 AS user_timezone, \'0;0;0;0;60\' AS user_dst, ' . SK_SHORT . ' AS key_type, k.salt FROM '.table_prefix.'session_keys AS k
                              LEFT JOIN '.table_prefix.'users AS u
                                ON ( u.user_id=k.user_id )
                              LEFT JOIN '.table_prefix.'privmsgs AS p
                                ON ( p.message_to=u.username AND p.message_read=0 )
-                             WHERE k.session_key=\''.$key.'\'
-                               AND k.salt=\''.$salt.'\'
-                             GROUP BY u.user_id,u.username,u.password,u.email,u.real_name,u.user_level,u.theme,u.style,u.signature,u.reg_time,u.account_active,u.activation_key,k.source_ip,k.time,k.auth_level;');
+                             WHERE k.session_key=\''.$key_md5.'\'
+                             GROUP BY u.user_id,u.username,u.password,u.email,u.real_name,u.user_level,u.theme,u.style,u.signature,u.reg_time,u.account_active,u.activation_key,k.source_ip,k.time,k.auth_level,k.salt;');
     }
     else if ( !$query )
     {
@@ -1236,7 +1250,7 @@
     }
     if($db->numrows() < 1)
     {
-      // echo '(debug) $session->validate_session: Key was not found in database<br />';
+      echo '(debug) $session->validate_session: Key was not found in database: ' . $key_md5 . '<br />';
       return false;
     }
     $row = $db->fetchrow();
@@ -1346,6 +1360,11 @@
         $user_extra[$column] = '';
     }
     
+    if ( isset($row['date_format']) )
+      $this->date_format = $row['date_format'];
+    if ( isset($row['time_format']) )
+      $this->time_format = $row['time_format'];
+    
     $this->user_extra = $user_extra;
     // Leave the rest to PHP's automatic garbage collector ;-)
     
@@ -2229,7 +2248,7 @@
   function admin_activation_request($u)
   {
     global $db;
-    $this->sql('INSERT INTO '.table_prefix.'logs(log_type, action, time_id, date_string, author, edit_summary) VALUES(\'admin\', \'activ_req\', '.time().', \''.enano_date('d M Y h:i a').'\', \''.$this->username.'\', \''.$db->escape($u).'\');');
+    $this->sql('INSERT INTO '.table_prefix.'logs(log_type, action, time_id, date_string, author, edit_summary) VALUES(\'admin\', \'activ_req\', '.time().', \''.enano_date(ED_DATE | ED_TIME).'\', \''.$this->username.'\', \''.$db->escape($u).'\');');
   }
   
   /**
@@ -2245,11 +2264,11 @@
     $r = mysql_affected_rows();
     if ( $r > 0 )
     {
-      $e = $this->sql('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,edit_summary) VALUES(\'security\', \'activ_good\', '.time().', \''.enano_date('d M Y h:i a').'\', \''.$db->escape($user).'\', \''.$_SERVER['REMOTE_ADDR'].'\')');
+      $e = $this->sql('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,edit_summary) VALUES(\'security\', \'activ_good\', '.time().', \''.enano_date(ED_DATE | ED_TIME).'\', \''.$db->escape($user).'\', \''.$_SERVER['REMOTE_ADDR'].'\')');
     }
     else
     {
-      $e = $this->sql('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,edit_summary) VALUES(\'security\', \'activ_bad\', '.time().', \''.enano_date('d M Y h:i a').'\', \''.$db->escape($user).'\', \''.$_SERVER['REMOTE_ADDR'].'\')');
+      $e = $this->sql('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,edit_summary) VALUES(\'security\', \'activ_bad\', '.time().', \''.enano_date(ED_DATE | ED_TIME).'\', \''.$db->escape($user).'\', \''.$_SERVER['REMOTE_ADDR'].'\')');
     }
     return $r;
   }
--- a/includes/sql_parse.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/sql_parse.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * Installation package
  * sql_parse.php - SQL query splitter and templater
  *
--- a/includes/stats.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/stats.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * stats.php - handles statistics for pages (disablable in the admin CP)
  *
  *   ***** UNFINISHED ***** 
--- a/includes/tagcloud.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/tagcloud.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/includes/template.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/template.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
@@ -2596,7 +2595,7 @@
     $messages = array();
     while ( $row = $db->fetchrow() )
     {
-      $messages[] = '<a href="' . makeUrlNS('Special', 'PrivateMessages/View/' . $row['message_id']) . '" title="Sent ' . enano_date('F d, Y h:i a', $row['date']) . ' by ' . $row['message_from'] . '">' . $row['subject'] . '</a>';
+      $messages[] = '<a href="' . makeUrlNS('Special', 'PrivateMessages/View/' . $row['message_id']) . '" title="Sent ' . enano_date(ED_DATE | ED_TIME, $row['date']) . ' by ' . $row['message_from'] . '">' . $row['subject'] . '</a>';
     }
     $ob .= implode(",\n    " , $messages)."\n";
     $ob .= '</div>'."\n";
--- a/includes/wikiengine/Tables.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/wikiengine/Tables.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/includes/wikiengine/TagSanitizer.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/wikiengine/TagSanitizer.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/includes/wikiengine/parse_mediawiki.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/wikiengine/parse_mediawiki.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/includes/wikiengine/render_xhtml.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/wikiengine/render_xhtml.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/includes/wikiformat.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/wikiformat.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/index.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/index.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/install/includes/cli-core.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/install/includes/cli-core.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * Installation package
  * cli-core.php - CLI installation wizard/core
  *
--- a/install/includes/common.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/install/includes/common.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * Installation package
  * common.php - Installer common functions
  *
@@ -16,7 +15,7 @@
 
 // Our version number. This needs to be changed for any custom releases.
 $installer_version = array(
-  'version' => '1.1.6',
+  'version' => '1.1.7',
   'type' => 'beta'
   // If type is set to "rc", "beta", or "alpha", optionally another version number can be issued with the key 'sub':
   // 'sub' => '3' will produce Enano 1.1.1a3 / Enano 1.1.1 alpha 3
--- a/install/includes/libenanoinstall.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/install/includes/libenanoinstall.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * Installation package
  * libenanoinstall.php - Installation payload backend
  *
--- a/install/includes/libenanoinstallcli.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/install/includes/libenanoinstallcli.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * Installation package
  * libenanoinstallcli.php - Installer frontend logic, CLI version
  *
--- a/install/includes/payload.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/install/includes/payload.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * Installation package
  * payload.php - Installer payload (the installation logic)
  *
@@ -425,7 +424,7 @@
   global $db, $session, $paths, $template, $plugins; // Common objects
   global $installer_version;
   
-  $q = $db->sql_query('INSERT INTO ' . table_prefix . 'logs(log_type,action,time_id,date_string,author,page_text,edit_summary) VALUES(\'security\', \'install_enano\', ' . time() . ', \'' . enano_date('d M Y h:i a') . '\', \'' . $db->escape($_POST['username']) . '\', \'' . $db->escape(enano_version()) . '\', \'' . $db->escape($_SERVER['REMOTE_ADDR']) . '\');');
+  $q = $db->sql_query('INSERT INTO ' . table_prefix . 'logs(log_type,action,time_id,date_string,author,page_text,edit_summary) VALUES(\'security\', \'install_enano\', ' . time() . ', \'' . enano_date(ED_DATE | ED_TIME) . '\', \'' . $db->escape($_POST['username']) . '\', \'' . $db->escape(enano_version()) . '\', \'' . $db->escape($_SERVER['REMOTE_ADDR']) . '\');');
   if ( !$q )
   {
     echo '<p><tt>MySQL return: ' . $db->sql_error() . '</tt></p>';
--- a/install/includes/stages/confirm.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/install/includes/stages/confirm.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * Installation package
  * confirm.php - Installer installation summary/confirmation stage
  *
--- a/install/includes/stages/database.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/install/includes/stages/database.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * Installation package
  * database.php - Installer database driver selection stage
  *
--- a/install/includes/stages/database_mysql.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/install/includes/stages/database_mysql.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * Installation package
  * database_mysql.php - Installer database info page, MySQL
  *
--- a/install/includes/stages/database_post.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/install/includes/stages/database_post.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * Installation package
  * database_post.php - Database installation, stage 1
  *
--- a/install/includes/stages/database_postgresql.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/install/includes/stages/database_postgresql.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * Installation package
  * database_postgresql.php - Installer database info page, PostgreSQL
  *
--- a/install/includes/stages/finish.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/install/includes/stages/finish.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * Installation package
  * finish.php - Installer finalization stage
  *
--- a/install/includes/stages/install.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/install/includes/stages/install.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * Installation package
  * install.php - Installer payload stage
  *
--- a/install/includes/stages/license.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/install/includes/stages/license.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * Installation package
  * license.php - Installer license-agreement stage
  *
--- a/install/includes/stages/login.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/install/includes/stages/login.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * Installation package
  * login.php - Installer login information stage
  *
--- a/install/includes/stages/sysreqs.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/install/includes/stages/sysreqs.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * Installation package
  * sysreqs.php - Installer system-requirements page
  *
--- a/install/includes/stages/website.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/install/includes/stages/website.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * Installation package
  * website.php - Installer website-settings stage
  *
--- a/install/includes/ui.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/install/includes/ui.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * Installation package
  * ui.php - User interface for installations and upgrades
  *
--- a/install/index.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/install/index.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * Installation package
  * welcome.php - Portal to upgrade, readme, and install pages
  *
--- a/install/install-cli.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/install/install-cli.php	Thu Aug 20 20:01:55 2009 -0400
@@ -3,8 +3,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * Installation package
  * install-cli.php - CLI installation frontend stub
  *
--- a/install/install.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/install/install.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * Installation package
  * install.php - Main installation interface
  *
--- a/install/readme.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/install/readme.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * Installation package
  * install.php - Main installation interface
  *
--- a/install/schemas/mysql_stage2.sql	Wed Aug 19 01:28:47 2009 -0400
+++ b/install/schemas/mysql_stage2.sql	Thu Aug 20 20:01:55 2009 -0400
@@ -135,6 +135,8 @@
   user_hobbies text,
   email_public tinyint(1) NOT NULL DEFAULT 0,
   disable_js_fx tinyint(1) NOT NULL DEFAULT 0,
+  date_format varchar(32) NOT NULL DEFAULT 'F d, Y',
+  time_format varchar(32) NOT NULL DEFAULT 'G:i',
   PRIMARY KEY ( user_id ) 
 ) CHARACTER SET `utf8` COLLATE `utf8_bin`;
 
--- a/install/schemas/postgresql_stage2.sql	Wed Aug 19 01:28:47 2009 -0400
+++ b/install/schemas/postgresql_stage2.sql	Thu Aug 20 20:01:55 2009 -0400
@@ -136,6 +136,8 @@
   user_hobbies text,
   email_public smallint NOT NULL DEFAULT 0,
   disable_js_fx smallint NOT NULL DEFAULT 0,
+  date_format varchar(32) NOT NULL DEFAULT 'F d, Y',
+  time_format varchar(32) NOT NULL DEFAULT 'G:i',
   PRIMARY KEY ( user_id ) 
 );
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/install/schemas/upgrade/1.1.6-1.1.7-mysql.sql	Thu Aug 20 20:01:55 2009 -0400
@@ -0,0 +1,2 @@
+ALTER TABLE {{TABLE_PREFIX}}users_extra ADD COLUMN date_format varchar(32) NOT NULL DEFAULT 'F d, Y';
+ALTER TABLE {{TABLE_PREFIX}}users_extra ADD COLUMN time_format varchar(32) NOT NULL DEFAULT 'G:i';
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/install/schemas/upgrade/1.1.6-1.1.7-postgresql.sql	Thu Aug 20 20:01:55 2009 -0400
@@ -0,0 +1,2 @@
+ALTER TABLE {{TABLE_PREFIX}}users_extra ADD COLUMN date_format varchar(32) NOT NULL DEFAULT 'F d, Y';
+ALTER TABLE {{TABLE_PREFIX}}users_extra ADD COLUMN time_format varchar(32) NOT NULL DEFAULT 'G:i';
--- a/install/upgrade.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/install/upgrade.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * Installation package
  * upgrade.php - Upgrade interface
  *
@@ -19,7 +18,7 @@
 // The list of versions in THIS AND PREVIOUS branches, in chronological order.
 $enano_versions = array();
 $enano_versions['1.0'] = array('1.0', '1.0.1', '1.0.2b1', '1.0.2', '1.0.3', '1.0.4', '1.0.5', '1.0.6');
-$enano_versions['1.1'] = array('1.1.1', '1.1.2', '1.1.3', '1.1.4', '1.1.5', '1.1.6');
+$enano_versions['1.1'] = array('1.1.1', '1.1.2', '1.1.3', '1.1.4', '1.1.5', '1.1.6', '1.1.7');
 
 // If true, this will do a full langimport instead of only adding new strings.
 // Will probably be left on, but some change probably needs to be made to mark
@@ -108,6 +107,9 @@
 
 if ( !$session->user_logged_in || ( $session->user_logged_in && $session->auth_level < USER_LEVEL_ADMIN ) )
 {
+  // if we're not logged in, destroy any existing session keys in the browser
+  @setcookie('sid', '', time() - 86400);
+  
   $ui->set_visible_stage($stg_login);
   if ( isset($_POST['do_login']) )
   {
--- a/language/english/user.json	Wed Aug 19 01:28:47 2009 -0400
+++ b/language/english/user.json	Thu Aug 20 20:01:55 2009 -0400
@@ -317,6 +317,8 @@
       publicinfo_field_changetheme_title: 'Change theme:',
       publicinfo_field_changetheme_hint: 'If you don\'t like the look of the site, need a visual break, or are just curious, we might have some different themes for you to try out!',
       publicinfo_field_changetheme: 'Change my theme...',
+      publicinfo_field_dateformat: 'Date format:',
+      publicinfo_field_timeformat: 'Time format:',
       publicinfo_field_timezone: 'Time zone:',
       publicinfo_field_timezone_hint: 'Select the time zone you live in and when Daylight Savings Time occurs, if at all.',
       publicinfo_field_dst: 'Daylight saving time:',
--- a/plugins/PrivateMessages.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/plugins/PrivateMessages.php	Thu Aug 20 20:01:55 2009 -0400
@@ -12,8 +12,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
@@ -83,7 +82,7 @@
         <div class="tblholder"><table border="0" width="100%" cellspacing="1" cellpadding="4">
           <tr><th colspan="2"><?php echo $lang->get('privmsgs_lbl_message_from', array('sender' => htmlspecialchars($r['message_from']))); ?></th></tr>
           <tr><td class="row1"><?php echo $lang->get('privmsgs_lbl_subject') ?></td><td class="row1"><?php echo $r['subject']; ?></td></tr>
-          <tr><td class="row2"><?php echo $lang->get('privmsgs_lbl_date') ?></td><td class="row2"><?php echo enano_date('M j, Y G:i', $r['date']); ?></td></tr>
+          <tr><td class="row2"><?php echo $lang->get('privmsgs_lbl_date') ?></td><td class="row2"><?php echo enano_date(ED_DATE | ED_TIME, $r['date']); ?></td></tr>
           <tr><td class="row1"><?php echo $lang->get('privmsgs_lbl_message') ?></td><td class="row1"><?php echo RenderMan::render($r['message_text']);
           if ( $r['signature'] != '' )
           {
@@ -259,7 +258,7 @@
           die_friendly($lang->get('etc_access_denied_short'), '<p>You are not authorized to view the contents of this message.</p>');
         }
         $subj = 'Re: ' . $r['subject'];
-        $text = "\n\n\nOn " . enano_date('M j, Y G:i', $r['date']) . ", " . $r['message_from'] . " wrote:\n> " . str_replace("\n", "\n> ", $r['message_text']); // Way less complicated than using a regex ;-)
+        $text = "\n\n\nOn " . enano_date(ED_DATE | ED_TIME, $r['date']) . ", " . $r['message_from'] . " wrote:\n> " . str_replace("\n", "\n> ", $r['message_text']); // Way less complicated than using a regex ;-)
         
         $tbuf = $text;
         while( preg_match("/\n([\> ]*?)\> \>/", $text) )
@@ -637,7 +636,7 @@
               {
                 echo '</b>';
               }
-              echo '</a></td><td class="'.$cls.'">'.enano_date('M j, Y G:i', $r['date']).'</td><td class="'.$cls.'" style="text-align: center;"><input name="marked_'.$r['message_id'].'" type="checkbox" /></td></tr>';
+              echo '</a></td><td class="'.$cls.'">'.enano_date(ED_DATE | ED_TIME, $r['date']).'</td><td class="'.$cls.'" style="text-align: center;"><input name="marked_'.$r['message_id'].'" type="checkbox" /></td></tr>';
             }
             $db->free_result();
           }
--- a/plugins/SpecialAdmin.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/plugins/SpecialAdmin.php	Thu Aug 20 20:01:55 2009 -0400
@@ -12,8 +12,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
@@ -1482,7 +1481,7 @@
     $filename = 'enano_backup_' . enano_date('ymd') . '.sql' . $aesext;
     ob_start();
     // Spew some headers
-    $headdate = enano_date('F d, Y \a\t h:i a');
+    $headdate = enano_date(ED_DATE | ED_TIME);
     echo <<<HEADER
 -- Enano CMS SQL backup
 -- Generated on {$headdate} by {$session->username}
@@ -1494,7 +1493,7 @@
     $tables = array_merge($base, $add);
     
     // Log it!
-    $e = $db->sql_query('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,edit_summary,page_text) VALUES(\'security\', \'db_backup\', '.time().', \''.enano_date('d M Y h:i a').'\', \''.$db->escape($session->username).'\', \''.$db->escape($_SERVER['REMOTE_ADDR']).'\', \'' . $db->escape(implode(', ', $tables)) . '\')');
+    $e = $db->sql_query('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,edit_summary,page_text) VALUES(\'security\', \'db_backup\', '.time().', \''.enano_date(ED_DATE | ED_TIME).'\', \''.$db->escape($session->username).'\', \''.$db->escape($_SERVER['REMOTE_ADDR']).'\', \'' . $db->escape(implode(', ', $tables)) . '\')');
     if ( !$e )
       $db->_die();
     
--- a/plugins/SpecialCSS.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/plugins/SpecialCSS.php	Thu Aug 20 20:01:55 2009 -0400
@@ -12,8 +12,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/plugins/SpecialGroups.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/plugins/SpecialGroups.php	Thu Aug 20 20:01:55 2009 -0400
@@ -12,7 +12,6 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
  * Copyright (C) 2007 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
@@ -377,7 +376,7 @@
       foreach ( $pending as $member )
       {
         
-        $date = enano_date('F d, Y', $member['reg_time']);
+        $date = enano_date(ED_DATE, $member['reg_time']);
         $cls = ( $cls == 'row2' ) ? 'row1' : 'row2';
         $addy = $email->encryptEmail($member['email']);
         
@@ -423,7 +422,7 @@
       if ( $member['is_mod'] != 1 )
         break;
       
-      $date = enano_date('F d, Y', $member['reg_time']);
+      $date = enano_date(ED_DATE, $member['reg_time']);
       $cls = ( $cls == 'row2' ) ? 'row1' : 'row2';
       $addy = $email->encryptEmail($member['email']);
       
@@ -447,7 +446,7 @@
       if ( $member['is_mod'] == 1 )
         continue;
       
-      $date = enano_date('F d, Y', $member['reg_time']);
+      $date = enano_date(ED_DATE, $member['reg_time']);
       $cls = ( $cls == 'row2' ) ? 'row1' : 'row2';
       $addy = $email->encryptEmail($member['email']);
       
--- a/plugins/SpecialLog.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/plugins/SpecialLog.php	Thu Aug 20 20:01:55 2009 -0400
@@ -12,8 +12,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/plugins/SpecialPageFuncs.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/plugins/SpecialPageFuncs.php	Thu Aug 20 20:01:55 2009 -0400
@@ -12,8 +12,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/plugins/SpecialSearch.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/plugins/SpecialSearch.php	Thu Aug 20 20:01:55 2009 -0400
@@ -12,8 +12,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/plugins/SpecialUpdownload.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/plugins/SpecialUpdownload.php	Thu Aug 20 20:01:55 2009 -0400
@@ -12,8 +12,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  * SpecialUpdownload.php - handles uploading and downloading of user-uploaded files - possibly the most rigorously security-enforcing script in all of Enano, although sessions.php comes in a close second
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
@@ -128,13 +127,13 @@
     if(!$db->sql_query('INSERT INTO '.table_prefix.'files(time_id,page_id,filename,size,mimetype,file_extension,file_key) VALUES('.$utime.', \''.$urln.'\', \''.$filename.'\', '.$flen.', \''.$type.'\', \''.$ext.'\', \''.$key.'\')')) $db->_die('The file data entry could not be inserted.');
     if(!isset($_POST['update']))
     {
-      if(!$db->sql_query('INSERT INTO '.table_prefix.'logs(time_id,date_string,log_type,action,author,page_id,namespace) VALUES('.$utime.', \''.enano_date('d M Y h:i a').'\', \'page\', \'create\', \''.$session->username.'\', \''.$filename.'\', \''.'File'.'\');')) $db->_die('The page log could not be updated.');
+      if(!$db->sql_query('INSERT INTO '.table_prefix.'logs(time_id,date_string,log_type,action,author,page_id,namespace) VALUES('.$utime.', \''.enano_date(ED_DATE | ED_TIME).'\', \'page\', \'create\', \''.$session->username.'\', \''.$filename.'\', \''.'File'.'\');')) $db->_die('The page log could not be updated.');
       if(!$db->sql_query('INSERT INTO '.table_prefix.'pages(name,urlname,namespace,protected,delvotes,delvote_ips) VALUES(\''.$filename.'\', \''.$urln.'\', \'File\', 0, 0, \'\')')) $db->_die('The page listing entry could not be inserted.');
       if(!$db->sql_query('INSERT INTO '.table_prefix.'page_text(page_id,namespace,page_text,char_tag) VALUES(\''.$urln.'\', \'File\', \''.$comments.'\', \''.$chartag.'\')')) $db->_die('The page text entry could not be inserted.');
     }
     else
     {
-      if(!$db->sql_query('INSERT INTO '.table_prefix.'logs(time_id,date_string,log_type,action,author,page_id,namespace,edit_summary) VALUES('.$utime.', \''.enano_date('d M Y h:i a').'\', \'page\', \'reupload\', \''.$session->username.'\', \''.$filename.'\', \''.'File'.'\', \''.$comments.'\');')) $db->_die('The page log could not be updated.');
+      if(!$db->sql_query('INSERT INTO '.table_prefix.'logs(time_id,date_string,log_type,action,author,page_id,namespace,edit_summary) VALUES('.$utime.', \''.enano_date(ED_DATE | ED_TIME).'\', \'page\', \'reupload\', \''.$session->username.'\', \''.$filename.'\', \''.'File'.'\', \''.$comments.'\');')) $db->_die('The page log could not be updated.');
     }
     $cache->purge('page_meta');
     die_friendly($lang->get('upload_success_title'), '<p>' . $lang->get('upload_success_body', array('file_link' => makeUrlNS('File', $filename))) . '</p>');
--- a/plugins/SpecialUserFuncs.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/plugins/SpecialUserFuncs.php	Thu Aug 20 20:01:55 2009 -0400
@@ -12,8 +12,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
@@ -1838,47 +1837,8 @@
   
   public static function format_date($time)
   {
-    global $lang;
-    // Our formattting string to pass to enano_date()
-    // This should not include minute/second info, only today's date in whatever format suits your fancy
-    $formatstring = 'F j, Y';
-    // Today's date
-    $today = enano_date($formatstring);
-    // Yesterday's date
-    $yesterday = enano_date($formatstring, (time() - (24*60*60)));
-    // Date on the input
-    $then = enano_date($formatstring, $time);
-    // "X days ago" logic
-    for ( $i = 2; $i <= 6; $i++ )
-    {
-      // hours_in_day * minutes_in_hour * seconds_in_minute * num_days
-      $offset = 24 * 60 * 60 * $i;
-      $days_ago = enano_date($formatstring, (time() - $offset));
-      // so does the input timestamp match the date from $i days ago?
-      if ( $then == $days_ago )
-      {
-        // yes, return $i
-        return $lang->get('userfuncs_ml_date_daysago', array('days_ago' => $i));
-      }
-    }
-    // either yesterday, today, or before 6 days ago
-    switch($then)
-    {
-      case $today:
-        return $lang->get('userfuncs_ml_date_today');
-      case $yesterday:
-        return $lang->get('userfuncs_ml_date_yesterday');
-      default:
-        return $then;
-    }
-    //     .--.
-    //    |o_o |
-    //    |!_/ |
-    //   //   \ \
-    //  (|     | )
-    // /'\_   _/`\
-    // \___)=(___/
-    return 'Linux rocks!';
+    // merged into enano_date() :)
+    return enano_date(ED_DATE, $time);
   }
   function reg_time($time, $row)
   {
--- a/plugins/SpecialUserPrefs.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/plugins/SpecialUserPrefs.php	Thu Aug 20 20:01:55 2009 -0400
@@ -12,8 +12,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute it and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
@@ -454,6 +453,9 @@
         $hobbies = htmlspecialchars($_POST['hobbies']);
         $hobbies = $db->escape($hobbies);
         
+        $date_format = $db->escape(htmlspecialchars($_POST['date_format']));
+        $time_format = $db->escape(htmlspecialchars($_POST['time_format']));
+        
         $email_public = ( isset($_POST['email_public']) ) ? '1' : '0';
         $disable_js_fx = ( isset($_POST['disable_js_fx']) ) ? '1' : '0';
         
@@ -483,6 +485,8 @@
         $session->user_extra['user_job'] = $occupation;
         $session->user_extra['user_hobbies'] = $hobbies;
         $session->user_extra['email_public'] = intval($email_public);
+        $session->date_format = $date_format;
+        $session->time_format = $time_format;
         
         // user title
         $user_title_col = '';
@@ -536,7 +540,8 @@
         
         $q = $db->sql_query('UPDATE '.table_prefix."users_extra SET user_aim='$imaddr_aim',user_yahoo='$imaddr_yahoo',user_msn='$imaddr_msn',
                                user_xmpp='$imaddr_xmpp',user_homepage='$homepage',user_location='$location',user_job='$occupation',
-                               user_hobbies='$hobbies',email_public=$email_public,disable_js_fx=$disable_js_fx
+                               user_hobbies='$hobbies',email_public=$email_public,disable_js_fx=$disable_js_fx,date_format='$date_format',
+                               time_format='$time_format'
                                WHERE user_id=$session->user_id;");
         
         if ( !$q )
@@ -632,6 +637,34 @@
             <td class="row1"><?php echo $lang->get('usercp_publicinfo_field_changetheme_hint'); ?> <a href="<?php echo makeUrlNS('Special', 'ChangeStyle/' . $paths->page); ?>" onclick="ajaxChangeStyle(); return false;"><?php echo $lang->get('usercp_publicinfo_field_changetheme'); ?></a></td>
           </tr>
           <tr>
+            <td class="row2"><?php echo $lang->get('usercp_publicinfo_field_dateformat'); ?></td>
+            <td class="row1">
+            <select name="date_format">
+              <?php
+              foreach ( array(DATE_1, DATE_2, DATE_3, DATE_4) as $format )
+              {
+                $selected = $format === $session->date_format ? ' selected="selected"' : '';
+                echo '<option value="' . $format . '"' . $selected . '>' . enano_date($format) . '</option>';
+              }
+              ?>
+            </select>
+            </td>
+          </tr>
+          <tr>
+            <td class="row2"><?php echo $lang->get('usercp_publicinfo_field_timeformat'); ?></td>
+            <td class="row1">
+            <select name="time_format">
+              <?php
+              foreach ( array(TIME_12_NS, TIME_12_S, TIME_24_NS, TIME_24_S) as $format )
+              {
+                $selected = $format === $session->time_format ? ' selected="selected"' : '';
+                echo '<option value="' . $format . '"' . $selected . '>' . enano_date($format) . '</option>';
+              }
+              ?>
+            </select>
+            </td>
+          </tr>
+          <tr>
             <td class="row3" colspan="2"><?php echo $lang->get('usercp_publicinfo_field_timezone'); ?> <?php echo $tz_select; ?><br /><small><?php echo $lang->get('usercp_publicinfo_field_timezone_hint'); ?></small></td>
           </tr>
           <tr>
--- a/plugins/admin/CacheManager.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/plugins/admin/CacheManager.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/plugins/admin/GroupManager.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/plugins/admin/GroupManager.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/plugins/admin/Home.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/plugins/admin/Home.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/plugins/admin/LangManager.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/plugins/admin/LangManager.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/plugins/admin/PageEditor.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/plugins/admin/PageEditor.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/plugins/admin/PageGroups.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/plugins/admin/PageGroups.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/plugins/admin/PageManager.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/plugins/admin/PageManager.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/plugins/admin/PluginManager.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/plugins/admin/PluginManager.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/plugins/admin/SecurityLog.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/plugins/admin/SecurityLog.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
@@ -176,7 +175,7 @@
     case "u_to_mod"        : $return .= $lang->get('acpsl_entry_u_to_mod'         , array('username' => $r['page_text'])); break;
     case "view_comment_ip" : $return .= $lang->get('acpsl_entry_view_comment_ip'  , array('username' => htmlspecialchars($r['page_text']))); break;
   }
-  $return .= '</td><td class="'.$cls.'">'.enano_date('d M Y h:i a', $r['time_id']).'</td><td class="'.$cls.'">'.$r['author'].'</td><td class="'.$cls.'" style="cursor: pointer;" onclick="ajaxReverseDNS(this);" title="' . $lang->get('acpsl_tip_reverse_dns') . '">'.$r['edit_summary'].'</td></tr>';
+  $return .= '</td><td class="'.$cls.'">'.enano_date(ED_DATE | ED_TIME, $r['time_id']).'</td><td class="'.$cls.'">'.$r['author'].'</td><td class="'.$cls.'" style="cursor: pointer;" onclick="ajaxReverseDNS(this);" title="' . $lang->get('acpsl_tip_reverse_dns') . '">'.$r['edit_summary'].'</td></tr>';
   return $return;
 }
 
--- a/plugins/admin/ThemeManager.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/plugins/admin/ThemeManager.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/plugins/admin/UserManager.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/plugins/admin/UserManager.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
@@ -680,7 +679,7 @@
         else $cls = 'row2';
         $coppa = ( $row['user_coppa'] == '1' ) ? '<b>' . $lang->get('acpum_coppauser_yes') . '</b>' : $lang->get('acpum_coppauser_no');
         echo '<tr>
-                <td class="'.$cls.'">'.enano_date('F d, Y h:i a', $row['time_id']).'</td>
+                <td class="'.$cls.'">'.enano_date(ED_DATE | ED_TIME, $row['time_id']).'</td>
                 <td class="'.$cls.'">'.$row['author'].'</td>
                 <td class="'.$cls.'">'.$row['edit_summary'].'</td>
                 <td style="text-align: center;" class="' . $cls . '">' . $coppa . '</td>
--- a/plugins/admin/UserRanks.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/plugins/admin/UserRanks.php	Thu Aug 20 20:01:55 2009 -0400
@@ -2,8 +2,7 @@
 
 /*
  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.1.6 (Caoineag beta 1)
- * Copyright (C) 2006-2008 Dan Fuhry
+ * Copyright (C) 2006-2009 Dan Fuhry
  *
  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
--- a/themes/enanium/css/babygrand.css	Wed Aug 19 01:28:47 2009 -0400
+++ b/themes/enanium/css/babygrand.css	Thu Aug 20 20:01:55 2009 -0400
@@ -137,6 +137,7 @@
 
 ul.useropts li:hover > a {
   padding: 2px 12px 4px 12px;
+  color: #b9d0e3;
 }
 
 ul.useropts li.logout:hover > a {