Code:
- <script type="text/javascript">
- <!--
- /*
- Personal Music in Profile
- Concept by FireIndy
- Recreated by Triad for v4.5
- http://support.proboards.com
- */
-
- var hide = true; // Set true to hide the media.
- var loop = false; // Set true to loop the media forever.
-
- if(location.href.match(/on=(displ|search2|viewpr|pmv|(user)?rece|cal\w+iew)/)){
- var td = document.getElementsByTagName("td");
- for(x=6; x<td.length; x++){
- if(td[x].width == "20%" && td[x].innerHTML.match(/(\[music:(.+?)\])/i)){
- var d = RegExp.$2;
- td[x].innerHTML = td[x].innerHTML.replace(RegExp.$1, "");
- if(location.href.match(/on=viewprofile/i)){
- var e = "<div style='text-align: center;'><embed src='"+d.replace(/\s/gi, '')+"' ";
- if(hide) e += "hidden='true' ";
- e += "autostart='true' loop='"+loop+"' /></div>";
- document.write(e);
- break;
- }
- }
- }
- }
- if(document.modifyForm){
- var tb = document.getElementsByTagName("table");
- for(a=4; a<tb.length; a++){
- if(tb[a].width == "650" && tb[a].innerHTML.match(/location:/i)){
- var _input = document.createElement("input");
- _input.type = "text";
- _input.size = "35";
- _input.id = "music";
- if(document.modifyForm.personaltext.value.match(/(\[music:(.+?)\])/i)){
- _input.value = RegExp.$2;
- document.modifyForm.personaltext.value = document.modifyForm.personaltext.value.replace(RegExp.$1, "");
- }
- var font_1 = document.createElement("font");
- font_1.size = "2";
- font_1.appendChild(document.createTextNode("Profile Music:"));
- var font_2 = document.createElement("font");
- font_2.size= "1"
- font_2.appendChild(document.createTextNode("If you wish to have music played on your main profile page, enter the URL here."));
- var _row = tb[a].insertRow(tb[a].rows.length);
- var _cell = _row.insertCell(0);
- _cell.width = "160";
- _cell.appendChild(font_1);
- _cell = _row.insertCell(1);
- _cell.width = "245";
- _cell.appendChild(_input);
- _cell = _row.insertCell(2);
- _cell.width = "245";
- _cell.appendChild(font_2);
-
- function addMusic(){
- var p = document.modifyForm.personaltext;
- if(document.getElementById("music").value.length > 0){
- p.maxLength = p.value.length + document.getElementById("music").value.length + 8;
- p.value += "[music:" + document.getElementById('music').value + "]";
- } else if(p.value.match(/(\[music:.+?\])/i)){
- p.value = p.value.replace(RegExp.$1, "");
- }
- }
-
- if(document.addEventListener)
- document.modifyForm.addEventListener("submit", addMusic, false);
- else if(document.attachEvent)
- document.modifyForm.attachEvent("onsubmit", addMusic);
- else
- document.modifyForm.onsubmit = addMusic;
-
- break;
- }
- }
- }
- //-->
- </script>