[eluser]iniweb[/eluser]
This is my code:
Code:
class Rss extends Controller {
function Rss()
{
parent::Controller();
$this->load->helper('date');
}
function Index()
{
$query = $this->db->query("SELECT * FROM ci_news WHERE status = '1' ORDER BY id DESC LIMIT 10");
$content = '';
foreach($query->result() as $row)
{
$row->date = human_to_unix($row->date);
$row->date = standard_date('DATE_RSS', $row->date);
$row->link = "<a href=\"http://yaba.ru/News/$row->id/\">http://yaba.ru/News/$row->id/</a>";
$data = array(
'author' => $row->author,
'title' => $row->title,
'link' => $row->link,
'images' => $row->images,
'date' => $row->date,
'short_story' => $row->short_story
);
$content .= $this->parser->parse('Rss_Elements.tpl', $data);
}
$data = array(
'content' => $content,
);
$this->load->library('parser');
$this->parser->parse('Rss.tpl', $data);
}
}
if Rss.tpl have this content:
Code:
<?xml version="1.0" encoding="windows-1251"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Yaba News</title>
<link>http://yaba.ru</link>
<language>ru</language>
<description>Yaba News</description>
<generator>Yaba News</generator>
{content}
</channel></rss>
Show this error:
Quote:Parse error: parse error, unexpected T_STRING in x:\home\igniter.by\www\system\application\views\Rss.tpl on line 1
How to correct?