A bug has been found in the random site part of the Toplist. Here is how you fix it...
Open toplist.php.
Find:
PHP Code:
if ($vbulletin->options['toplist_check_if_code_exists'])
{
$randsite1 = "SELECT `id`, `name`, `description`, `imagecode`, `in`, `out`, `views`, `votes`, `rating_average` FROM " . TABLE_PREFIX . "toplist_sites WHERE `status` = 'active' AND `added_code` = 1 ORDER BY RAND() LIMIT 1";
}
else
{
$randsite1 = "SELECT `id`, `name`, `description`, `imagecode`, `in`, `out`, `views`, `votes` , `rating_average` FROM " . TABLE_PREFIX . "toplist_sites WHERE `status` = 'active' ORDER BY RAND() LIMIT 1";
}
Replace With:
PHP Code:
if ($vbulletin->options['toplist_check_if_code_exists'])
{
$randsite1 = "SELECT `id`, `name`, `url`, `description`, `imagecode`, `in`, `out`, `views`, `votes`, `rating_average` FROM " . TABLE_PREFIX . "toplist_sites WHERE `status` = 'active' AND `added_code` = 1 ORDER BY RAND() LIMIT 1";
}
else
{
$randsite1 = "SELECT `id`, `name`, `url`, `description`, `imagecode`, `in`, `out`, `views`, `votes` , `rating_average` FROM " . TABLE_PREFIX . "toplist_sites WHERE `status` = 'active' ORDER BY RAND() LIMIT 1";
}
Find:
PHP Code:
if ($vbulletin->options['toplist_check_if_code_exists'])
{
$randsite1 = "SELECT `id`, `name`, `description`, `imagecode`, `in`, `out`, `views`, `votes`, `rating_average` FROM " . TABLE_PREFIX . "toplist_sites WHERE `status` = 'active' AND `added_code` = 1 ORDER BY RAND() LIMIT 1";
}
else
{
$randsite1 = "SELECT `id`, `name`, `description`, `imagecode`, `in`, `out`, `views`, `votes`, `rating_average` FROM " . TABLE_PREFIX . "toplist_sites WHERE `status` = 'active' ORDER BY RAND() LIMIT 1";
}
Replace With:
PHP Code:
if ($vbulletin->options['toplist_check_if_code_exists'])
{
$randsite1 = "SELECT `id`, `name`, `url`, `description`, `imagecode`, `in`, `out`, `views`, `votes`, `rating_average` FROM " . TABLE_PREFIX . "toplist_sites WHERE `status` = 'active' AND `added_code` = 1 ORDER BY RAND() LIMIT 1";
}
else
{
$randsite1 = "SELECT `id`, `name`, `url`, `description`, `imagecode`, `in`, `out`, `views`, `votes`, `rating_average` FROM " . TABLE_PREFIX . "toplist_sites WHERE `status` = 'active' ORDER BY RAND() LIMIT 1";
}
Save and Close toplist.php.
Derek