Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 26 Mar 2011, 08:11
downloadsuk downloadsuk is offline
 
Join Date: Jul 2010
Real name: Gregory Orton
Question [Q] Does the VB database keep track of "Most Recent Threads" not "posts"

Hi,

I'm doing some modding of my forum home page - as I'm modding the forum to be a Q&A site, I want to be able to have the forum home page list the most recent "questions" (i.e. the most recent topics / threads that have been opened) AND NOT the most recent posts.

Short of doing a query on the whole database, is there a list I can pull back of most recent threads or would I have to mysql (this is pseudo code here)

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

?

I mean, if I did it this way, surely I'd have to bring back every single thread, sort it by date, and then do some post processing in PHP to pick out the first 20 from the list. If my forum gets big, this is a hefty query to be doing. And if posts dates stretch across multiple months, I don't really want to have to do a qualifying cut-off like (less than 30 days).

Can anyone help me out here? Maybe with the appropriate SQL query or even some ideas about the way the vb database stores the thread meta information?
Reply With Quote
  #2  
Old 26 Mar 2011, 16:02
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
What exactly are you trying to post on your home page? Just a link to the 20 most recent threads? You can just use javascript for that.

See these threads for methods to pull threads via javascript:
[HowTo] Display your latest threads on an external page using an RSS2 feed
[HowTo] Display your latest threads on an external page using an XML feed
[HowTo] Display your latest threads on an external page using an RSS feed
__________________
Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #3  
Old 26 Mar 2011, 16:17
vbresults's Avatar
vbresults vbresults is offline
 
Join Date: Apr 2009
MySQL 5.0 Reference Manual: SELECT syntax.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #4  
Old 26 Mar 2011, 17:39
downloadsuk downloadsuk is offline
 
Join Date: Jul 2010
Real name: Gregory Orton
Originally Posted by Lancerforhire View Post
MySQL 5.0 Reference Manual: SELECT syntax.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
Thanks, you got the jist of what I'm after. a bientot good sir.

--------------- Added 27 Mar 2011 at 02:08 ---------------

just to confirm, the table value
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

is the start date for the thread right?

Why choose "dateline" as a table value? I mean, why confuse people and not just have "created_date" or something? Who the hell says "dateline"?

Last edited by downloadsuk : 27 Mar 2011 at 02:08. Reason: Auto-Merged DoublePost
Reply With Quote
  #5  
Old 03 Apr 2011, 20:57
vbresults's Avatar
vbresults vbresults is offline
 
Join Date: Apr 2009
The schema has been verbose for a while now; not saying it's good (it is not), but because vB is a giant bowl of spaghetti code and third-party add-ons use the column name "dateline", it would not be very easy to change it.

Also, vBulletin is quite old and making column names descriptive/friendly is a more modern thing.

Last edited by vbresults : 03 Apr 2011 at 21:42.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


New To Site? Need Help?

All times are GMT. The time now is 08:49.

Layout Options | Width: Wide Color: