A couple of requests (Stats + Latest Posts)
#7
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}&amp;pid={$pid}#pid={$pid}\">{$subject}</a><br />";
}
echo $post;
?>
Reply


Messages In This Thread
RE: A couple of requests (Stats + Latest Posts) - by Kikkerking - 2007-09-30, 07:39 AM

Forum Jump:


Users browsing this thread: 6 Guest(s)