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.list_by_category.php
100644 22 lines (16 sloc) 0.667 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
if (!isset($gCms)) die("Can't call actions directly!");
 
$posts = null;
$category = cms_orm('BlogCategory')->find_by_name_or_slug($params['category'], $params['category']);
 
if ($category != null)
{
  $posts = $category->published_posts;
}
 
$this->add_header_text('<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="' . $this->generate_rss_link(array(), $params['category']) . '" />');
 
$smarty->assign('posts', $posts);
 
if (coalesce_key($params, 'rss', false) == true)
  echo $this->process_template_from_database($id, $return_id, 'rss');
else
  echo $this->process_template_from_database($id, $return_id, 'summary');
 
# vim:ts=4 sw=4 noet
?>