vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Database of Codes/Hacks/Mods :: Mini Profile Background Image - View Topic
Topic Rating: *****
Printable View
Michael
Moderator
*****

[Avatar]
Recoding the future

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

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Mini Profile Background Image (31st Dec 07 at 1:04am UTC)
This will allow your users to add a background to their mini profile.

Global Footer

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>
 
Nick
Very Senior Member
*****

[Avatar]

Posts: 3,012
Status: Offline
Gender: Male
Location: vForums
Age: 33
Joined:  
Reputation: 62%  


pmwww
Re: Mini Profile Background Image (31st Dec 07 at 1:24am UTC)
For the second post, on my forum it does not show the background, but on my first post it shows.

Example:

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: Mini Profile Background Image (31st Dec 07 at 1:35am UTC)
Recopy the code! {Smile}
Nick
Very Senior Member
*****

[Avatar]

Posts: 3,012
Status: Offline
Gender: Male
Location: vForums
Age: 33
Joined:  
Reputation: 62%  


pmwww
Re: Mini Profile Background Image (31st Dec 07 at 1:44am UTC)
ok thanks ^_^

EDIT: Now its not working at all {Unsure}
http://ffnation.virtualforums.co.uk/action/view_profile/user/admin/
Michael
Moderator
*****

[Avatar]
Recoding the future

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

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Mini Profile Background Image (31st Dec 07 at 1:54am UTC)
recopy... hmm strange..

I just recopied from my forum.
Nick
Very Senior Member
*****

[Avatar]

Posts: 3,012
Status: Offline
Gender: Male
Location: vForums
Age: 33
Joined:  
Reputation: 62%  


pmwww
Re: Mini Profile Background Image (31st Dec 07 at 1:58am UTC)
{Unsure} Nope it still don't, and the image fully goes in.
Michael
Moderator
*****

[Avatar]
Recoding the future

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

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Mini Profile Background Image (31st Dec 07 at 2:03am UTC)
haha I win!

I beat the code! {Tongue Out}

I know why it was, I had it coded to work with the tabulated mini profile, it now works with both side mini profiles! {Smile}
Nick
Very Senior Member
*****

[Avatar]

Posts: 3,012
Status: Offline
Gender: Male
Location: vForums
Age: 33
Joined:  
Reputation: 62%  


pmwww
Re: Mini Profile Background Image (31st Dec 07 at 2:08am UTC)
ok thanks. Do I have to re copy?
Michael
Moderator
*****

[Avatar]
Recoding the future

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

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Mini Profile Background Image (31st Dec 07 at 2:09am UTC)
ya.. sorry
Nick
Very Senior Member
*****

[Avatar]

Posts: 3,012
Status: Offline
Gender: Male
Location: vForums
Age: 33
Joined:  
Reputation: 62%  


pmwww
Re: Mini Profile Background Image (31st Dec 07 at 2:12am UTC)
ok thanks ^_^
 Printable View

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