public
Description: Blog Modules for CMS Made Simple 2.0
Homepage: http://cmsmadesimple.org
Clone URL: git://github.com/tedkulp/cmsms-blog.git
cmsms-blog / action.filter_list.php
100644 26 lines (23 sloc) 0.807 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
if (!isset($gCms)) die("Can't call actions directly!");
 
$conditions = array();
if ($params['day'] > -1)
{
  $conditions = array('status = ? and post_year = ? and post_month = ? and post_day = ?', 'publish', $params['year'], $params['month'], $params['day']);
}
else if ($params['month'] > -1)
{
  $conditions = array('status = ? and post_year = ? and post_month = ?', 'publish', $params['year'], $params['month']);
}
else if ($params['year'] > -1)
{
  $conditions = array('status = ? and post_year = ?', 'publish', $params['year']);
}
else
{
  $conditions = array('status = ?', 'publish');
}
$smarty->assign('posts', cms_orm('BlogPost')->find_all(array('order' => 'id desc', 'conditions' => $conditions)));
 
echo $this->process_template_from_database($id, $return_id, 'summary');
 
# vim:ts=4 sw=4 noet
?>