Code: <?
// SEOBOARD RSS Feed Creator by James Welch November 2005. No copyright whatsoever so do what you want!
//This script creates an rss feed of the latest posts on your seoboard forum so that you can have others use this on their sites.
// You can register the feed on various feed sites such as feedster and syndic8 so that others can gain your latest content.
// You can also, by using an rss parser script, show this list on your php enabled site.
// forum options
$siteurl = "http://www.mywebsite.com/forum/"; // FULL URL path of forum including http:// and the final slash ( / )
$numhead = 10; //the number of headlines to show
$feedtitle = "My Website Title"; // the title of your feed
$feeddesc = "The latest posts from my forum"; // a description of the feed
$feedlink = "http://www.mywebsite.com"; // the homepage of your site (include
http://)
// enter your mysql database username, password and database name for the seoboard install.
// This file will be the rss feed to include when you wish to show the last topics from the site.
$username="";
$password="";
$database="";
// Thats it ! - upload this file and you are done :)
///// NO NEED TO CHANGE ANYTHING BELOW THIS LINE /////
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
// get the data from the topics table
$query = 'SELECT * FROM seo_board_topics ORDER BY topic_lastpost_time DESC LIMIT 0,'.$numhead.'';
$result=mysql_query($query);
$num=mysql_numrows($result);
// lets get all the headlines and put them into an rss feed.
//the introduction bits
echo "<?xml version=\"1.0\"?>\n";
echo "<rss version=\"2.0\">\n<channel>\n\n";
echo "<title>$feedtitle</title>\n";
echo "<description>$feeddesc</description>\n";
echo "<link>$feedlink</link>\n\n";
$i=0;
while ($i < $num) {
$topic_title=mysql_result($result,$i,"topic_title");
$topic_id=mysql_result($result,$i,"topic_id");
echo "<item>\n";
echo "<title>".$topic_title."</title>\n";
echo "<link>".$siteurl."index.php?a=vtopic&t=".$topic_id."</link>\n";
echo "</item>\n";
$i++;
}
echo "\n</channel>\n</rss>";
?>