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.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 03-02-2005, 07:11 PM   #1
spamofon
Confirmed User
 
Join Date: Jun 2003
Location: Toronto
Posts: 2,999
A simple PHP script for rotatin(random) banner with url

anyone has anything like that

just want to rotate different banners on page, anyone have any simple php script to do that?

thanks
spamofon is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2005, 07:12 PM   #2
Vell
So Fucking Banned
 
Join Date: Sep 2003
Posts: 170
phpadsnew - not 'simple' but the best there is
Vell is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2005, 07:14 PM   #3
Yug
Confirmed User
 
Join Date: Dec 2002
Location: Brisbane, Australia
Posts: 218
Quote:
Originally Posted by Vell
phpadsnew - not 'simple' but the best there is
__________________
YugSTAR.com
The online cartoon about the adult internet industry
Yug is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2005, 07:26 PM   #4
spamofon
Confirmed User
 
Join Date: Jun 2003
Location: Toronto
Posts: 2,999
Quote:
Originally Posted by Vell
phpadsnew - not 'simple' but the best there is

where can i get that?
spamofon is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2005, 08:13 PM   #5
spamofon
Confirmed User
 
Join Date: Jun 2003
Location: Toronto
Posts: 2,999
does that mean google it?
spamofon is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2005, 09:37 PM   #6
azguy
Confirmed User
 
Join Date: Nov 2004
Location: Scottsdale, AZ
Posts: 5,167
Just create an array with the links and their banner filename, shuffle it, and use the first item.
azguy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2005, 09:40 PM   #7
MrIzzz
If u touch it, I will cum
 
Join Date: Sep 2003
Location: long island
Posts: 22,923
i'm in the process of installing phpadsnew now and it fucking rocks. amazing features in there but it takes alot of tinkering
__________________


WHO WANTS TO PLAY GRAB-ASS?
MrIzzz is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2005, 10:10 PM   #8
HowlingWulf
Confirmed User
 
HowlingWulf's Avatar
 
Join Date: Nov 2001
Posts: 1,662
Your subject says random, which is easier than incremental rotate, so here you go.

<?php
$ban = array();
array_push($ban,"HTML CODE1");
array_push($ban,"HTML CODE2");
array_push($ban,"HTML CODE3");
srand ((double)microtime()*1000000);
$randomnum = rand(0, count($ban)-1);
echo $ban[$randomnum];
?>
__________________
WP Porn directory/review theme Maddos $35.

webmaster AT howling-wulf.com
HowlingWulf is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2005, 10:23 PM   #9
eadweb
Confirmed User
 
Join Date: Aug 2002
Location: Canada
Posts: 196
I create a files called banner1.php, banner2.php... etc. 1 for each banner spot and then call them with a php include statment.

<?php

srand((double)microtime()*1000000);
switch (rand (1,5)) {

case 1: ?>

<a href=http://www.YourSponsor.com/ target=_blank>
<img src=/banners/YourBanner.gif width=468 height=80 border=0 alt="Click Here!"></a>

<? break;
case 2: ?>

<a href="http://www.YourSponsor.com/" target="_blank">
<img src="/banners/YourBanner.gif" width=468 height=60 border=0 alt="Click Here!"><br>
<font face="Arial,Helvetica" size="3">Visit The Webs Largest Sex Personals Site... Join For Free!</font></a>

<? break;
case 3: ?>

<a href=http://www.YourSponsor.com/ target=_blank>
<img src=/banners/YourBanner.gif width=468 height=80 border=0 alt="Click Here!"></a>

<? break;
case 4: ?>

<a href="http://www.YourSponsor.com/" target="_blank">
<img src="/banners/YourBanner.gif" width=468 height=60 border=0 alt="Click Here!"><br>
<font face="Arial,Helvetica" size="3">Visit The Webs Largest Sex Personals Site... Join For Free!</font></a>

<? break;
case 5: ?>

<a href="http://www.YourSponsor.com/" target="_blank">
<img src="/banners/YourBanner.gif" width=468 height=60 border=0 alt="Click Here!"><br>
<font face="Arial,Helvetica" size="3">Visit The Webs Largest Sex Personals Site... Join For Free!</font></a>

<? break; } ?>
__________________
I don't need no stinking sig.
eadweb is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2005, 10:26 PM   #10
Lycanthrope
Confirmed User
 
Lycanthrope's Avatar
 
Industry Role:
Join Date: Jan 2004
Location: Wisconsin
Posts: 4,517
banners.php (include this)

<?
$delim = "\n";
$cryfile = "banners.txt";
$fp = fopen($cryfile, "r");
$contents = fread($fp, filesize($cryfile));
$cry_arr = explode($delim,$contents);
fclose($fp);
srand((double)microtime()*1000000);
$cry_index = (rand(1, sizeof($cry_arr)) - 1);
$herecry = $cry_arr[$cry_index];
echo $herecry;
?>

banners.txt
<a href="url1.com"><img border="0" src="image1.gif"></a>
<a href="url2.com"><img border="0" src="image2.gif"></a>
<a href="url3.com"><img border="0" src="image3.gif"></a>
more here 1 per line
__________________
Lycanthrope is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2005, 10:38 PM   #11
rickholio
Confirmed User
 
Industry Role:
Join Date: Jan 2004
Location: Nor'easterland
Posts: 1,914
Yikes... there's some helluva inefficient ways being proferred here. Just goes to show that there's 100 ways to do something on a computer I suppose.

Here's an alternative that allows you to attach a separate banner with a URL, simple maintenance by adjusting array elements. Easily adapted to keeping image/URL pairs in a database.
Code:
<?
// Change the banner/URL mappings as you so desire.
$b = array(
  'banner1.jpg' => 'http://target.url1',
  'banner2.jpg' => 'http://target.url2',
  'banner3.jpg' => 'http://target.url3'
);

// If you'd rather use mysql:
// $q = mysql_query("select img, url from whatever_table order by rand() limit 1");
// $r = mysql_fetch_assoc($q);
// $img = $r[img]; $url = $r[url];

$img = array_rand($b);  // The easy way to pull a random element from an array ;)
$url = $b[$img];
print "<A HREF='$url'><IMG SRC='$img' BORDER=0></A>";
?>
HTH. HAND.

Last edited by rickholio; 03-02-2005 at 10:39 PM.. Reason: PS: Your sig STILL kinda freaks me out.
rickholio is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2005, 10:49 PM   #12
Doc911
Confirmed User
 
Join Date: Feb 2004
Location: If i was up your ass you'd know
Posts: 3,695
I can write that script with a simple admin panel to add or remove the banners for 20 bucks icq me at 161480555
__________________


For PHP/MySQL scripts ICQ 161480555 or email [email protected]
Doc911 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.