![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Jun 2001
Location: Sunny Land
Posts: 5,593
|
best very simple php banner rotator?
I need a very simple banner rotator to rotate some Iframe banners.. something that has almost load on the server, prefer something php non database run, flat file would be great, no stats needed..
anyone know of any? phpads is what I use now, but it's such a fucking resource hog I can't use it anymore.
__________________
Contact me: \\// E: webmaster /at/ unprofessional.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: Wisconsin
Posts: 4,517
|
ad.php:
<?php $ads = file('ads.txt'); echo $ads[array_rand($ads)]; ?> ads.txt would contain your iframe / banner html. One entry per line, no blank lines. ie: <iframe src="http://www.domain.com/iframe_1.html"...></iframe> <iframe src="http://www.domain.com/iframe_2.html"...></iframe> etc. Then just include it <?php include("ad.php"); ?> where you want it. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 | |
Confirmed User
Industry Role:
Join Date: Jun 2001
Location: Sunny Land
Posts: 5,593
|
Quote:
How often would it show each banner? An equal amount of times? Is there a simple way to assign % show weights to each?
__________________
Contact me: \\// E: webmaster /at/ unprofessional.com |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: Wisconsin
Posts: 4,517
|
That would just be completely random, no weighting. I'm not much of a programmer. Ok, I suck... but if you place an ad twice in your list, it would theoretically be twice as likely to be displayed :P
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 | |
Confirmed User
Industry Role:
Join Date: Jun 2001
Location: Sunny Land
Posts: 5,593
|
Quote:
Actually turns out the way the idiots that created my CMS did it, it won't parse a php include... guess I'm gonna have to try javascript instead.. I'll try your deal on my Wordpress site, shoudl work
__________________
Contact me: \\// E: webmaster /at/ unprofessional.com |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,229
|
try this
<? $array = array("http://www.domain.com/iframe_1.html","http://www.domain.com/iframe_2.html"); shuffle($array); echo "<iframe src='$array[0]'></iframe>"; ?>
__________________
Mechanical Bunny Media Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development |
![]() |
![]() ![]() ![]() ![]() ![]() |