diff options
author | rvelices <rv-github@modusoptimus.com> | 2006-04-14 01:42:24 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2006-04-14 01:42:24 +0000 |
commit | 16e8f48477e8d6b555f633dd0bf421e94fc18f24 (patch) | |
tree | 0b412b3025d2edc7ecbe7a6af2e0b15b4b6180a7 /include/functions_calendar.inc.php | |
parent | 5acf1716620f432aa25cde0b50aa0490fe87f7f1 (diff) |
merge r1162 from branch-1_6 into trunk
fix: calendar prev/next links not working properly when 'any' (All/Tout)
was selected
fix: calendar 'any' (All/Tout) not shown on for the day selection
(last calendar level) - it was meaningless
fix: calendar image ordering is by date descending for large periods (no year
selected) or ascending for small periods (week,month...)
git-svn-id: http://piwigo.org/svn/trunk@1163 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | include/functions_calendar.inc.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/include/functions_calendar.inc.php b/include/functions_calendar.inc.php index 1c86c679e..3bc79cddc 100644 --- a/include/functions_calendar.inc.php +++ b/include/functions_calendar.inc.php @@ -259,9 +259,18 @@ WHERE id IN (' . implode(',',$page['items']) .')'; } else { + if ( count($page['chronology_date'])==0 + or in_array('any', $page['chronology_date']) ) + {// selected period is very big so we show newest first + $order = ' DESC, '; + } + else + {// selected period is small (month,week) so we show oldest first + $order = ' ASC, '; + } $order_by = str_replace( 'ORDER BY ', - 'ORDER BY '.$calendar->date_field.' DESC,', $conf['order_by'] + 'ORDER BY '.$calendar->date_field.$order, $conf['order_by'] ); $query .= ' '.$order_by; |