Post by ⓦ৹₪deⓡ on Sept 21, 2005 9:18:52 GMT -8
This code will automatically add a warning to every Post, Signature, and Mini-Profile that contains a link offsite. You can edit the warnings. If you don't want a particular warning to appear, change the warning to "". Enjoy.
~Wonder
~Wonder
<script>
//External Link Warnings v1.0
//Copyright 9-21-2005 ~Wonder
//May be reposted anywhere as long as this header remains in tact
//Put in Global Footer
//Put in the warnings for external links found in posts and signatures. You can use HTML;
//Posts Warning
linkWarningInPost="<center><b>Warning: This post contains external links. Click with caution.</b></center>";
//Signatures Warning
linkWarningInSignature="<center><b>Warning: This signature contains external links. Click with caution.</b></center>";
//Mini-Profile Warning
linkWarningInMiniProfile="<center><b>Warning: This profile contains external links. Click with caution.</b></center>";
if(location.href.match(/action=(display|goto|viewprofile|pmview|recent)/)){
td = document.getElementsByTagName("td");
server=location.href.split(".com")[0];
for(i = 0; i < td.length; i ++){
if(td.item(i).colSpan == "3" && td.item(i).firstChild && td.item(i).firstChild.nodeName.match(/^hr$/i))
{
a=td[i].getElementsByTagName("a");
for(j=0;j<a.length;j++)
{
if(!a[j].href.match(server) && !a[j].href.match(/mailto\:/))
{
tab=td[i].parentNode.parentNode.getElementsByTagName("td");
tab=tab[tab.length-3];
tab.innerHTML=linkWarningInPost+tab.innerHTML;break;
}
}
}
if (td[i].className.match("windowbg") && td[i].align=="left" && td[i].vAlign=="bottom" && td[i].lastChild.nodeName=="FONT")
{
a=td[i].getElementsByTagName("a");
for(j=0;j<a.length;j++)
{
if(!a[j].href.match(server) && !a[j].href.match(/mailto\:/))
{
td[i].innerHTML+=linkWarningInSignature;break;
}
}
}
if(td[i].width=="20%" && td[i].className.match(/windowbg/) && td[i].innerHTML.indexOf("Joined: ")!=-1)
{
a=td[i].getElementsByTagName("a");
for(j=0;j<a.length;j++){if(a[j].href.length>0 && !a[j].href.match(server) && !a[j].href.match(/mailto\:/)){td[i].innerHTML+=linkWarningInMiniProfile;break;}}
}
}
}
</script>
~modified Oct 5th, 2005 at 3:16pm to include a warning to other proboards sites and exclude board links