vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Code Requests & Support :: [F] MP Background problem - View Topic
Topic Rating: *****
Printable View
Nick
Very Senior Member
*****

[Avatar]

Posts: 3,013
Status: Offline
Gender: Male
Location: vForums
Age: 35
Joined:  
Reputation: 62%  


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:
 
  1. <script>
  2. /*Mini Profile BG Image
  3. Created By Wrighty
  4. support.virtualforums.co.uk*/
  5.  
  6. if(document.profile_form && document.profile_form.hidden){
  7. var f  = document.profile_form;
  8. r = f.avatar_height.parentNode.parentNode.parentNode.parentNode.insertRow(16);
  9. r.insertCell(0).innerHTML = '<font size=2>Mini-Profile Bg:</font>';
  10. r.insertCell(1).innerHTML = '<input type="text" size="25" name="vf_mp">';
  11. r.insertCell(2).innerHTML = '<font size=1>Enter a URL to the image you want to use as the background for your miniprofile.</font>';
  12. f.vf_mp.value=(f.hidden.value.match(/\[vf_mp:(.+?)\]/))?RegExp.$1:'';
  13. f.hidden.value = f.hidden.value.replace(/\[vf_mp:(.+?)\]/,'');
  14. function save(){
  15. if(!f.vf_mp.value == "" ){
  16. f.hidden.value = '[vf_mp:'+f.vf_mp.value+']' +f.hidden.value;
  17. }}
  18. if(document.addEventListener){
  19. f.addEventListener('submit', save,false);
  20. }else{
  21. f.attachEvent('onsubmit', save);
  22. }}
  23. if(location.href.match(/view/)) {
  24. var x=document.getElementsByTagName('td');
  25. for(i=0;i<x.length;i++){
  26. if(x[i].width=="20%"){
  27. var d = x[i].getElementsByTagName('span')[0];
  28. BgImg= (d.innerHTML.match(/\[vf_mp:(.+?)\]/))?RegExp.$1:'';
  29. x[i].style.backgroundImage = 'url("'+BgImg+'")';
  30. }}}
  31. </script>
 


http://freunion.vforums.co.uk/action/view_profile

Thanks,
Darkmage
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: MP Background problem (17th Feb 08 at 12:33pm UTC)
try this:

Code:
 
  1. <script>
  2. /*Mini Profile BG Image
  3. Created By Wrighty
  4. support.virtualforums.co.uk*/
  5.  
  6. if(document.profile_form && document.profile_form.hidden){
  7. var f  = document.profile_form;
  8. r = f.avatar_height.parentNode.parentNode.parentNode.parentNode.insertRow(16);
  9. r.insertCell(0).innerHTML = '<font size=2>Mini-Profile Bg:</font>';
  10. r.insertCell(1).innerHTML = '<input type="text" size="25" name="vf_mp">';
  11. r.insertCell(2).innerHTML = '<font size=1>Enter a URL to the image you want to use as the background for your miniprofile.</font>';
  12. f.vf_mp.value=(f.hidden.value.match(/\[vf_mp:(.+?)\]/))?RegExp.$1:'';
  13. f.hidden.value = f.hidden.value.replace(/\[vf_mp:(.+?)\]/,'');
  14. function save(){
  15. if(!f.vf_mp.value == "" ){
  16. f.hidden.value = '[vf_mp:'+f.vf_mp.value+']' +f.hidden.value;
  17. }}
  18. if(document.addEventListener){
  19. f.addEventListener('submit', save,false);
  20. }else{
  21. f.attachEvent('onsubmit', save);
  22. }}
  23. if(location.href.match(/view/)) {
  24. var x=document.getElementsByTagName('td');
  25. for(i=0;i<x.length;i++){
  26. if(x[i].width=="20%"){
  27. var d = x[i].getElementsByTagName('span')[1];
  28. BgImg= (d.innerHTML.match(/\[vf_mp:(.+?)\]/))?RegExp.$1:'';
  29. x[i].style.backgroundImage = 'url("'+BgImg+'")';
  30. }}}
  31. </script>
 
Nick
Very Senior Member
*****

[Avatar]

Posts: 3,013
Status: Offline
Gender: Male
Location: vForums
Age: 35
Joined:  
Reputation: 62%  


pmwww
Re: MP Background problem (17th Feb 08 at 7:10pm UTC)
Ok thanks Wrighty, it works.
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: MP Background problem (17th Feb 08 at 7:37pm UTC)
{Grin}
 Printable View

All times are GMT+0 :: The current time is 10:21am
Page generated in 0.2814 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums