GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Anyone have a simple banner rotator script available? (https://gfy.com/showthread.php?t=656941)

clickhappy 09-18-2006 10:13 PM

Anyone have a simple banner rotator script available?
 
I found some online but theyre confusing.
Anyone have a simple one available?

also is it better to do it in javascript, or php?
I'm guessing javascript.

Ice 09-18-2006 10:15 PM

phpadsnew :thumbsup

http://phpadsnew.com/two/

calmlikeabomb 09-20-2006 09:26 AM

It's better to use PHP since it's server side. The javascript rotators do not work if the users browser doesn't support/enable javascripting.

I'll make you a custom one that does exactly what you need if you're interested. Contact me and we can talk about it.

Thanks,
Levi

[email protected]
aim/icq: 957-413

Monstaman 09-20-2006 09:30 AM

I would also be interested in a simple rotater ...

CDSmith 09-20-2006 01:27 PM

http://javascript.internet.com/misce...r-rotator.html

CDSmith 09-20-2006 01:34 PM

Here's a different one. Simple to customize it...

http://javascript.internet.com/misce...ng-banner.html

Lycanthrope 09-20-2006 02:10 PM

Not the cleanest most efficient code, but here

<?

$delim = "\n";
$cryfile = "random.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 . "\n";

?>

random.txt can contain any html.. complete on one line (no empty lines)

ie:

<a href="http://www.domain1.com"><img src="image1.jpg"></a>
<a href="http://www.domain2.com"><img src="image2.jpg"></a>
<a href="http://www.domain3.com"><img src="image3.jpg"></a>
<a href="http://www.domain4.com"><img src="image4.jpg"></a>
etc...

OG LennyT 09-20-2006 02:21 PM

Code:

<script language="Javascript">
<!--

var currentdate = 0;
var core = 0;

function initArray() {

this.length = initArray.arguments.length;
  for (var i = 0; i < this.length; i++) {
  this[i] = initArray.arguments[i];
  }
}

link = new initArray(
"http://yoururl.com/38666/pr/rev/1.html",
"http://yoururl.com/38666/pr/rev/2.html",
"http://yoururl.com/38666/pr/rev/3.html"
);

image = new initArray(
"http://domain.com/images/ls/pic1.gif",
"http://domain.com/images/ls/pic2.gif",
"http://domain.com/images/ls/pic3.jpg"
);

text = new initArray(
"description text for image 1",
"description text for image 2",
"description text for image 3"
);

var currentdate = new Date();
var core = currentdate.getSeconds() % image.length;
var ranlink  = link[core];
var ranimage = image[core];
var rantext  = text[core];

document.write('<a href=\"' +ranlink+ '\" target=\"_blank\"><img src=\"'+ranimage+'\" border="0" alt=\"'+rantext+'\"></a>');

//-->
</SCRIPT>

you can add more by simply copy/paste new lines where needed. :thumbsup

Monstaman 09-21-2006 12:52 AM

Thanks for your help ...

bobby666 09-21-2006 12:55 AM

i use the script of
http://www.javascript-page.com


All times are GMT -7. The time now is 05:15 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123