From cba56c06ede13f30483ca587f0c79cb0e4d82aaa Mon Sep 17 00:00:00 2001 From: rvelices Date: Wed, 8 Mar 2006 03:22:25 +0000 Subject: calendar: removed some warnings, improved display for weekly style and worked on css (still not perfect due to IE) git-svn-id: http://piwigo.org/svn/trunk@1069 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/calendar_monthly.class.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'include/calendar_monthly.class.php') diff --git a/include/calendar_monthly.class.php b/include/calendar_monthly.class.php index 2bced250d..9a43b0ecd 100644 --- a/include/calendar_monthly.class.php +++ b/include/calendar_monthly.class.php @@ -139,15 +139,15 @@ function get_date_where($max_levels=3) array_pop($date); } $res = ''; - if (isset($date[CYEAR]) and $date[CYEAR]!='any') + if (isset($date[CYEAR]) and $date[CYEAR]!=='any') { $b = $date[CYEAR] . '-'; $e = $date[CYEAR] . '-'; - if (isset($date[CMONTH]) and $date[CMONTH]!='any') + if (isset($date[CMONTH]) and $date[CMONTH]!=='any') { $b .= $date[CMONTH] . '-'; $e .= $date[CMONTH] . '-'; - if (isset($date[CDAY]) and $date[CDAY]!='any') + if (isset($date[CDAY]) and $date[CDAY]!=='any') { $b .= $date[CDAY]; $e .= $date[CDAY]; @@ -162,11 +162,11 @@ function get_date_where($max_levels=3) { $b .= '01-01'; $e .= '12-31'; - if (isset($date[CMONTH]) and $date[CMONTH]!='any') + if (isset($date[CMONTH]) and $date[CMONTH]!=='any') { $res .= ' AND '.$this->calendar_levels[CMONTH]['sql'].'='.$date[CMONTH]; } - if (isset($date[CDAY]) and $date[CDAY]!='any') + if (isset($date[CDAY]) and $date[CDAY]!=='any') { $res .= ' AND '.$this->calendar_levels[CDAY]['sql'].'='.$date[CDAY]; } @@ -176,11 +176,11 @@ function get_date_where($max_levels=3) else { $res = ' AND '.$this->date_field.' IS NOT NULL'; - if (isset($date[CMONTH]) and $date[CMONTH]!='any') + if (isset($date[CMONTH]) and $date[CMONTH]!=='any') { $res .= ' AND '.$this->calendar_levels[CMONTH]['sql'].'='.$date[CMONTH]; } - if (isset($date[CDAY]) and $date[CDAY]!='any') + if (isset($date[CDAY]) and $date[CDAY]!=='any') { $res .= ' AND '.$this->calendar_levels[CDAY]['sql'].'='.$date[CDAY]; } @@ -224,7 +224,8 @@ function build_global_calendar() $query.= $this->inner_sql; $query.= $this->get_date_where(); $query.= ' - GROUP BY period'; + GROUP BY period + ORDER BY YEAR('.$this->date_field.') DESC'; $result = pwg_query($query); $items=array(); @@ -290,7 +291,6 @@ function build_year_calendar() $items[$m]['children'][$d] = $row['count']; $items[$m]['nb_images'] += $row['count']; } - //echo ('
'. var_export($items, true) . '
'); if (count($items)==1) { // only one month exists so bail out to month view list($m) = array_keys($items); -- cgit v1.2.3