Skip to content

Commit 97b6734

Browse files
author
Maverick
committed
+ Added support for CjBlog Archive module to display articles by year
and month
1 parent 9d49c83 commit 97b6734

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

site/models/articles.php

+13-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,19 @@ function get_articles($options = array()){
121121
if ($app->getLanguageFilter()) {
122122

123123
$wheres[] = 'a.language in (' . $this->_db->Quote( $lang->getTag() ) . ',' . $this->_db->Quote('*') . ')';
124-
}
124+
}
125+
126+
$year = $app->input->getInt('year');
127+
$month = $app->input->getInt('month');
128+
if($year)
129+
{
130+
$wheres[] = 'year(a.created) = '.$year;
131+
if($month)
132+
{
133+
$wheres[] = 'month(a.created) = '.$month;
134+
}
135+
}
136+
125137

126138
$where = '('.implode(') and (', $wheres).')';
127139

0 commit comments

Comments
 (0)