tags:

views:

37

answers:

2

I have my own CMS(PHP/MySQL) and I want to add 3 or 4 different feeds.

I am not really sure what(kinds of codes) I need to add to my CMS.

Could anyone guide me the right direction please?

Thanks in advance.

--Edit--

Is there any application which convert my website to xml?

--Edit-- Is there any codes which I can use ? Any resources?

+1  A: 

RSS is just an XML file with one "item" for each feed post. Read the specification and check out the example files here:

http://validator.w3.org/feed/docs/rss2.html

It's really simple. You don't need most of the tags for each item either, just title, link, description and pubDate.

description is probably the most "advanced" field as there is the place to put your text. The description field can contain HTML but you need to run it through htmlspecialchars first, like so:

echo '<description>' . htmlspecialchars($description) . '</description>';

I think you are able to figure the rest out on your own ;-)

Emil Vikström
Thanks. So I need codes to output in xml to a feed page? Am I right?
shin
You are right. Just echo out the correct XML file. Echo out the beginning of the file, then loop through your SQL resultset and print out each item, and after the loop print out the end of the file.
Emil Vikström
+2  A: 

Rss is just some simple xml output I found a rss class for you, which would generate an whel formed rss for your cms. php script to create RSS-feed

You would use it like this:

$myfeed = new RSSFeed();
$myfeed->SetChannel('http://www.mysite.com/xml.rss',
          'My feed name',
                  'My feed description',
          'en-us',
          'My copyright text',
                  'me',
          'my subject');
$myfeed->SetImage('http://www.mysite.com/mylogo.jpg');
$myfeed->SetItem('http://www.mysite.com/article.php?id=bla',
                   'name',
                   'description');
....
echo $myfeed->output();
streetparade