The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
How would i go about fetching the forumid the plugin is activated in and pass that variable into my query? Is this possible?
$listings = $vbulletin->db->query_read("SELECT title, threadid FROM " . TABLE_PREFIX . "thread WHERE forumid = 'variablehere' ORDER BY rand() DESC LIMIT 5 "); --------------- Added [DATE]1235378133[/DATE] at [TIME]1235378133[/TIME] --------------- Got it working but just wanted to see if theres a better way to do this. Is there a better way to do this? Code:
$forumidtest = $foruminfo['forumid']; $listings = $vbulletin->db->query_read("SELECT title, threadid FROM " . TABLE_PREFIX . "thread WHERE forumid = '$forumidtest' ORDER BY rand() DESC LIMIT 5 "); |
#2
|
||||
|
||||
![]()
ORDER BY RAND() is very slow. Have a read: http://akinas.com/pages/en/blog/mysql_random_row/
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|