The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
Given a threadid (and forumid, if it makes a difference), how can I get the contents of the first post in a thread?
|
|
#2
|
||||
|
||||
|
$DB_site->query("SELECT * FROM post WHERE threadid = " . intval($threadid) . " ORDER BY dateline DESC LIMIT 1");
.. eh something like that |
|
#3
|
||||
|
||||
|
in vb3 you are going to need to do this as no variables will be available in the global scope:
$DB_site->query("SELECT * FROM post WHERE threadid = " . intval($_REQUEST['threadid']) . " ORDER BY dateline DESC LIMIT 1"); |
|
#4
|
|||
|
|||
|
Didn't quite work:
PHP Code:
|
|
#5
|
||||
|
||||
|
After that query run:
echo $post[pagetext]; |
|
#6
|
||||
|
||||
|
Actually you need to use query_first(), not query()...
|
|
#7
|
|||
|
|||
|
Thanks, a combinations of those two suggestions fixed it
|
|
#8
|
|||
|
|||
|
It has to be ASC, not DESC, BTW, it was returning the last post
|
|
#9
|
||||
|
||||
|
Oh yeah, that too. You can remove the ASC really, it's not needed.
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|