A couple of requests (Stats + Latest Posts)
#9
DCR Wrote:
Kikkerkont Wrote: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;
?>

Yuck, that is outdated too. Why are you connecting to the database again? And this is the exact same one I posted on my first post, but without the connection again, which is still outdated.

Cause that's the only way to get the latest posts like i told you already ... the stats you can get from the cache, not the latest posts.
Reply


Messages In This Thread
RE: A couple of requests (Stats + Latest Posts) - by LeX- - 2007-10-01, 05:18 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)