vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Exporting Thread Info (https://vborg.vbsupport.ru/showthread.php?t=155059)

aceofspades 08-12-2007 10:36 PM

Exporting Thread Info
 
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

Code:

$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:

Quote:

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...

[sql]
SELECT `threadid`, `title`, `replycount`, `dateline` FROM `thread` WHERE `forumid` = X
[/sql]

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


All times are GMT. The time now is 10:11 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00952 seconds
  • Memory Usage 1,720KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete