Mercurial > defr > DualBlog
comparison includes/class.skeleton.php @ 14:ec1453cb74b8
Plus brutal, mais fonctionnel.
Il semblerait que -1 % 12 retourne -1 en PHP, et pas 11...
author | Franck Deroche <webmaster@defr.org> |
---|---|
date | Fri, 26 Oct 2007 14:24:59 +0200 |
parents | ff57b45eda37 |
children | 86a6793f1408 |
comparison
equal
deleted
inserted
replaced
13:a8710e973155 | 14:ec1453cb74b8 |
---|---|
107 if($this->showCalendar) { | 107 if($this->showCalendar) { |
108 $cMonth = $this->calendarMonth; | 108 $cMonth = $this->calendarMonth; |
109 $cYear = $this->calendarYear; | 109 $cYear = $this->calendarYear; |
110 $nextMonth = ($cMonth % 12) + 1; | 110 $nextMonth = ($cMonth % 12) + 1; |
111 $nextYear = ($nextMonth == 1) ? $cYear + 1 : $cYear; | 111 $nextYear = ($nextMonth == 1) ? $cYear + 1 : $cYear; |
112 $prevMonth = (($cMonth % 12) - 1) % 12; | 112 $prevMonth = $cMonth - 1; |
113 if($prevMonth == 0) | |
114 $prevMonth = 12; | |
113 $prevYear = ($prevMonth == 12) ? $cYear - 1 : $cYear; | 115 $prevYear = ($prevMonth == 12) ? $cYear - 1 : $cYear; |
114 $retVal = new Template('calendar.xml'); | 116 $retVal = new Template('calendar.xml'); |
115 $retVal->setParams(array( | 117 $retVal->setParams(array( |
116 '#calPrev' => TextUtils::getMonthName($prevMonth) . ' ' . $prevYear, | 118 '#calPrev' => TextUtils::getMonthName($prevMonth) . ' ' . $prevYear, |
117 '#calPrev@href' => '/blog/posts/' . $prevYear . '/' . $prevMonth, | 119 '#calPrev@href' => '/blog/posts/' . $prevYear . '/' . $prevMonth, |