Version: 1.00, by Scott MacVicar
Developer Last Online: Mar 2016
Version: 2.2.x
Rating:
Released: 05-25-2002
Last Update: Never
Installs: 47
No support by the author.
This is a script to allow you to manage the adverts on your forums, you can have any sort of advert you can imagine there is no actual limit with this hack to what it can be, javascript, flash, image, text and images.
You add adverts to a category or a forum or the whole board. If the category has child forums they will inherit the adverts as well as their own adverts if they have any.
Adverts can have a set exposure such as 10,000 views and once it has reached that it will stop.
It fills a variable called $advert which you just place in any template, such as the header, you can also use variables and replacements within the adverts, such as $bbuserinfo[userid] for the persons userid in a link within an advert.
Updated June 9th at 19:44 GMT
Added date limits and options for unlimited exposures.
To upgrade from an older version, reapply code in global.php, upload ads.php and run this sql query to alter the ads table you made.
[sql]ALTER TABLE `ads` ADD `time` INT(10) DEFAULT '0' NOT NULL;[/sql]
[sql]ALTER TABLE `ads` ADD `wholeforum` SMALLINT(1) DEFAULT '0' NOT NULL;[/sql]
If you already run that query though are still experiencing problems with the time always being January 1st run
New features include showing the advert on the entire forum by using a radio button, some highlighting in the admin panel, italic name indicates the time period has ended and a bold name means the advert has met its quota for exposures.
You must chance RAND() to RAND(NOW()) if you have mysql 3.23.52 or above
Scott
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
heheh for some reason i cant get the ads to view after upgrade, i reinstall the hack becoz of the problem moving thread , now move thread works but the banner didnt show at all
if(isset($advert_forumid)) {
$foruminfo = getforuminfo($advert_forumid);
$advert=$DB_site->query_first("SELECT * FROM ads WHERE LOCATE(CONCAT(',',forumid,','),',$foruminfo[parentlist],')>0 AND time>=".time()." AND (exposed<=exposures OR exposures=0) ORDER BY RAND()");
} else {
$advert=$DB_site->query_first("SELECT * FROM ads WHERE LOCATE(CONCAT(',',forumid,','),',-1,')>0 AND time>=".time()." AND (exposed<=exposures OR exposures=0) ORDER BY RAND()");
}
to
PHP Code:
if(isset($advert_forumid)) {
$foruminfo = getforuminfo($advert_forumid);
$advert=$DB_site->query_first("SELECT * FROM ads WHERE LOCATE(CONCAT(',',forumid,','),',$foruminfo[parentlist],')>0 AND (exposed<=exposures OR exposures=0) ORDER BY RAND()");
} else {
$advert=$DB_site->query_first("SELECT * FROM ads WHERE LOCATE(CONCAT(',',forumid,','),',-1,')>0 AND (exposed<=exposures OR exposures=0) ORDER BY RAND()");
}
This will disable the time length function until i get it sorted.
Im having major problems working out what it is, its actually quite puzzling.
Stealthy if you update the code in global.php then time isn't taken into account. Have you set correct zones in the admin panel and the banner isn't all exposed. It can be 0 or a value.
Sorry. I've been working the "day" job. I am running PHP Version v4.1.2 and MySQL Version v3.23.43 on a Linux box.
What is really weird about all of this is that the date showed up correctly when I first created the banner. So it would have in the date line today's date and all would be fine. Then after 0001 came around on the next day the date would get reset to January 1st, 2002. If I deleted the banner and reinstalled it the date would still default to the January 1st, 2002 date. Now if I got out of the admin panel completely then reinstalled the banner the date would be fine until the next date came up and again the $advert would be wrong and the banners don't get displayed.
I know you are working on this and I see no reason why it isn't working either and getting reset instead of staying. I just commented out those lines of code referring to the date and all works as it should.
I am glad to see that others are having issues with this too instead of it being just me screwing something up again.