Location: PHPKode > scripts > Noostr > _engine/handlers/rss.php
<?php defined('SYSPATH') OR die('No direct access to this file is allowed.');
/**
 * RSS feed handling.
 *
 * @package Noostr
 * @subpackage Handler_RSS
 */

if (isset($site->uri[0]) && strtolower($site->uri[0]) == 'rss') {
	$feedtype = 'hot';
	if (isset($site->uri[1]) && strtolower($site->uri[1]) != '') {
		$feedtype = $site->uri[1];
	}
	$stories = null;
	switch ($feedtype) {
		case 'hot':
		case 'new':
		default:
			$stories = get_ranked_stories();
			break;
	}
	echo '<?xml version="1.0" encoding="UTF-8"?>';
	echo '<rss version="2.0">';
	echo '<channel>';
	echo '<title>'.$site->name.'</title>';
	echo '<link>'.$site->root.'</link>';
	echo '<description>'.$site->tagline.'</description>';
	for ($i = 0, $c = count($stories); $i < $c; $i++) {
		$url = $stories[$i]['url'];
		if ($url == '') {
			$url = $site->root.'/story/'.$stories[$i]['uid'];
		}
		$commentlink = $site->root.'/story/'.$stories[$i]['uid'];
		$desc = '<![CDATA[<a href="'.$commentlink.'">Comments</a>]]> ';
		$desc .= substr($stories[$i]['description'], 0, 512);
		echo '<item>';
		echo '<title>'.$stories[$i]['title'].'</title>';
		echo '<link>'.$url.'</link>';
		echo '<guid>'.$stories[$i]['uid'].'</guid>';
		echo '<comments>'.$commentlink.'</comments>';
		echo '<description>'.$desc.'</description>';
		echo '</item>';
	}
	echo '</channel>';
	echo '</rss>';
	die();
}
Return current item: Noostr