Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Useful Scripts for Affiliates [You Must Be Need]
#1
I found a old folder from way back when with some useful scripts. These are just scripts that i have found, i did write one of them though. If any are broken, just PM me and ill try to find a working script to replace it.

If i find other useful scripts, or someone wants to PM me with one they want to share I will update it here. 
Auto Re Size 
Code:
<script language="JavaScript" type="text/javascript">
var X = screen.width;
var Y = screen.height;
window.moveTo(0,0);
window.resizeTo(X,Y);
</script>


<html>
<head>
<meta http-equiv="refresh" content="0;url=http://yourafflinkhere">
</head>
<body>
<script language="JavaScript" type="text/javascript">
var X = screen.width;
var Y = screen.height;
window.moveTo(0,0);
window.resizeTo(X,Y);
document.location.href = 'http://yourafflinkhere";
</script>


Page Stuck? <a href="http://yourafflinkhere">Click Here!</a>
</body>
</html>
Dynamic Keywords In LP ( This One Is Setup for Prosper 202, but the idea will work with any tracking platform) 
Code:
<?


//grab t202 keyword
$keyword = $_GET['t202kw'];


//if a yahoo keyword exists, over-write the t202 keyword
//for Yahoo OVKEY = the bidded keyword, OVRAW = actual keyword
//you can change $_GET['OVRAW'] to $_GET['OVKEY'] if you would
//like to display the bidded keyword, instead of the actual keyword.
if ($_GET['OVKEY']) { $keyword = $_GET['OVKEY']; }  


//now anywhere we call echo $keyword, it will display the dynamic kw!


//extra goodie, uncomment the line below if you would like to capitalize
//the first character in each word
//$keyword = ucwords(strtolower($keyword));


?>




<html>
   <head>
       <!-- Display the Dynamic Keyword in the Title! -->
       <title><? echo $keyword; ?></title>
   </head>
   <body>
   
       <!-- Display the Dynamic Keyword in the body's content! -->
       This is the content on my landing page! You were searching for <? echo $keyword; ?>.
   
   </body>
</html>

[b]Intro Pop Up[/b]

Code:
<script
type='text/javascript'>alert('Congratulations! You have been selected
to win a free Playstation 3. Read below how to claim
it.');</script>
[b][b]Jscript Blinking Elements[/b][/b]

Code:
<html>

<head>
</head>


<body>


Not blinking<br>


<img name="blink" src="picture.jpg"> <br>


<span name="blink">Blinking Text</span>


</body>


<script type="text/javascript">
// Javascript element blinking script
// http://ilovethecode.com/Javascript/Javascript-Tutorials-How_To-Easy/Make_Text_Blink_Using_Javascript.shtml
// Note: this needs to be placed at the bottom of the page, AFTER the elements you want to blink.
spe=400;
NameOfYourTags="blink";
swi=1;
na=document.getElementsByName(NameOfYourTags);
bringBackBlinky();
function bringBackBlinky() {
       if (swi == 1) {
               sho="visible";
               swi=0;
       } else {
               sho="hidden";
               swi=1;
       }
       for(i=0;i<na.length;i++) {
               na[i].style.visibility=sho;
       }
       setTimeout("bringBackBlinky()", spe);
}
</script>


</html>

[b][b][b]Jscript Push Button - Pop Up [/b][/b][/b]
Upgraded JavaScript
Popup Window!Now that we have the tools, let's make a sophisticated
JavaScript popup window that we can be proud of!
HTML & JavaScript Code
Code:
<head>
<script type="text/javascript">
<!--
function myPopup2() {
window.open( "http://www.google.com/", "myWindow",
"status = 1, height = 300, width = 300, resizable = 0" )
}
//-->
</script>
</head>
<body>
<form>
<input type="button" onClick="myPopup2()" value="POP2!">
</form>
<p onClick="myPopup2()">CLICK ME TOO!</p>
</body>
Display:
CLICK ME TOO!
Now, that is a prime example of a worthless popup! When you make your
own, try to have them relate to your content, like a small popup with no
navigation that just gives the definition or explanation of a word,
sentence, or picture!

Jscript Cloak and redirect link 
Code:
<body>

<a href='http://google.com/' name='http://yahoo.com'>Visit
yahoo.com</a>


</body>


<script language="javascript">
_links = document.getElementsByTagName("a");
for(i=0;i<_links.length;i++) {
   if(_links[i].name) {
       docloak = function() {
           _cloak = this.href;
           this.href = this.name;
           this.innerHTML = _cloak;
       };        
       _links[i].oncontextmenu = docloak;                
       _links[i].onclick = function() {
           docloak();
           window.location = this.name;
           return false;
       };                        
       _tmp = _links[i].href;
       _links[i].href = _links[i].name;
       _links[i].name = _tmp;
   }
}
</script>












How it works: Make a link as usual. Add the “name=” attribute and set it
to whatever you want displayed in the status bar. The javascript code
at the bottom of the file does the rest. Make sure you put the
javascript code AFTER all of the links on the page. When the user hovers
over the link, he will see whatever you set in the name attribute. As
you can see, this technique allows you to control exactly what gets
displayed in the status bar. If javascript is disabled, the user will
see the real destination url, but that’s about the only downside.
[b]Jscript Day Month Year [/b]

PHP Code:
<?PHP$now = time();
echo 'TODAY: <BR>';
echo date('D M jS',$now);
?> 



<?php


$date 
date("Y-m-d"); // today's date
$date strtotime(date("Y-m-d"strtotime($date)) . " +1 month");
echo 
$date;


?> 






JavaScript Current Time Clock
Now, instead of displaying the date we, will display the format you 
might see on a typical digital clock -- HH:MM AM/PM (H = Hour, M = 
Minute).
HTML & JavaScript Code:
<h4>It is now  
<script type="text/javascript">
<!--
var currentTime = new Date()
var hours = currentTime.getHours()
var minutes = currentTime.getMinutes()
if (minutes < 10){
minutes = "0" + minutes
}
document.write(hours + ":" + minutes + " ")
if(hours > 11){
document.write("PM")
} else {
document.write("AM")
}
//-->
</script>
</h4>








Get the JavaScript Time
The Date object has been created, and now we have a variable that holds 
the current date! To get the information we need to print out, we have 
to utilize some or all of the following functions:
getTime() - Number of milliseconds since 1/1/1970 @ 12:00 AM 
getSeconds() - Number of seconds (0-59) 
getMinutes() - Number of minutes (0-59) 
getHours() - Number of hours (0-23) 
getDay() - Day of the week(0-6). 0 = Sunday, ... , 6 = Saturday 
getDate() - Day of the month (0-31) 
getMonth() - Number of month (0-11) 
getFullYear() - The four digit year (1970-9999) 
Now we can print out the date information. We will be using the getDate,
 getMonth, and getFullYear methods in this example.
HTML & JavaScript Code:
<h4>It is now  
<script type="text/javascript">
<!--
var currentTime = new Date()
var month = currentTime.getMonth() + 1
var day = currentTime.getDate()
var year = currentTime.getFullYear()
document.write(month + "/" + day + "/" + year)
//-->
</script>
</h4> 
[b][b]Jscript Redirect after X amount of time[/b][/b]

Code:
<scripttype="text/javascript">functionRedirect()
{  
window.location="http://www.newpage.com";
}
document.write("You will be redirected to a new page in 5 seconds");
setTimeout('Redirect()',5000);</script>
[b][b][b]Simple Landing Page Rotation Script[/b][/b][/b]

Code:
// The text file 'count.txt' must be created and stored
// in the same directory as this rotator script.
// Its permission must be set to 777 (CHMOD to 777).
$myFile = "count.txt";

// Open the txt file
$fh = @fopen($myFile, 'r');
$lpNumber = @fread($fh, 5);
@fclose($fh);

// See which landing page is next in line to be displayed
if ($lpNumber >= count($landingpage)) {
   $lpNumber = 1;
} else {
   $lpNumber = $lpNumber + 1;
}

// Write the last landing page displayed to the 'count.txt' file
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = $lpNumber . "\n";
fwrite($fh, $stringData);
fclose($fh);

// Redirect to the landing page
header('Location: ' . $landingpage[$lpNumber] . $kword );

// Terminate script
die();

?>
[b][b][b][b]Redirect Mobile Devices [/b][/b][/b][/b]

Code:
<script type="text/javascript">function RedirectSmartphone(url){
   if (url && url.length > 0 && IsSmartphone())
   window.location = url;
}
function IsSmartphone(){
   if (DetectUagent("android")) return true;
   else if (DetectUagent("iphone")) return true;
   else if (DetectUagent("ipod")) return true;
   else if (DetectUagent("symbian")) return true;
   return false;
}
function DetectUagent(name){
   var uagent = navigator.userAgent.toLowerCase();
   if (uagent.search(name) > -1)
   return true;
   else
   return false;
}
RedirectSmartphone("http://www.your-redirect-link.com");
</script>
 
Reply
  


Forum Jump:


Browsing: 1 Guest(s)