I tried this edit to set up two banners. My entire site crashed when I made this change. I uploaded the previous global.php and all is well. I did it twice to see if I missed something. Same effect.
Also, when I place the banner on the left or center there is a blank gap below the banner. When I put it on the right there is no gap and less wasted forum space.
Any thoguhts?
Great hack by the way!!!
The is the error I get
Database error in vBulletin 3.0.6:
Invalid SQL: SELECT title, html, url, type, status, width, height FROM banners WHERE status = '1' AND adid != ORDER BY RAND() LIMIT 1
mysql error: You have an error in your SQL syntax near 'ORDER BY RAND() LIMIT 1' at line 1
mysql error number: 1064
Date: Saturday 05th of March 2005 11:33:41 PM
Script:
http://www.my-site.com/forum/
Referer:
Username: My name
IP Address: my ip
Quote:
@PAWS - 1. Install the Update which I attached as txt file at this thread
2. Do this:
In your forumroot/global.php
Look for the whole code you've put in your global.php and REPLACE it with
PHP Code:
// Start banner rotating by Anhtuancool
if ($vboptions['enbanners'])
{
// select random banner and display it
$getbanner = $DB_site->query_first("SELECT title, html, url, type, status, width, height FROM " . TABLE_PREFIX . "banners WHERE status = '1' ORDER BY RAND() LIMIT 1");
eval('$banner = "' . fetch_template('banner') . '";');
$avoidid = $getbanner['adid'];
unset($getbanner);
// select random banner and display it secplace
$getbanner = $DB_site->query_first("SELECT title, html, url, type, status, width, height FROM " . TABLE_PREFIX . "banners WHERE status = '1' AND adid != $avoidid ORDER BY RAND() LIMIT 1");
eval('$banner2 = "' . fetch_template('banner') . '";');
unset($getbanner);
}
// End banner
Save, and place $banner2 in the footer or wherever you want your second banner slot to show up.