Many thanks for the very prompt reply djr33
The problem, I believe, with using the method provided is distinguishing between links to external sites and pages within my own site and I would like every link on my forum that links to Imagevenue, Imageshack and other image hosting sites to load the page with a frame at the top containing logo and html content.
With usercash.com the following needs to be inputted into the <head> or <body> of the site
Code:
<script>
var domain='mysite.com';
var uid='1259';
var what='1';
</script>
<script src="http://www.usercash.com/uc.js"></script>
I understand that var domain shall be mysite.com so links on my site do not load in a new page with frame at top.
var uid and var what are not required so they may be removed to give the following
Code:
<script>
var domain='mysite.com';
</script>
<script src="http://www.mysite.com/script.js"></script>
UC.js includes the following:
Code:
var url='http://usercash.com/go/'+what+'/'+uid+'/'+"";
var domains='skins.be,usercash,adultfriendfinder,imagecash,twistedblogs,****ster.blogspot.com,postyouramateur.com,noref.net,mediabux.com,crazywog.com,****enmeer.nl,pronny-king.be,uniquepeek.com,ebonyword.blogspot.com,top-blogs.com,rapidshare,pointzero.juicy****host.com,linkbux,imagegravy,adbrite,clicksor,'+domain+''+"";
function c(){var link=document.getElementsByTagName("A");try{var loc=(""+top.location.href).replace("http://","").replace("https://","").replace("www.","");}catch(e){var loc=(""+document.location.href).replace("http://","").replace("https://","").replace("www.","");}for(i=0;i<link.length;i++){domain_url=(""+link[i].href).replace(/^\s+/g,"").replace(/\s+$/g,"").replace("http://","").replace("https://","");if(d(link[i].href)&&(((" "+link[i].href).indexOf(loc)<=0||(" "+link[i].href).indexOf("http")<=0)||(" "+link[i].href).lastIndexOf("http:")>3)&&(" "+link[i].href).indexOf("script:")<=0&&(" "+link[i].href).indexOf("#")!=1&&(" "+link[i].href).indexOf("mailto:")<=0&&(" "+link[i].href).indexOf("file:")<=0&&(" "+link[i].href).indexOf("#exit")<=0&&!(!isNaN(parseInt(domain_url.substr(0,1)))&&(!isNaN(parseInt(domain_url.substr(0,2)))||domain_url.substr(0,2)=="."))){link[i].target="_blank";link[i].href=url+link[i]+"";}}}function d(url){if(""+domains!="undefined"&&domains!=""&&domains.replace(/\s/g,"")!=""&&url!=""){if((" "+domains).indexOf(",")>0){params_to_skip=domains.split(",");}else{params_to_skip=new Array(domains);}for(s=0;s<params_to_skip.length;s++){if((" "+url.toLowerCase()).indexOf(params_to_skip[s].toLowerCase())>0){return false;break;};}return true;}else{return true;}}if(""+window.onload==""||""+window.onload=="null"){window.onload=c;}else{var tout=window.setTimeout("c(); clearTimeout(tout)",4000);};
I have spent hours trying to modify the above code to no avail.
I changed
Code:
var url='http://usercash.com/go/'+what+'/'+uid+'/'+"";
to
Code:
var url='http://mysite.com/go/index.php'+'/'+"";
and uploaded the index.php to the go directory
Once I insert click a link on my site a new window loads with my php file loaded but the external site does not load beneath it.
I apologise if I am making basic errors as I am very new to javascript and have tried modifying the code for ages to no avail.
Many thanks in advance
Bookmarks