The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Pulling only "visible" threads from the database
I'm pulling the latest threads from the database to link to them from another page. I just want to be sure to only pull "visible" ie not moderated and deleted threads. Is the 'visible' field the right one to use or is there something I should do with the 'hiddencount' and 'deletedcount' fields?
Code:
select `title` , `threadid` from `thread` where `visible`=1 order by `threadid` desc limit 5 |
#2
|
||||
|
||||
Also be aware that if you're not checking user permissions these threads could be pulled from anywhere in your forums. But I believe that will do what you want.
|
#3
|
||||
|
||||
Thanks Zach,
Right now I don't have any hidden/mod forums, but if/when I do, then I could simply check the forumid in the threads table and exclude my hidden forums right? Other than that, and just for confirmation, the visible field is what gets set to 0 when a thread is in the moderation queue or is deleted? Thanks a bunch, |
#4
|
||||
|
||||
0 Soft deleted 1 visable 2 moderated I believe
|
#5
|
||||
|
||||
OK, Thanks a lot, I appreciate it.
|
#6
|
||||
|
||||
You also need to check that the open field does not equal 10 - if it does then it's a redirect, not a real thread.
|
#7
|
||||
|
||||
Thanks Paul for that! That eventuality hadn't even occurred to me.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|