3 * @name tsControllerRss
4 * @package RSS output class
7 class tsControllerRss
extends tsControllerHtml
{
9 public function __construct(){
18 protected function connectDb () {
19 $this->db
= sqlFactory
::connect (DB_TYPE
);
21 if (defined ('DB_NAME') && DB_NAME
&& !empty($this->db
->link
)) {
22 $this->db
->selectDatabase(DB_NAME
);
28 public function dispatch (){
32 $this->smarty
= new Smarty();
34 $this->smarty
->compile_check
= false;
35 // $this->smarty->debugging = C_SYSTEM_DEBUG;
36 $this->smarty
->compile_dir
= S_C_TEMPL_DIR
;
38 if (is_file (PAGE_PATH
. $className . DIRECTORY_SEPARATOR
. $className . '.tpl')) {
39 $this->smarty
->assign('contentFile', PAGE_PATH
. $className . DIRECTORY_SEPARATOR
. $className . '.tpl');
41 $this->smarty
->assign('contentFile', $this->themePath
. DIRECTORY_SEPARATOR
. S_TEMPL_DIR
. 'tpl404.tpl');
44 if (is_array($this->varArray
)) {
45 $this->smarty
->assign ($this->varArray
);
47 $this->content
= $this->smarty
->fetch ($this->themePath
. DIRECTORY_SEPARATOR
. S_TEMPL_DIR
. 'rss.tpl');
49 $this->postDispatch ($this->content
);
52 protected function postDispatch ($incString) {
53 header ('Content-Type: application/rss+xml');
55 array ('%TIME%','%QUERIES%', '%MEMUSED%'),
57 number_format(microtime (true) - $GLOBALS['st'] , 5, ',', '.'),
59 number_format(memory_get_usage()/1024, 3, ',', '.')