Post by Melody [MelloLily] on Nov 14, 2012 13:59:40 GMT -8
Is someone able to convert this to work with version 5? What the code does is allow users to place a linked image in their profile so that an image can appear in the mini profile behind the avatar and text.
This is the code that I have for my site. To see what it does, go to my profile and look at how there is an image behind the avatar/text. Thanks for any help that can be provided!
This is the code that I have for my site. To see what it does, go to my profile and look at how there is an image behind the avatar/text. Thanks for any help that can be provided!
<script type="text/javascript">
<!--
//Profile Editable MiniProfile Background - DregondRahl
// Do not repost or ajust copyright
if(document.modifyForm && document.modifyForm.signature){
Form = document.modifyForm;
AH = Form.avatarheight.parentNode.parentNode.parentNode;
MpTr = AH.parentNode.insertRow(1);
MpTr.insertCell(0).innerHTML = '<font size=2>MP BackGround</font>';
MpTr.insertCell(1).innerHTML = '<input type="text" size="35" name="mpbg">';
MpTr.insertCell(2).innerHTML = '<font size=1>Enter the URL Of the Background Image for the Mini Profile</font>';
if(Form.signature.value.match(/\[MpB:(.+?)\]/))
Form.mpbg.value=RegExp. $1;
Form.signature.value = Form.signature.value.replace(/\[MpB:(.+?)\]/,'');
function doBg(){
if(!Form.mpbg.value == "" ){
BgImage = Form.mpbg.value;
Form.signature.value = '[MpB:'+BgImage+']' +Form.signature.value;
}
}
if(document.addEventListener){
Form.profileaction[0].addEventListener('click',doBg,false);
} else {
Form.profileaction[0].attachEvent('onclick',doBg);
}
}
if(location.href.match(/ion=((pm|calendar)?view|display)/)) {
var td = document.getElementsByTagName("td");
for(t=0; t<td.length; t++) {
if((td[t].colSpan == '2' || td[t].colSpan == '3') && td[t].innerHTML.match(/\[MpB:(.+?)\]/)){
BgImg = (RegExp.$1.replace(/ /g,''))
td[t].innerHTML= td[t].innerHTML.replace(/\[MpB:(.+?)\]/,' ');
var obj = td[t].parentNode;
while(!obj.nodeName.match(/^td$/i)) {
obj = obj.parentNode;
}
obj.previousSibling.style.backgroundImage = 'url("'+BgImg+'")';
}
}
}
//-->
</script>