View Full Version : Last Post onto a non-forum page???
BicyclePunk
08-29-2002, 08:48 PM
:ermm: Ok...I've spent the last couple of days between here and the discussion area on the the official vB site in an effort to find a hack or code or just some help on how I can extrapolate the most recent forum post and have it show up on another non-forum php page on my site...specifically I would like to have it show up on my homepage a la DevShed. Any advice on what the hack is named, how I can do it myself or anything else that will save the remaining hair on my head would be greatly appreciated. Thanks....
g-force2k2
08-30-2002, 12:12 AM
// Setting up Database Connect
$Host = "localhost";
$User = "user name here";
$Password = "password here";
$DBName = "vb database name here";
// Collecting Post Info
$Link = mysql_connect ($Host, $User, $Password);
$Query = "SELECT * FROM post WHERE postid != 0 ORDER BY postid DESC LIMIT 5";
$Result = mysql_db_query ($DBName, $Query, $Link);
while ($row = mysql_fetch_array($Result)) {
$userid = $row[userid]; $username= $row[username]; $postid=$row[postid]; $title=$row[title];
$latestpostlist.= "<a href='../showthread.php?s=$session[sessionhash]&postid=$postid#post$postid'>$title</a> <b>By: <a href='..member.php?s=$session[sessionhash]&action=getinfo&userid=$userid'>$username</a></b><br>";
}
mysql_close ($Link);
try this code BicyclePunk ;) regards... the urls might have to be adjusted to your sites needs... hope this works ;)
g-force2k2
BicyclePunk
08-30-2002, 01:47 AM
You ROCK! I will give it a shot tomorrow...time to sleep now. Thanks!!!!
g-force2k2
08-30-2002, 01:59 AM
oh btw you have to put this coding where you want it to show up on the page ;) regards...
echo "$lastestpostlist";
hope that it works :)
g-force2k2
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.