View Full Version : display latest vbulletin posts in wordpress??
Pasquale
November 14th, 2005, 05:01 AM
how could this be done?? i just want to display the latest topics on the homepage of my site (like kirupa) :P
thanks
danielson
November 14th, 2005, 10:06 AM
Check your database schema and have a look for the table that stores topics. If it was called "topics", the SQL to get the 5 latest topics in descending order would be something like "SELECT * FROM topics ORDER BY date DESC LIMIT 5".
Unless I guessed the table and field names right (i've never used vBulletin) but i'm sure it's along the right lines.
Expanding on this, the basic PHP to display links to the topics would be:
//DB connection code here
$sql = "SELECT * FROM topics ORDER BY date DESC LIMIT 5";
$query = mysql_query($sql);
while($result = mysql_fetch_array($query)){
echo("<a href=\"http://www.yoururl.com/forum/showthread.php?t=$result['topicID']\">$result['topicName']</a><br /><br />");
}
I'm sure there's somebody who can supply you with a better answer, but it's a start! :)
Pasquale
November 26th, 2005, 09:18 PM
ha thanks :D i'll try and work on that :P
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.