tlaplugins
10-15-2010, 01:38 PM
I have been having trouble getting the first post in a thread depending on the vbulletin implementation
here is the sql im using
SELECT post.title, thread.title AS ttitle, post.threadid, post.pagetext, post.dateline, thread.forumid, post.postid, postparsed.pagetext_html
FROM ".TABLE_PREFIX."post as post
LEFT JOIN " . TABLE_PREFIX . "thread AS thread ON thread.threadid = post.threadid
LEFT JOIN " . TABLE_PREFIX . "postparsed AS postparsed ON postparsed.postid = post.postid
WHERE
post.visible != 2 AND parentid=0
GROUP BY
post.postid
ORDER BY
post.postid ASC
does anyone have a better more general way of getting the first post in every thread that is published?
here is the sql im using
SELECT post.title, thread.title AS ttitle, post.threadid, post.pagetext, post.dateline, thread.forumid, post.postid, postparsed.pagetext_html
FROM ".TABLE_PREFIX."post as post
LEFT JOIN " . TABLE_PREFIX . "thread AS thread ON thread.threadid = post.threadid
LEFT JOIN " . TABLE_PREFIX . "postparsed AS postparsed ON postparsed.postid = post.postid
WHERE
post.visible != 2 AND parentid=0
GROUP BY
post.postid
ORDER BY
post.postid ASC
does anyone have a better more general way of getting the first post in every thread that is published?