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)
-   -   iframe rotator script? (https://gfy.com/showthread.php?t=870250)

Spudman 11-19-2008 09:26 AM

iframe rotator script?
 
hey,

does anyone know of a script i can use to rotate varius iframes?

thanks :)

Warlock77 11-19-2008 09:43 AM

Try this

Code:

<script language="JavaScript">
<!--
var r_text = new Array ();
r_text[0] = "IFRAMECODE1";
r_text[1] = "IFRAMECODE2";
r_text[2] = "IFRAMECODE3";
r_text[3] = "IFRAMECODE4";
r_text[4] = "IFRAMECODE5";
r_text[5] = "IFRAMECODE6";
r_text[6] = "IFRAMECODE7";
var i = Math.floor(7*Math.random())

document.write(r_text[i]);

//-->
</script>


Spudman 11-19-2008 11:06 AM

hey warlock,

that script doesn't work for me.

anyone got any others?

thanks

troncarver 11-19-2008 11:38 AM

Code:


<script language="javascript"><!--
ad=new Array(2);
ad[0]='<a target=_blank href=""><img src="" / border="0"></a>';
ad[1]='<a target=_blank href=""><img src="" / border="0"></a>';
var ran_num=Math.floor(Math.random()*ad.length);
document.write(ad[ran_num]);
//--></script>


Spudman 11-19-2008 12:02 PM

Quote:

Originally Posted by troncarver (Post 15077559)
Code:


<script language="javascript"><!--
ad=new Array(2);
ad[0]='<a target=_blank href=""><img src="" / border="0"></a>';
ad[1]='<a target=_blank href=""><img src="" / border="0"></a>';
var ran_num=Math.floor(Math.random()*ad.length);
document.write(ad[ran_num]);
//--></script>


isn't that just a banner rotation script? i dont think that will work :2 cents:

I need to be able to rotate iframes so i can rotate dating and webcam iframes, any help appreciated.

dready 11-19-2008 12:03 PM

OpenX might be overkill, but it does a great job.

aico 11-19-2008 12:11 PM

any random text script and a .shtml page should world. Good luck with the Cache though.

Rorschach 11-19-2008 12:18 PM

Put your iframe code in various text files, eg. 1.html -> 6.html. Include the entire iframe code from opening iframe tag to the closing tag.

Put this code where you want to place your rotating iframe:

<?php

$max = 6;

$i = mt_rand(1, $max);

include("$i.html");

?>

You can change the value of $max depending on how many iframe text files you have.

grumpy 11-19-2008 12:30 PM

Quote:

Originally Posted by aico (Post 15077713)
any random text script and a .shtml page should world. Good luck with the Cache though.

easy, nocache in the metatags

Spudman 11-19-2008 12:54 PM

Quote:

Originally Posted by Rorschach (Post 15077737)
Put your iframe code in various text files, eg. 1.html -> 6.html. Include the entire iframe code from opening iframe tag to the closing tag.

Put this code where you want to place your rotating iframe:

<?php

$max = 6;

$i = mt_rand(1, $max);

include("$i.html");

?>

You can change the value of $max depending on how many iframe text files you have.

does this work in a .shtml page? can't get it to work.

Rorschach 11-19-2008 01:00 PM

It's php, you need to use it a .php page or enable php parsing in .html or .shtml pages via your .htaccess file.

Spudman 11-19-2008 01:22 PM

Quote:

Originally Posted by Rorschach (Post 15077938)
It's php, you need to use it a .php page or enable php parsing in .html or .shtml pages via your .htaccess file.

thanks,

8char

Spudman 11-19-2008 02:17 PM

bump for any more ideas/scripts, haven;t got any of the above to work.

peeperpimp 11-19-2008 03:12 PM

I'd like to see one of these codes mentioned above running live on a site, any url's ?

Spudman 11-20-2008 02:40 AM

going to bump this for some help :)

mikeyddddd 11-20-2008 03:34 AM

Here's a page I just made that includes iframes from PussyCash and also has javascripts for different sponsor's peel ads.

Your htaccess should be set up to allow the file extension you use for the page to parse, for ex.

AddHandler server-parsed .htm
AddHandler server-parsed .html

The spudman page has this:

<!--#include virtual="/path to the rotate script/rotate-iframe.php" -->

The script has this:

<?php

$max = 7;

$i = mt_rand(0, $max);

include("iframe-$i.txt");

?>

each of the text files (0-7) has something like this:

<script src="http://fb.cashtraffic.com/pa.php/freelifetimeamateurs/1.jpg/13318/40.js"></script>
<iframe src="http://pcash.imlive.com/releaseSE/activepage198.asp?WID=123475591185&linkID=1036&got opage=hostlist.asp&trdlvlcbid=1&promocode=BCODE8AF A78EC_00000&textcolor=FFFFFF&bgcolor=000033" scrolling="No" marginwidth=0 marginheight=0 align="MIDDLE" width="500" height="210" frameborder="No"></iframe>


In this example, the script and text files are in the same directory to simplify things.




Edit:
Refresh the page to see the ads change.

mikeyddddd 11-20-2008 04:00 AM

The text files are named:

iframe-0.txt
iframe-1.txt
iframe-2.txt
iframe-3.txt
iframe-4.txt
iframe-5.txt
iframe-6.txt
iframe-7.txt

fris 11-20-2008 09:29 AM

if you are doing it on a wordpress blog, i have a solution that will work


All times are GMT -7. The time now is 04:33 AM.

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