aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_calendar.inc.php
diff options
context:
space:
mode:
authornikrou <nikrou@piwigo.org>2010-01-28 11:30:36 +0000
committernikrou <nikrou@piwigo.org>2010-01-28 11:30:36 +0000
commit386864cd2612ac743e182253541bddfebed80606 (patch)
treef2c8a0d0f72bb919e28f751c8fc20544a919ba8e /include/functions_calendar.inc.php
parent22191d91a223c4e71399f32ff42cf61a53e9d19d (diff)
Feature 511 : add support for sqlite database engine
Using session_write_close function when session handler use database because write is called after object destruction. git-svn-id: http://piwigo.org/svn/trunk@4781 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions_calendar.inc.php')
-rw-r--r--include/functions_calendar.inc.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/functions_calendar.inc.php b/include/functions_calendar.inc.php
index 9191bb157..73df86fbb 100644
--- a/include/functions_calendar.inc.php
+++ b/include/functions_calendar.inc.php
@@ -289,4 +289,24 @@ WHERE id IN (' . implode(',',$page['items']) .')';
}
pwg_debug('end initialize_calendar');
}
+
+/*
+ * callback to sort array with date comparaison
+ *
+ **/
+function date_compare(&$a, &$b)
+{
+ $parts = explode('-', $a);
+ foreach ($parts as &$p) {
+ $p = (int)$p;
+ }
+ $a = implode('-', $parts);
+ $parts = explode('-', $b);
+ foreach ($parts as &$p) {
+ $p = (int)$p;
+ }
+ $b = implode('-', $parts);
+
+ return strcmp($a, $b);
+}
?> \ No newline at end of file