View Full Version : Show Random Thread from a Category on a non-vb page
smdani
02-02-2005, 08:31 PM
I would like to build a 'quote of the day' system with vb.
I would like to select randomly a thread from a category and show his title on an non-vb page.
Does anyone help me?
Thanks a lot!!
smdani
02-08-2005, 05:14 PM
any idea?
Andreas
02-08-2005, 05:20 PM
SELECT * FROM thread
LEFT JOIN post ON (post.postid = thread.firstpostid)
WHERE forumid IN (1,2,3,4)
ORDER BY RAND()
LIMIT 1
Where 1,2,3,4 are the ForumIDs where the thread should come from.
If you don't need the actual post you can leave out the join.
GuppyWithAGun
02-08-2005, 07:16 PM
how would you mkae it so that the bb code will show?
Andreas
02-08-2005, 07:26 PM
parse_bbcode2() in functions_bbcodeparse.php
smdani
02-12-2005, 07:19 AM
it works like a charm!!
What I do is to make a .php file that obtains a random thread from a category, and download that file with a cron entry day by day into an html file. So, I obtain a 'quote of the day system'.
Thanks a lot
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.