
Code:
- <script>
- /*Mini Profile BG Image
- Created By Wrighty
- support.virtualforums.co.uk*/
-
- if(document.profile_form && document.profile_form.hidden){
- var f = document.profile_form;
- r = f.avatar_height.parentNode.parentNode.parentNode.parentNode.insertRow(16);
- r.insertCell(0).innerHTML = '<font size=2>Mini-Profile Bg:</font>';
- r.insertCell(1).innerHTML = '<input type="text" size="25" name="vf_mp">';
- r.insertCell(2).innerHTML = '<font size=1>Enter a URL to the image you want to use as the background for your miniprofile.</font>';
- f.vf_mp.value=(f.hidden.value.match(/{vf_mp:(.+?)}/))?RegExp.$1:'';
- f.hidden.value = f.hidden.value.replace(/{vf_mp:(.+?)}/,'');
- function save(){
- if(!f.vf_mp.value == "" ){
- f.hidden.value = '{vf_mp:'+f.vf_mp.value+'}' +f.hidden.value;
- }}
- if(document.addEventListener){
- f.addEventListener('submit', save,false);
- }else{
- f.attachEvent('onsubmit', save);
- }}
- if(location.href.match(/view/)) {
- var x=document.getElementsByTagName('td');
- for(i=0;i<x.length;i++){
- if(x[i].width=="20%"){
- var d = x[i].getElementsByTagName('span')[0];
- BgImg= (d.innerHTML.match(/{vf_mp:(.+?)}/))?RegExp.$1:'';
- x[i].style.backgroundImage = 'url("'+BgImg+'")';
- }}}
- </script>