Post by ⓦ৹₪deⓡ on Sept 21, 2005 1:44:11 GMT -8
This code will add the option to remove images from signatures in the profile. However, it is cookie based so if the user clears their cookies, the option will go back to Yes, which display images. Also, the user does not have to submit their profile in order for the change to take effect. This is to prevent this code from conflicting with other codes that modify the profile. Enjoy.
~Wonder
~Wonder
<script>
//Add Option To Remove Images From Signatures v1.0
//Copyright 9-21-2005 ~Wonder
//May be reposted anywhere as long as this header remains in tact
//Place in Global Footer
if(location.href.match("action\=modifyprofile"))
{
yos=" SELECTED";nos="";
if(document.cookie.match(/sigimage\=off/)){nos=" SELECTED";yos="";}
tabs=document.getElementsByTagName("table");
for(i=0;i<tabs.length;i++)
{
if(tabs[i].innerHTML.match(/Show Images:/) && !tabs[i].innerHTML.match(/MSN:/))
{
temprow=tabs[i].insertRow(-1);
temp=temprow.insertCell(0);
temp.innerHTML="<font size=\"-1\">Show Images In Signatures:</font>";
temp.width=160;temp.valign="top";
temp=temprow.insertCell(1);
temp.innerHTML="<font size=\"-1\"><select name=\"sigImage\" onChange=setSigImageCookie(this.value)><option value=\"off\""+nos+">No</option><option value=\"on\""+yos+">Yes</option></select></font>";
temp.width=245;temp.valign="top";
temp=temprow.insertCell(2);
temp.innerHTML="<font size=\"-2\">If you do not wish to see the images in signatures on this forum, select \"No.\" You can always view the full signature in the member's profile.</font>";
temp.width=245;temp.valign="top";
break;
}
}
}
function setSigImageCookie(onoff)
{
document.cookie="sigimage="+onoff+"; expires=Monday, 04-Apr-2015 05:00:00 GMT";
}
if(document.cookie.match(/sigimage\=off/)){
td = document.getElementsByTagName("td");
for (i=0; i<td.length; i++)
{
if (td[i].className.match("windowbg") && td[i].align=="left" && td[i].vAlign=="bottom" && td[i].lastChild.nodeName=="FONT")
{
temp=td[i].lastChild.getElementsByTagName("img");
for(j=0;j<temp.length;j++){temp[j].style.display="none";}
}
}
}
</script>