<?php
	require_once( $GLOBALS["site_root"]."/includes/exports/RSS.inc.php" );

	class NewsRSS extends RSS {

		protected function prepareFeed() {
			$this->aChannel['name']='fordit.hu';
			$this->aChannel['description']='Fordítási tolmácsolási hírek';
			$query = sprintf( "
				select
					la.larticle_title as title,
					'http://www.fordit.hu'||la.larticle_url as link,
					'http://www.fordit.hu'||la.larticle_url as guid,
					la.larticle_lead as lead,
					floor( extract( epoch from a.article_ctstamp) ) as pubdate
				from
					larticles as la,
					articles as a
				where
					la.article_id=a.article_id
					and la.site_language_id=1
					and la.is_active
					and la.is_public
					and not la.is_deleted
					and a.article_category_id=4
				order by a.article_ctstamp desc
				limit 25" );
			$ds = FNTH_db_get_resultset( $query );
			$items = array();
			foreach ($ds as $row) {
				$item = $row;
				$item['lead']=trim( strip_tags( $row['lead'] ));
				$items[]=$item;
			}
			$this->aItems = $items;
		}

		public function render() {
			if ($this->sRendered) return $this->sRendered();
			$this->prepareFeed();
			return parent::render();
		}

	}

?>
