Set variables:
PHP Code:
$newsforumid="6"; // Forum ID to pull the news from
$items="5"; // How many news threads to pull
Connect to DB:
PHP Code:
$db_connection = mysql_connect("host","username","password") or die ("No DB Connection");
$db = mysql_select_db("dbname",$db_connection) or die ("Couldn't select DB");
Fetch the threads:
PHP Code:
$query="SELECT title,threadid,forumid,replycount,views,firstpostid,dateline
FROM thread
WHERE forumid='$newsforumid'
ORDER BY dateline DESC
LIMIT 0,$items";
$newsitems=mysql_query($query,$db_connection);
while ($news=mysql_fetch_array($newsitems)) {
$query="SELECT pagetext,postid
FROM post
WHERE postid='$news[firstpostid]'
";
$posts=mysql_query($query,$db_connection);
while ($post=mysql_fetch_array($posts)) {
Export your HTML with the info.. voila! (oh yea add in stuff like parse_bbcode, etc)