Attention M1th.
PHP Code:
$forumids = array_keys($forumcache);
foreach($forumids AS $key => $value)
{
$fperms = &$bbuserinfo['forumpermissions']["$forumid"];
$forum = &$forumcache["$forumid"];
if (!($fperms && CANVIEW) OR !($fperms && CANSEARCH) OR !verify_forum_password($forumid, $forum['password'], false)) {
unset($forumids["$key"]);
}
}
$forumids apparently ends up empty, because when the script tries to implode() it later on for use in the IN() in the query, nothing results, breaking the query.