File: D:/HostingSpaces/PvdBoogaard/indoorski.nl/backup/oude-site/cms/includes/pages/viewcategoryrss.php
<?php
/**
* This file contains the iwp_page_viewcategoryrss class
*
* @version $Id$
*
*
* @package IWP
* @subpackage IWP_FrontEnd
*/
/**
* IWP Frontend View Author Page
* This class extends the iwp_engine abstract class.
* This class handles the actions for viewing an author's profile
*
* @package IWP
* @subpackage IWP_FrontEnd
*/
class iwp_page_viewcategoryrss extends iwp_engine {
/**
* Calls the parent constructor
*
* @return void Doesn't return anything
*/
public function __construct(){
parent::__construct();
}
/**
* This function tells the controller to load an rss feed for a category.
*
* @return void Doesn't return anything
*/
public function ShowPage(){
$sections = $this->urls->GetCurrentMatches();
$categoryId = $sections['idnumber'];
$category = iwp_categories::getInstance();
$category->Load($categoryId);
$RSSArray = array();
$requestPage = max((int)@$_GET['page'], 1);
$perpage = 10;
$limit = (($requestPage*$perpage)-$perpage) . ', '.$perpage;
$list = new iwp_lists();
$sql = 'select * from '.IWP_TABLE_CONTENT.' as c inner join '. IWP_TABLE_CONTENTTYPES .' as ct on c.typeid = ct.typeid inner join '.IWP_TABLE_CATASSOC.' as ca on c.contentid=ca.contentid where /*%%visibility%%*/ (ca.categoryid='.$category->GetId().') order by c.startdate desc limit ' . $limit;
$RSSArray = $list->OutputRssByQuery($sql);
$rss = new iwp_rsscreator(false);
$rss->StartRSS($category->Get('name'), iwp_config::Get('siteURL').$this->urls->ViewCategoryURL($category->GetId()), $category->Get('description'));
foreach($RSSArray as $item){
$rss->AddItem($item);
}
$rss->EndRSS(true);
}
}