【发布时间】:2010-05-07 18:02:01
【问题描述】:
所以我刚刚制作了我的第一个 RSS 提要,或者我认为,结合 CI。现在我的视图确实显示了我的 rss 页面的顶部(标题和描述),但所有项目都被省略了。当我右键单击->查看源代码时,它确实包含项目标签中的所有项目。
谁能帮帮我?
查看(rss.php):
<?php echo '<?xml version="1.0" encoding="'.$encoding.'"?>'."\n"; ?>
<rss version="2.0"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:admin="http://webns.net/mvcb/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title><?php echo $feed_name; ?></title>
<link><?php echo $feed_url; ?></link>
<description><?php echo $page_description; ?></description>
<dc:language><?php echo $page_language; ?></dc:language>
<dc:creator><?php echo $creator_email; ?></dc:creator>
<dc:rights>Copyright <?php echo gmdate("%Y", time()); ?></dc:rights>
<dc:date><?php echo gmdate("%Y-%m-
T;%H:%i:%s%Q", time()); ?></dc:date>
<admin:generatorAgent rdf:resource="http://www.codeigniter.com/" />
<?php foreach($items as $entry): ?>
<?php $entry_url = base_url().$this->lang->lang().$localized_news[$this->lang->lang()].'/'.print_date(strtotime($entry->published), "{year}/{month2}").'/'.$entry->slug; ?>
<item>
<title><?php echo xml_convert($entry->title); ?></title>
<link><?php echo $entry_url; ?></link>
<guid><?php echo $entry_url; ?></guid>
<description><?php echo $entry->summary; ?></description>
<pubDate><?php echo date('r', $entry->published); ?></pubDate>
</item>
<?php endforeach; ?>
</channel>
这是输出的样子: screenshot
在源代码中,需要显示的每个项目都在那里。和
<item> <link> <description> <guid> and <pubdate> 标签。
我一直在寻找原因大约 1.5 小时。我找不到任何东西。如果我做错了什么,有人可以告诉我吗?感谢帮助!
~门诺
【问题讨论】:
-
用
替换你的 标签
标签: php codeigniter rss