I'm planning on making an XML feed for members to quickly access the latest updated threads on my website forum.
To be honest, I have rushed into it without reading many tutorials other than how to structure XML.
This is my code so far:
PHP Code:
<?php
$your_data = "<?xml version=\"1.0\"?><rss version=\"2.0\"><channel><title>The Channel Title Goes Here</title><description>The explanation of how the items are related goes here</description><link>http://www.directoryoflinksgohere</link><item><title>The Title Goes Here</title><description>The description goes here</description><link>http://www.linkgoeshere.com</link></item></channel></rss>";
// Open the file and erase the contents if any $fp = fopen("feed.xml", "w");
// Write the data to the file fwrite($fp, $your_data);
// Close the file fclose($fp);
?>
In a fully-completed code, the $your_data variable would be a database output of the most recently updated threads.
My problem lies in that there are some boards on my forum that are hidden from members and are inaccessible to them and of course, I don't want those threads to be shown on the feed. However, they should be shown to SOME people, but not others.
By the system of coding I have above, I would include the above code on every page of my website so that everytime somebody loaded a page, the database would be queried and the feed would update.
- Could someone tell me if what I described above has a solution
and if
- I'm on completely the wrong track and where I can go to find the best information.
Last edited by Petsmacker; 09-30-2007 at 05:44 PM..
|