![]() |
Referral Link Rotation
Does anybody know of a script that will rotate links? For example, user 1 clicks on a link and takes them to tour A. user 2 clicks the link and takes them to tour B.
Thanks for any and all help. |
wish i could help - i could use a good banner rotator myself.
|
its gotta be sorta like a banner rotater i guess. the only different is your clicking text and not image.
|
Just find one of the endless free ad rotators and modify it to output text links instead of IMG tags
|
Quote:
|
Do you need it to rotate text links? Or just the actually URL?
If its the actually URL a simple php OUT script can be coded |
heres a simple text or image banner rotation
Code:
<!----Main Banner Rotation-------- |
Quote:
|
the only part gfy screws up is one hahahaha..
just look in the code i posted above and find the hahahah it should be 2 equal signs next to each other like = = but right next to each other |
wait im not finished , copy all that code into a text document and save it as banner.js
then to use it all you have to do is call the js file like this <script language="javascript" src="http://yoursite.com/banners.js"></script> |
ok now to explain th script a bit it basically works like a timer.. on a 60 second clock..
It uses document write to make the banners ( you can use just text links or images or flash or whatever you want really. ) In the example it only rotates between 3 links , but if you wanted to add more you simply make another line and edit the seconds. Basically it gets the seconds of your time and if TIME is under 20 seconds it displays the first banner , if the time is over 20 but under 40 it displays the second banner , etc etc etc. So if you want to add another banner you need to edit the times of the other banners to.. You could also use this to run one banner 60% more than another by simply editing the gap of time it will be displayed on.. if your totally not understanding what i'm saying then.. drop your icq i'll explain it a bit better |
Here's a PHP solution that I use:
Put this in a separate file, add as many links as you'd like... and of course remember to escape all quotation marks within the link with a \. PHP Code:
And then put this code where you want to see the rotation. Where it says "links.php" , rename that to whatever you named the previous file. PHP Code:
|
Where it says "hahaha91" it should be a left bracket.
|
Quote:
|
As an alternative to Smokey's Time based one (Which is a hot idea btw) I would suggest reading/writing out via PHP to a file an integer with what was last shown
so set up an array 0,1,2,3 with the addresses to rotate echo "0" > file.txt the script: --------- read number from file, if ($readnum!=count($array)-1) { $current=$readnumber+1; } else { $current=0; } echo $array[$current] write $current to file However this breaks down under heavy traffic performance wise but ensures even distribution. I didn't include all code cause I'm eating lunch. |
All times are GMT -7. The time now is 12:44 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123