The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
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) Code:
SELECT ( first 20 of) threads FROM thread.table WHERE thread.start <= today 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? |
#2
|
||||
|
||||
![]()
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 |
#3
|
|||
|
|||
![]()
MySQL 5.0 Reference Manual: SELECT syntax.
Code:
SELECT * FROM thread ORDER BY dateline DESC LIMIT 0, 20 |
#4
|
|||
|
|||
![]() Quote:
--------------- Added [DATE]1301191696[/DATE] at [TIME]1301191696[/TIME] --------------- just to confirm, the table value Code:
thread.dateline 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"? |
#5
|
|||
|
|||
![]()
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. |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|