SEO-Board: Free, Fast and Search Engine Optimization Friendly Forum Script
»User: »Password:   Remember Me? 
SEO-Board Forum Software Community / General / Programming / RSS Feeds for latest topics - get it here
Posted:  29 Nov 2005 17:25   Last Edited By: Hristo
I have created an RSS script so that you can display the latest topics for your seoboard forum to others in rss form.  They can use it on their sites, or you can use it on your own site etc etc - whatever you want.

The file is  here

or you can copy and paste the info from below and call the file anything you want with a .php extension.

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>";

?>



Enter the details in the few variables and thats it - RSS feeds from your seoboard install :-)
Posted:  30 Nov 2005 09:31
Simple and nice. It can have some improvements like setting which forums to pull posts from, not to pull data from private forums etc. I will put a link to this topic from the downloads area.
__________________
Are you looking for an SEO Consultant?
Email me: hristo at seo-board dot com
Posted:  30 Nov 2005 15:49
Oops, i made a tiny code error on one line.

It should be this:

Code:

echo "<link>".$siteurl."index.php?a=vtopic&t=".$topic_id."</link>\n";


You can easily see which line this should be, but is 6 up from the bottom if you cannot
Posted:  30 Nov 2005 16:02
Fixed it.
__________________
Are you looking for an SEO Consultant?
Email me: hristo at seo-board dot com
Posted:  12 Dec 2005 16:44
Anyone add their feed to Gmail's Web Clips?

It seems that Google does not like the amperand... &t=4955

Hmm... maybe I should encode it or something.

BTW...thanks for the post!
__________________
Posted:  12 Dec 2005 18:59
Quote:
It seems that Google does not like the amperand... &t=4955
Try &amp; instead of &
__________________
Are you looking for an SEO Consultant?
Email me: hristo at seo-board dot com
Posted:  13 Dec 2005 00:58
Yup...just needed to encode it.  Works now in gmail.
__________________