Post by Lucario The Stealth on Dec 30, 2008 14:17:41 GMT -5
I think this forum should have their own profile background music, its actually possible ;D:
Inserts a textbox in the modifyprofile page that allows a user to insert a music URL. So whenever a person visits their profile page, it plays music. Choice to hide or show the embed player. Also this used the signature area to store the data.
Global Footer
<script>
/*Created by FireIndy, do not repost or edit without permission*/
var hide = "true"; //hide embed - true or false
function add_Music() {
var musU = "[PMusic: "+ document.getElementById('prof_mus').value +"]";
if(document.modifyForm.signature.value.match(/\[PMusic:\s(.+?)\]/gi)){
if(document.getElementById('prof_mus').value.length > 0){
document.modifyForm.signature.value = document.modifyForm.signature.value.replace(/\[PMusic:\s(.+?)\]/gi,musU);
}
}else if(document.getElementById('prof_mus').value.length > 0){
document.modifyForm.signature.value += "\n" + musU
}
}
if(document.modifyForm){
tabs=document.getElementsByTagName("table");
for(i=0;i<tabs.length;i++){
if(tabs.innerHTML.match(/Show Images:/) && !tabs.innerHTML.match(/MSN:/)){
row=tabs.insertRow(-1);
cell=row.insertCell(0);
cell.innerHTML = "<font size=\"2\">Profile Music:</font>";
seccel = row.insertCell(1);
var check = document.modifyForm.signature.value.match(/\[PMusic:\s(.+?)\]/i)? RegExp.$1 : ''
seccel.innerHTML = "<input type=\"text\" id=\"prof_mus\" value=\""+check+"\">";
if(document.modifyForm.signature.value.match(/\[PMusic:\s(.+?)\]/gi)){
document.modifyForm.signature.value = document.modifyForm.signature.value.replace(/\[PMusic:\s(.+?)\]/gi,'');
}
thcel = row.insertCell(2);
thcel.innerHTML = "<font size=\"1\">Enter the <b>direct</b> link to the music you would like to played in your profile. </font>";
}
}
if(document.attachEvent)
document.modifyForm.attachEvent('onsubmit', add_Music);
else
document.modifyForm.addEventListener('submit', add_Music, false);
}
if(location.href.match(/viewprofile/i)){
var TD=document.getElementsByTagName("td");
for(t=0;t<TD.length;t++){
if( TD[t].innerHTML.match(/\[PMusic:\s(.+?)\]/gi)){
var newU = TD[t].innerHTML.match(/\[PMusic:\s<a href="(.+?)" (.+?)>(.+?)<\/a>\]/gi)? RegExp.$1 : '';
TD[t].innerHTML = TD[t].innerHTML.replace(/\[PMusic:\s(.+?)\]/gi, '');
}
}
if(newU.length > 0 ){
document.write("<center><embed src='"+newU+"' autostart='true' AllowScriptAccess='never' hidden='"+hide+"'></embed></center>");
}
}else if(!location.href.match(/(viewprofile|modifyprofile|headersfooters)/i)){
var newT = document.getElementsByTagName("td");
for(s=0;s<newT.length;s++){
if(newT.innerHTML.match(/\[PMusic:\s(.+?)\]/gi)){
newT.innerHTML = newT.innerHTML.replace(/\[PMusic:\s(.+?)\]/gi,'');
}
}
}
</script>
Note for When Removing this Code:
This code stores information in the "Siganture" field of the users profile. If at some point you decide to remove this code or for whatever reason the code stops working then that information will remain visible in the signature until you or the user removes it. This information would look something like: [PMusic:http://yourhost.com/music.mp3]
Inserts a textbox in the modifyprofile page that allows a user to insert a music URL. So whenever a person visits their profile page, it plays music. Choice to hide or show the embed player. Also this used the signature area to store the data.
Global Footer
<script>
/*Created by FireIndy, do not repost or edit without permission*/
var hide = "true"; //hide embed - true or false
function add_Music() {
var musU = "[PMusic: "+ document.getElementById('prof_mus').value +"]";
if(document.modifyForm.signature.value.match(/\[PMusic:\s(.+?)\]/gi)){
if(document.getElementById('prof_mus').value.length > 0){
document.modifyForm.signature.value = document.modifyForm.signature.value.replace(/\[PMusic:\s(.+?)\]/gi,musU);
}
}else if(document.getElementById('prof_mus').value.length > 0){
document.modifyForm.signature.value += "\n" + musU
}
}
if(document.modifyForm){
tabs=document.getElementsByTagName("table");
for(i=0;i<tabs.length;i++){
if(tabs.innerHTML.match(/Show Images:/) && !tabs.innerHTML.match(/MSN:/)){
row=tabs.insertRow(-1);
cell=row.insertCell(0);
cell.innerHTML = "<font size=\"2\">Profile Music:</font>";
seccel = row.insertCell(1);
var check = document.modifyForm.signature.value.match(/\[PMusic:\s(.+?)\]/i)? RegExp.$1 : ''
seccel.innerHTML = "<input type=\"text\" id=\"prof_mus\" value=\""+check+"\">";
if(document.modifyForm.signature.value.match(/\[PMusic:\s(.+?)\]/gi)){
document.modifyForm.signature.value = document.modifyForm.signature.value.replace(/\[PMusic:\s(.+?)\]/gi,'');
}
thcel = row.insertCell(2);
thcel.innerHTML = "<font size=\"1\">Enter the <b>direct</b> link to the music you would like to played in your profile. </font>";
}
}
if(document.attachEvent)
document.modifyForm.attachEvent('onsubmit', add_Music);
else
document.modifyForm.addEventListener('submit', add_Music, false);
}
if(location.href.match(/viewprofile/i)){
var TD=document.getElementsByTagName("td");
for(t=0;t<TD.length;t++){
if( TD[t].innerHTML.match(/\[PMusic:\s(.+?)\]/gi)){
var newU = TD[t].innerHTML.match(/\[PMusic:\s<a href="(.+?)" (.+?)>(.+?)<\/a>\]/gi)? RegExp.$1 : '';
TD[t].innerHTML = TD[t].innerHTML.replace(/\[PMusic:\s(.+?)\]/gi, '');
}
}
if(newU.length > 0 ){
document.write("<center><embed src='"+newU+"' autostart='true' AllowScriptAccess='never' hidden='"+hide+"'></embed></center>");
}
}else if(!location.href.match(/(viewprofile|modifyprofile|headersfooters)/i)){
var newT = document.getElementsByTagName("td");
for(s=0;s<newT.length;s++){
if(newT
newT
}
}
}
</script>
Note for When Removing this Code:
This code stores information in the "Siganture" field of the users profile. If at some point you decide to remove this code or for whatever reason the code stops working then that information will remain visible in the signature until you or the user removes it. This information would look something like: [PMusic:http://yourhost.com/music.mp3]