View Single Post
Old 11-19-2008, 04:06 PM  
whatif_3
Registered User
 
Join Date: Jul 2004
Location: Canada
Posts: 459
Quote:
Originally Posted by donborno View Post
Actually I wrote something similar in JavaScript some time ago, here you go:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<title>Amazing MGP</title>
	<script type="text/javascript">
	function change_referral_code(old_code, new_code) {
		// fetch all links
		var links = document.getElementsByTagName('a');

		for (var i = 0; i < links.length; i++) {
			alert(links[i].href);
			links[i].href = links[i].href.replace(new RegExp(old_code), new_code);
		}
	}

	function change_all_referrals() {
		// If there is no referrer
		if ((document.referrer == null) || (document.referrer == "")) {
			change_referral_code('revid=11111', 'revid=22222');
			// ... add some more for other sponsors
		}
	}
	</script>
</head>
<body 
	<h1>Amazing MGP</h1>

	<p>Here are some galleries for you:</p>
	<ul>
		<li><a href="http://www.pinkvisualhdgalleries.com/asp/008/01/vid?campaign=0&revid=11111&s=1">Gallery 1</a></li>
		<li><a href="http://www.pinkvisualhdgalleries.com/asp/010/01/vid?campaign=0&revid=11111&s=1">Gallery 2</a></li>
		<li><a href="http://www.pinkvisualhdgalleries.com/asp/020/01/vid?campaign=0&revid=11111&s=1">Gallery 3</a></li>
		<li><a href="http://www.pinkvisualhdgalleries.com/asp/028/01/vid?campaign=0&revid=11111&s=1">Gallery 4</a></li>
		<li><a href="http://www.pinkvisualhdgalleries.com/asp/030/01/vid?campaign=0&revid=11111&s=1">Gallery 5</a></li>
	</ul>
</body>
</html>
Didn't test it in real life
thank you very much for helping, you are very kind to take the time out of your day to assist, its appreciated
whatif_3 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote