PDA

View Full Version : Finding Last Video Post


vbplusme
12-25-2008, 06:00 AM
A lot of site are allowing their members to post video object code, like YouTube for example. When submitted, vBulletin just stores the code like it is part of the message. The question is, how does one find posts that contain the object code, more specifically, how would you find the "last" post that contains video code as in "The Latest Video" to display a thumbnail on front page of the forum?

So basically, you need to find the most recent post that contains a video. Any ideas or an easy solution for this issue?

Any help greatly appreciated.

TIA

Jinovich
12-25-2008, 05:34 PM
SELECT * FROM `post` WHERE `pagetext` LIKE '%<BBCODE>%' ORDER BY `postid` DESC LIMIT 0,30

This SQL query will display the last post with that code in. Replace <BBCODE> with the code used for videos.

vbplusme
12-26-2008, 02:55 AM
Perfect, exactly the direction I needed. I really appreciate it.

thanks very much, Michael