Quote:
Originally Posted by dknelson
This is an excellent idea and I will probably add it to my own site. Is there any way though to randomly pick the five images from the garage rather than the last five...so that different pictures will show on refresh or new visit to the page?
Don
|
Yep, not a problem.. do the above edits as posted, except when you get to the forum's index.php, use this code instead:
PHP Code:
// begin vbgarage hack
$result_latest = $DB_site->query("
SELECT * FROM " . TABLE_PREFIX . "vbgarage_images ORDER BY RAND() LIMIT 5
");
while ($latest = $DB_site->fetch_Array($result_latest))
{
eval('$latestbits .= "' . fetch_template('vbgarage_latestbits') . '";');
}
$DB_site->free_result($result_latest);
// end vbgarage hack
That should do it! If you want to increase the number shown (as the above example displays
5) simply edit the "LIMIT 5" statement to reflect the # you desire.
Happy hacking!