vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Code Requests & Support :: Music In Profile Convert Please - View Topic
Topic Rating: *****
Printable View
dog199200
Guest
Music In Profile Convert Please (8th Apr 09 at 7:52am UTC)
would someone mind please converting this code for me, i'm not good at converting from proboards to vforums...

Code:
 
  1. <script type="text/javascript">
  2. <!--
  3. /*
  4.         Personal Music in Profile
  5.         Concept by FireIndy
  6.         Recreated by Triad for v4.5
  7.         http://support.proboards.com
  8. */
  9.  
  10. var hide = true; // Set true to hide the media.
  11. var loop = false; // Set true to loop the media forever.
  12.  
  13. if(location.href.match(/on=(displ|search2|viewpr|pmv|(user)?rece|cal\w+iew)/)){
  14.     var td = document.getElementsByTagName("td");
  15.     for(x=6; x<td.length; x++){
  16.         if(td[x].width == "20%" && td[x].innerHTML.match(/(\[music:(.+?)\])/i)){
  17.             var d = RegExp.$2;
  18.             td[x].innerHTML = td[x].innerHTML.replace(RegExp.$1, "");
  19.             if(location.href.match(/on=viewprofile/i)){
  20.                 var e = "<div style='text-align: center;'><embed src='"+d.replace(/\s/gi, '')+"' ";
  21.                 if(hide) e += "hidden='true' ";
  22.                 e += "autostart='true' loop='"+loop+"' /></div>";
  23.                 document.write(e);
  24.                 break;
  25.             }
  26.         }
  27.     }
  28. }
  29. if(document.modifyForm){
  30.     var tb = document.getElementsByTagName("table");
  31.     for(a=4; a<tb.length; a++){
  32.         if(tb[a].width == "650" && tb[a].innerHTML.match(/location:/i)){
  33.             var _input = document.createElement("input");
  34.                 _input.type = "text";
  35.                 _input.size = "35";
  36.                 _input.id = "music";
  37.                 if(document.modifyForm.personaltext.value.match(/(\[music:(.+?)\])/i)){
  38.                     _input.value = RegExp.$2;
  39.                     document.modifyForm.personaltext.value = document.modifyForm.personaltext.value.replace(RegExp.$1, "");
  40.                 }
  41.             var font_1 = document.createElement("font");
  42.                 font_1.size = "2";
  43.                 font_1.appendChild(document.createTextNode("Profile Music:"));
  44.             var font_2 = document.createElement("font");
  45.                 font_2.size= "1"
  46.                 font_2.appendChild(document.createTextNode("If you wish to have music played on your main profile page, enter the URL here."));
  47.             var _row = tb[a].insertRow(tb[a].rows.length);
  48.             var _cell = _row.insertCell(0);
  49.                 _cell.width = "160";
  50.                 _cell.appendChild(font_1);
  51.             _cell = _row.insertCell(1);
  52.                 _cell.width = "245";
  53.                 _cell.appendChild(_input);
  54.             _cell = _row.insertCell(2);
  55.                 _cell.width = "245";
  56.             _cell.appendChild(font_2);
  57.  
  58.             function addMusic(){
  59.                 var p = document.modifyForm.personaltext;
  60.                 if(document.getElementById("music").value.length > 0){
  61.                     p.maxLength = p.value.length + document.getElementById("music").value.length + 8;
  62.                     p.value += "[music:" + document.getElementById('music').value + "]";
  63.                 } else if(p.value.match(/(\[music:.+?\])/i)){
  64.                     p.value = p.value.replace(RegExp.$1, "");
  65.                 }
  66.             }
  67.  
  68.             if(document.addEventListener)
  69.                 document.modifyForm.addEventListener("submit", addMusic, false);
  70.             else if(document.attachEvent)
  71.                 document.modifyForm.attachEvent("onsubmit", addMusic);
  72.             else
  73.                 document.modifyForm.onsubmit = addMusic;
  74.  
  75.             break;
  76.         }
  77.     }
  78. }
  79. //-->
  80. </script>
 


{Wink} also feel free to edit it so it works good even better with a vforums then it did on proboards {Tongue Out} also i'm open to all alternative methods of doing this, less coding the better on a forum
 Printable View

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