vForums Support :: Programming & Coding :: Code Requests & Support :: [F] MP Background problem - View Topic
 |  |
| Nick Very Senior Member
    
![[Avatar]](http://uploads.vforums.co.uk/forums/support/f_5e7b1402b305d883af97446b2fedc6c2_1-eog.jpeg) Posts: 3,013 Status: Offline Gender: Male Location: vForums Age: 35 Joined:
pmwww | [F] MP Background problem (17th Feb 08 at 4:41am UTC) | | The code below is supposed to show a picture in the mini profile background but it isn't, what is the problem?
 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>
http://freunion.vforums.co.uk/action/view_profile
Thanks, Darkmage | |
| Michael Moderator
    
![[Avatar]](http://av.wservices.co.uk/av.png) Recoding the future Posts: 4,043 Status: Offline Gender: Male Location: UK Joined:
Additional Groups: Coding Team
  
pmvForum | Re: MP Background problem (17th Feb 08 at 12:33pm UTC) | | try this:
 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')[1];
- BgImg= (d.innerHTML.match(/\[vf_mp:(.+?)\]/))?RegExp.$1:'';
- x[i].style.backgroundImage = 'url("'+BgImg+'")';
- }}}
- </script>
| |
| Nick Very Senior Member
    
![[Avatar]](http://uploads.vforums.co.uk/forums/support/f_5e7b1402b305d883af97446b2fedc6c2_1-eog.jpeg) Posts: 3,013 Status: Offline Gender: Male Location: vForums Age: 35 Joined:
pmwww | Re: MP Background problem (17th Feb 08 at 7:10pm UTC) | | Ok thanks Wrighty, it works. | |
| Michael Moderator
    
![[Avatar]](http://av.wservices.co.uk/av.png) Recoding the future Posts: 4,043 Status: Offline Gender: Male Location: UK Joined:
Additional Groups: Coding Team
  
pmvForum | Re: MP Background problem (17th Feb 08 at 7:37pm UTC) | | | |
| |
 |  |
|