2007-09-30, 07:39 AM
(This post was last modified: 2007-09-30, 01:03 PM by Kikkerking.)
Latest posts:
<?php
// DBNAME
$dbname = "";
// USERNAME
$user = "";
// PASSWORD
$password = "";
// TABLE_PREFIX
$prefix = "mybb_";
// FORUMROOT
$root = "";
// Posts To Show
$max = 5;
// Connect to db
$db = mysql_connect("localhost",$user,$password) or die ("Failure!");
mysql_select_db($dbname,$db);
// Get Posts
$query = mysql_query("SELECT * FROM ".$prefix."posts ORDER BY dateline DESC LIMIT 0,$max");
while($posts = mysql_fetch_array($query))
{
$tid = $posts['tid'];
$pid = $posts['pid'];
$subject = $posts['subject'];
$username = $posts['username'];
$post .= $username." <a href=\"{$root}showthread.php?tid={$tid}&pid={$pid}#pid={$pid}\">{$subject}</a><br />";
}
echo $post;
?>