Log in

View Full Version : Exporting Thread Info


aceofspades
08-12-2007, 10:36 PM
Hi guys,

Im currently making a front page for my site, but ive reached a point where i cant go any further because im totally stuck on the news side of things. What i want to do is be able to take thread information from a specific forum.

What i need is as follows:

Thread Title
Thread contents (i.e the message)
Post Date
Number of Replies

The only code ive seen that can do anything like this is last 10 threads, but after looking at the code i really cant see any way to make it display the other info, but i know its possible because mk portal and vb advanced manage to do it.

Is anyone able to help?

James

EnIgMa1234
08-12-2007, 11:15 PM
why not just take a look at the vbadvanced code?

aceofspades
08-12-2007, 11:39 PM
After looking at the news.php, i wouldnt have the first clue where to start. Unfortunatly if i had php knowledge i wouldnt be asking here :(

EnIgMa1234
08-13-2007, 07:46 AM
$query = $vbulletin->db->query_read("QUERY HERE");

while($thread = $vbulletin->db->fetch_array($query){
$title = $thread['title'];
..... = ......;
}

Try that if it makes sense to you.
If not i'll go further with it, I just don't have the database structure open right now :p

aceofspades
08-13-2007, 12:44 PM
Im afraid it doesnt, if you could just give me the database structure i will find out the rest of the code to get things like reply count. Im sorry, i just really am jumping in at the deep end here.

So far ive been told its:

GET table FROM database WHERE blah

Which helps a little i guess :S

Opserty
08-13-2007, 01:09 PM
Off the top of my head...


SELECT `threadid`, `title`, `replycount`, `dateline` FROM `thread` WHERE `forumid` = X

EnIgMa1234
08-13-2007, 02:09 PM
also remember to use vbdate($vbulletin->options['dateformat'], $thread['dateline']);

You can also add to the end of Opserty's query ORDER BY dateline DESC