@@ -153,8 +153,15 @@ public function dates() {
153153
154154 public function showall_by_date () {
155155 expHistory::set ('viewable ' , $ this ->params , true );
156- $ start_date = expDateTime::startOfMonthTimestamp (mktime (0 , 0 , 0 , $ this ->params ['month ' ], 1 , $ this ->params ['year ' ]));
157- $ end_date = expDateTime::endOfMonthTimestamp (mktime (23 , 59 , 59 , $ this ->params ['month ' ], 1 , $ this ->params ['year ' ]));
156+ if (isset ($ this ->params ['month ' ])) {
157+ $ start_date = expDateTime::startOfMonthTimestamp (mktime (0 , 0 , 0 , $ this ->params ['month ' ], 1 , $ this ->params ['year ' ]));
158+ $ end_date = expDateTime::endOfMonthTimestamp (mktime (23 , 59 , 59 , $ this ->params ['month ' ], 1 , $ this ->params ['year ' ]));
159+ $ period = expDateTime::format_date ($ start_date ,"%B %Y " );
160+ } else {
161+ $ start_date = expDateTime::startOfYearTimestamp (mktime (0 , 0 , 0 , 1 , 1 , $ this ->params ['year ' ]));
162+ $ end_date = expDateTime::endOfYearTimestamp (mktime (23 , 59 , 59 , 12 , 1 , $ this ->params ['year ' ]));
163+ $ period = expDateTime::format_date ($ start_date ,"%Y " );
164+ }
158165
159166 $ page = new expPaginator (array (
160167 'model ' =>$ this ->basemodel_name ,
@@ -173,7 +180,7 @@ public function showall_by_date() {
173180
174181 assign_to_template (array (
175182 'page ' =>$ page ,
176- 'moduletitle ' =>gt ('Blogs by date ' ).' " ' .expDateTime:: format_date ( $ start_date , " %B %Y " ) .'" ' )
183+ 'moduletitle ' =>gt ('Blogs by date ' ).' " ' .$ period .'" ' )
177184 );
178185 }
179186
0 commit comments