Sorry, I was trying to do it from memory so I didn't have to go dig up a copy of 3.0. Anyway, here's more detailed instructions:
In global.php, find
PHP Code:
define('VB_AREA', 'Forum');
below that, add
PHP Code:
$globaltemplates = array_merge($globaltemplates, array('quote_randomquote'));
Also in global.php, find
PHP Code:
$logincode = construct_login_code();
below that, add
PHP Code:
// ############## Start QuoteIt Hack ###############################
if ($vboptions['showquote']) {
$gradient1 = str_replace('#', '', $stylevar['alt1_bgcolor']);
$gradient2 = str_replace('#', '', $stylevar['alt2_bgcolor']);
list($usec, $sec) = explode(' ', microtime());
mt_srand((float) $sec + ((float) $usec * 100000));
if ($vboptions['averagethreshold'] != '') {
$threshold = 'AND quotes.average >= ' . floatval($vboptions['averagethreshold']) . ' ';
}
if ($vboptions['totalthreshold'] != '') {
$threshold .= 'AND quotes.rating >= ' . intval($vboptions['totalthreshold']) . ' ';
}
$count = $DB_site->query_first('
SELECT COUNT(*) AS count FROM ' . TABLE_PREFIX . 'quotes AS quotes
WHERE approved = 1 ' . $threshold
);
$row = mt_rand(0, $count['count'] - 1);
$randomquote = $DB_site->query_first('
SELECT quotes.* FROM ' . TABLE_PREFIX . 'quotes AS quotes
WHERE approved = 1 ' . $threshold . ' LIMIT ' . $row . ', 1
');
if ($vboptions['ratequote'] AND $randomquote['quoteid'] AND $bbuserinfo['userid'] AND $DB_site->query_first('SELECT * FROM ' . TABLE_PREFIX . 'quoteratings WHERE quoteid = ' . $randomquote['quoteid'] . ' AND userid = ' . $bbuserinfo['userid'])) {
$vboptions['ratequote'] = 3;
}
eval('$showrandomquote = "' . fetch_template('quote_randomquote') . '";');
}
// ############## End QuoteIt Hack ###############################