vForums Support Banner


Visit Base Classics - Gaming Chairs

 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Code Requests & Support :: [F] REQUEST :Ross: Current skin in MP - 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] REQUEST :Ross: Current skin in MP (23rd Jan 08 at 2:56pm UTC)
Hey Ross, since we have Multiple skins now, can you convert your "Current skin in Mini Profile" code:

Code:
 
  1. <script type="text/javascript">
  2. <!--
  3. /* current skin in miniprofile - ross */
  4. var re = /\[ss:(.+?)\]/;
  5. if(document.modifyForm) {
  6. document.modifyForm.personaltext.value = document.modifyForm.personaltext.value.replace(re,'');
  7. document.modifyForm.onsubmit = function() {
  8. var ss = document.modifyForm.skin.options[document.modifyForm.skin.selectedIndex].innerHTML;
  9. document.modifyForm.personaltext.value += '[ss:'+ ss +']';
  10. return true;
  11. }
  12. }
  13. var td = document.getElementsByTagName('td');
  14. for(i=0; i<td.length; i++) {
  15. if(td.item(i).width == '20%' && td.item(i).innerHTML.match(re)) {
  16. var skin = '<br />Skin: '+RegExp.$1;
  17. td.item(i).innerHTML = td.item(i).innerHTML.replace(re,'') + skin;
  18. }
  19. }
  20. //-->
  21. </script>
 


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: REQUEST :Ross: Current skin in MP (23rd Jan 08 at 6:07pm UTC)
I'll see if I have time to do this later tonight for you when I get back! {Smile}
Nick
Very Senior Member
*****

[Avatar]

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


pmwww
Re: REQUEST :Ross: Current skin in MP (23rd Jan 08 at 8:08pm UTC)
I was mainly asking for Ross But ok. Thanks.
Michael
Moderator
*****

[Avatar]
Recoding the future

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

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: REQUEST :Ross: Current skin in MP (23rd Jan 08 at 9:11pm UTC)
Does it matter if I do it? {Unsure}
Nick
Very Senior Member
*****

[Avatar]

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


pmwww
Re: REQUEST :Ross: Current skin in MP (23rd Jan 08 at 10:50pm UTC)
no it dont matter, thats why I said
 
I was mainly asking for Ross But ok. Thanks.
Michael
Moderator
*****

[Avatar]
Recoding the future

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

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: REQUEST :Ross: Current skin in MP (23rd Jan 08 at 11:01pm UTC)
Global Footer

Also, allows you to change what the text before the skin says: Currently it's set to 'Skin:'

No need to edit anything else... automatically adds it to the profile too so long as they have modified their profile since the code was added.

Code:
 
  1. <script>
  2. /*Current Skin
  3. Created By Wrighty
  4. support.virtualforums.co.uk*/
  5.  
  6. var pref = 'Skin: ';
  7.  
  8. //======================DO NOT EDIT========================
  9. function load(){
  10.     f.hidden.value = f.hidden.value.replace(/{cur_skin:(.+?)}/g,'');
  11. }
  12. function save(){
  13.     f.hidden.value = "{cur_skin:"+ f.skin.options[f.skin.selectedIndex].innerHTML+"}" + f.hidden.value;
  14. }
  15.  
  16. if(document.profile_form && document.profile_form.signature){
  17.     var f=document.profile_form;
  18.     f.hidden.value = f.hidden.value.replace(/{cur_skin:(.+?)}/g,'');
  19.     if(document.addEventListener){
  20.         f.addEventListener('submit', save,false);
  21.     }else{
  22.         f.attachEvent('onsubmit', save);
  23.     }
  24. }
  25.  
  26. if(location.href.match(/\/view/i)){
  27.     cur_skin = (document.getElementById('hidden_vars').innerHTML.match(/{cur_skin:(.+?)}/))?RegExp.$1:'';
  28.     var d = document.getElementsByTagName('td');
  29.     for(i=0; i<d.length;i++){
  30.         if(d[i].className.match(/window(1|2)/) && d[i].innerHTML.match(/posts/i) && !d[i].innerHTML.match(/Date Registered/) && cur_skin!=''){
  31.             d[i].getElementsByTagName('font')[0].innerHTML+= '<br>'+pref + cur_skin;
  32.         }
  33.     }
  34. }
  35. </script>
 
Nick
Very Senior Member
*****

[Avatar]

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


pmwww
Re: REQUEST :Ross: Current skin in MP (24th Jan 08 at 1:23am UTC)
Thanks wrighty
Michael
Moderator
*****

[Avatar]
Recoding the future

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

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: REQUEST :Ross: Current skin in MP (24th Jan 08 at 7:47am UTC)
Welcome
 Printable View

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