Monday, March 10 2003 @ 06:14 PM EST
Contributed by: anonymous
Views: 2,441
I needed a method to get some banners going on one of my sites, so I tried http://www.phpadsnew.com/ which is a VERY robust system. Alas, it seemed to cause severe peformance issues at my host so I ditched it. Instead a buddy of mine came up with this cute little ditty. Feel free to expand on it.
In fact, you should since it doesn't use GL functions in any way and the DB stuff should NOT be the template code. It is currently installed at http://www.dctriclub.com Right now all it does is display the image and update the table to record how many times the image was seen. Improvements might include:
count the number of times some clicks the ad
hack a little interface to administer it for turning ads on/off, uploading files
use bars like the Poll result bars to show privileged people (advertisers?) how many times the ad was seen/clicked on
Here's the link to the code http://www.northredoubt.org/glbannerhack.txt Create the DB as described at the bottom. Then insert some values to point to an image you have uploaded. Finally, paste the following code block into header.thtml or into a php block (create a custom function in lib-custom.php).