aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_calendar.inc.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/functions_calendar.inc.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/functions_calendar.inc.php b/include/functions_calendar.inc.php
index a5a1e87bb..e39bbe2a0 100644
--- a/include/functions_calendar.inc.php
+++ b/include/functions_calendar.inc.php
@@ -231,6 +231,19 @@ WHERE id IN (' . implode(',',$page['items']) .')';
$query = 'SELECT DISTINCT(id)';
$query .= $calendar->inner_sql;
$query .= $calendar->get_date_where($requested);
+ if ( isset($page['super_order_by']) )
+ {
+ $query .= '
+ '.$conf['order_by'];
+ }
+ else
+ {
+ $order_by = str_replace(
+ 'ORDER BY ',
+ 'ORDER BY '.$calendar->date_field.',', $conf['order_by']
+ );
+ $query .= $order_by;
+ }
$page['items'] = array_from_query($query, 'id');
$page['cat_nb_images'] = count($page['items']);