There is an error in the code in one of the plugins.
Edit the 'misc_start' code within the plugin manager and replace with this:
PHP Code:
if ($_REQUEST['do'] == 'lucky')
{
if ($vbulletin->options['lucky_onoff'])
{
$wol_can_view = is_member_of($vbulletin->userinfo,explode(',',$vbulletin->options['lucky_group'])) ? true : false;
if ($wol_can_view)
{
$excludedforums = '';
if ($vbulletin->options['lucky_forum'] !== '') {
$excludedforums = ',' . $vbulletin->options['lucky_forum'];
}
$forumpermissions = array();
foreach($vbulletin->forumcache AS $forum) {
$forumpermissions[$forum["forumid"]] = fetch_permissions($forum['forumid']);
if (!($forumpermissions[$forum["forumid"]] & $vbulletin->bf_ugp_forumpermissions['canview']) AND !$vbulletin->options['showprivateforums']) {
$excludedforums = $excludedforums . ',' . $forum['forumid'];
}
}
unset($forum);
// get rid of initial comma
$excludedforums = substr($excludedforums, 1);
if ($excludedforums != "") {
$excludedforums = "AND " . TABLE_PREFIX . "thread.forumid NOT IN ($excludedforums)";
}
$lucky_threads = $db->query_first("SELECT threadid, dateline, visible FROM " . TABLE_PREFIX . "thread WHERE NOT ISNULL(threadid) AND visible = '1' $excludedforums ORDER BY RAND() LIMIT 1");
header('Location: showthread.php?t='.$lucky_threads['threadid']);
}
}
}
If you want to know what I've changed, you'll see a new
" . TABLE_PREFIX . " contained within this section of code
Code:
if ($excludedforums != "") {
$excludedforums = "AND " . TABLE_PREFIX . "thread.forumid NOT IN ($excludedforums)";
}
I hope this helps someone