public
Description: Blog Modules for CMS Made Simple 2.0
Homepage: http://cmsmadesimple.org
Clone URL: git://github.com/tedkulp/cmsms-blog.git
wishy (author)
Tue Apr 08 07:25:24 -0700 2008
commit  3aef452680351b0d4f2343fd4fbd0aa68bbf9255
tree    60dc7a2e6eb8602e858eac4d4c856382affdd232
parent  45e6bc007ff3c2a1dd558118c8e484be1cf61dff
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
?>