Post by CrAzY_J on Sept 15, 2005 19:30:29 GMT -8
Yeah i know this can be done with cross fury, but it was a code request so i made it just for the hell of it.
Description: A extra text field will appear in the user's "modify profile" page, in this newly added text field the user can choose to add their game name. If they do not wish to do this, they can just leave the field blank.
code placement: Global Footers
<script type='text/javascript'>
/* Currently playing in Profile
Code requested @ studiozero.proboards44.com
Request filled by CrAzY_J
Do no redistribute this code without the permission of CrAzY_J*/
if(location.href.match(/modifyprofile/)){
var gTab=document.body.getElementsByTagName("table");
for(t=0;t<gTab.length;t++){
if(gTab[t].cellSpacing=="2" && gTab[t].innerHTML.match(/Gender:/)){
var iRow=gTab[t].insertRow(1);
var iCell=iRow.insertCell(0);var iCell2=iRow.insertCell(1);var iCell3=iRow.insertCell(2);
iCell.innerHTML="<font size='2'>Currently playing:</font>"
iCell2.innerHTML="<input id='play' size='35'>";
iCell3.innerHTML="What game are you currently playing?";
if(document.modifyForm.personaltext.value.match(/plg%%(.+?)%%/))
document.getElementById('play').value=RegExp. $1;
document.modifyForm.onsubmit=function(){
if(!document.getElementById('play').value == "" ){
if(document.modifyForm.personaltext.value.match(/plg%%(.+?)%%/))
document.modifyForm.personaltext.value = document.modifyForm.personaltext.value.replace(RegExp.$1,document.getElementById("play").value);
else
document.modifyForm.personaltext.value+="plg%%"+document.getElementById("play").value+"%%";
}
}
}
}
}
if(location.href.match(/(view(profile)?|display)/)){
var TD=document.getElementsByTagName("td");
for(t=0;t<TD.length;t++){
if(TD[t].width=="20%" && TD[t].innerHTML.match(/plg%%(.+?)%%/)){
TD[t].innerHTML=TD[t].innerHTML.replace(/plg%%.+?%%/," Currently playing:"+RegExp.$1);
}
}
}
</script>
Note for When Removing this Code:
This code stores information in the "Personal Text" 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 personal text field until you or the user removes it. This information would look something like: plg%%http://yourhost.com/music.mp3%%/
Description: A extra text field will appear in the user's "modify profile" page, in this newly added text field the user can choose to add their game name. If they do not wish to do this, they can just leave the field blank.
code placement: Global Footers
<script type='text/javascript'>
/* Currently playing in Profile
Code requested @ studiozero.proboards44.com
Request filled by CrAzY_J
Do no redistribute this code without the permission of CrAzY_J*/
if(location.href.match(/modifyprofile/)){
var gTab=document.body.getElementsByTagName("table");
for(t=0;t<gTab.length;t++){
if(gTab[t].cellSpacing=="2" && gTab[t].innerHTML.match(/Gender:/)){
var iRow=gTab[t].insertRow(1);
var iCell=iRow.insertCell(0);var iCell2=iRow.insertCell(1);var iCell3=iRow.insertCell(2);
iCell.innerHTML="<font size='2'>Currently playing:</font>"
iCell2.innerHTML="<input id='play' size='35'>";
iCell3.innerHTML="What game are you currently playing?";
if(document.modifyForm.personaltext.value.match(/plg%%(.+?)%%/))
document.getElementById('play').value=RegExp. $1;
document.modifyForm.onsubmit=function(){
if(!document.getElementById('play').value == "" ){
if(document.modifyForm.personaltext.value.match(/plg%%(.+?)%%/))
document.modifyForm.personaltext.value = document.modifyForm.personaltext.value.replace(RegExp.$1,document.getElementById("play").value);
else
document.modifyForm.personaltext.value+="plg%%"+document.getElementById("play").value+"%%";
}
}
}
}
}
if(location.href.match(/(view(profile)?|display)/)){
var TD=document.getElementsByTagName("td");
for(t=0;t<TD.length;t++){
if(TD[t].width=="20%" && TD[t].innerHTML.match(/plg%%(.+?)%%/)){
TD[t].innerHTML=TD[t].innerHTML.replace(/plg%%.+?%%/," Currently playing:"+RegExp.$1);
}
}
}
</script>
Note for When Removing this Code:
This code stores information in the "Personal Text" 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 personal text field until you or the user removes it. This information would look something like: plg%%http://yourhost.com/music.mp3%%/