diff options
author | rvelices <rv-github@modusoptimus.com> | 2006-04-14 01:41:50 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2006-04-14 01:41:50 +0000 |
commit | f7534a24ce5f23ef42372c46244f733befe55ded (patch) | |
tree | 6380007010d15a9403e4c050ea31dfcd94e597e7 | |
parent | 48a8c24fa59e391a318847b368d51408d147dd29 (diff) |
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/branches/branch-1_6@1162 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r-- | include/calendar_base.class.php | 5 | ||||
-rw-r--r-- | include/functions_calendar.inc.php | 11 |
2 files changed, 13 insertions, 3 deletions
diff --git a/include/calendar_base.class.php b/include/calendar_base.class.php index 7a1356db8..a88c36dcd 100644 --- a/include/calendar_base.class.php +++ b/include/calendar_base.class.php @@ -195,7 +195,8 @@ class CalendarBase $nav_bar.= '</span>'; } - if ($conf['calendar_show_any'] and $show_any and count($items) > 1) + if ($conf['calendar_show_any'] and $show_any and count($items)>1 and + count($date_components)<count($this->calendar_levels)-1 ) { $label = l10n('calendar_any'); if (isset($selected_item) and 'any' === $selected_item) @@ -299,7 +300,7 @@ SELECT DISTINCT('.$this->calendar_levels[$level]['sql'] $query = 'SELECT CONCAT_WS("-"'; for ($i=0; $i<count($page['chronology_date']); $i++) { - if ( 'any' === $page['chronology_date'] ) + if ( 'any' === $page['chronology_date'][$i] ) { $query .= ','.'"any"'; } 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; |