The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Query top 5 threads
Hello, since that vbulletin's database is sooo big, am having a hell of a time trying to get the details of each tables (plus i have a crappy internet connection), the thing is, i wish to display the top 5 threads according to the number of views a thread got, but i don't know the table names and field names i must use.
NOTE: Assume that i am using the normal unmodified prefix of vbulletin's table and field format. the displaying of the top 5 is trivial, since it is just a while loop, but i don't know what query i must use to get the thread id, name and its number of views (am confused with soo much of tables.) thanks +la |
#2
|
||||
|
||||
[sql]SELECT *
FROM " . TABLE_PREFIX . "thread ORDER BY dateline LIMIT 5[/sql] Then just do a while loop to loop through the thread's data. |
#3
|
||||
|
||||
The above query will show the threads by creation. The thread table actually has a views field, which can be used (though in vanilla VB it is not indexed, so it's a very inefficient query).
[sql]SELECT threadid, title, views FROM " . TABLE_PREFIX . "thread ORDER BY views desc LIMIT 5[/sql] |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|