RSS feed editor
Posted: Thu Oct 23, 2008 6:15 am
Hi,
I'm currently making an attempt of doing an RSS feed.
With my extensive PHP skills I managed to read the xml file and output my latest news.
What I want to do now is a function that adds a new news item to my xml file, which I later can implement to my other functions on the site (if I add a song it will update the xml file for example).
I need help with the initial design for the xml file update:
The direction I am going for now is to read the first portion of the file into a variable and then read the rest of the file to variable2. Inserting my new item between those and write back to the file.
Is that the way to go or is there I better aproach?
thanks
I'm currently making an attempt of doing an RSS feed.
With my extensive PHP skills I managed to read the xml file and output my latest news.
What I want to do now is a function that adds a new news item to my xml file, which I later can implement to my other functions on the site (if I add a song it will update the xml file for example).
I need help with the initial design for the xml file update:
Code: Select all
<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0">
<channel>
<title>Craven-Studio.com</title>
<link>http://www.craven-studio.com/</link>
<description>Music studio, web design, art</description>
<item>
<title>Site Structure 1.0</title>
<link>http://craven-studio.com/articles.php?id=5</link>
<description>New article, Site Structure 1.0 added</description>
<pubDate>2008-10-21</pubDate>
</item>
<item>
<title>Newsfeed added</title>
<link>http://www.craven-studio.com/about_rss.php</link>
<description>Newsfeed functionality added</description>
<pubDate>2008-10-21</pubDate>
</item>
<item>
<title>How I mix</title>
<link>http://www.craven-studio.com/articles.php?id=1</link>
<description>New article, How I mix added</description>
<pubDate>2008-10-01</pubDate>
</item>
</channel>
</rss>Is that the way to go or is there I better aproach?
thanks