Post by zando on Aug 28, 2006 3:38:00 GMT -8
Alrighty, this code will create an option in every members profile. From this option they will be able to select a 'Mood', depending on the mood that they select a different picture will appear in their mini profile.
Now, here are some previews:
Editing Profile - Clickies
Mini Profile - Clickies
Well, here is the code:
Global Footers
Cross Browser: IE & FF
<script type="text/javascript">
<!--
/*Allow Memebers to select a Mood in their profile, by Zando*/
var zEmoVar=new Array();
//Edit These
zEmoVar[0]='<option value="s2.images.proboards.com/smiley.gif">Happy</option>';
zEmoVar[1]='<option value="s4.images.proboards.com/cheesy.gif">Cheesy</option>';
zEmoVar[2]='<option value="s2.images.proboards.com/angry.gif">Angry</option>';
zEmoVar[3]='<option value="s2.images.proboards.com/shocked.gif">Shocked</option>';
zEmoVar[4]='<option value="s2.images.proboards.com/huh.gif">Huh</option>';
zEmoVar[5]='<option value="s2.images.proboards.com/tongue.gif">Silly</option>';
zEmoVar[6]='<option value="s2.images.proboards.com/lipsrsealed.gif">Silent</option>';
zEmoVar[7]='<option value="s2.images.proboards.com/kiss.gif">Kiss</option>';
zEmoVar[8]='<option value="s2.images.proboards.com/laugh.gif">Laugh</option>';
zEmoVar[9]='<option value="s2.images.proboards.com/wink.gif">Wink</option>';
zEmoVar[10]='<option value="s2.images.proboards.com/grin.gif">Grin</option>';
zEmoVar[11]='<option value="s2.images.proboards.com/sad.gif">Sad</option>';
zEmoVar[12]='<option value="s2.images.proboards.com/cool.gif">Cool</option>';
zEmoVar[13]='<option value="s2.images.proboards.com/rolleyes.gif">Roll</option>';
zEmoVar[14]='<option value="s2.images.proboards.com/embarassed.gif">Blush</option>';
zEmoVar[15]='<option value="s2.images.proboards.com/undecided.gif">Unsure</option>';
zEmoVar[16]='<option value="s2.images.proboards.com/cry.gif">Cry</option>';
//Do not Edit below here
var tdz=document.getElementsByTagName("td")
var inp=document.getElementsByTagName("input")
var sel=document.getElementsByTagName("select")
var tbl=document.getElementsByTagName("table")
if(location.href.match(/modifyprofile/)){
document.write('<input name="zDataStore" type="hidden"></input>')
if(document.modifyForm.signature.innerHTML.match(/{=}(.+){\/=}/)){
var zle124=RegExp.$1
for(z=0;z<inp.length;z++){
if(inp[z].name.match(/zDataStore/)){
inp[z].value=zle124
document.modifyForm.signature.innerHTML=document.modifyForm.signature.innerHTML.replace(/{=}(.+){\/=}/, '');
}
}
}
for(z=0;z<tbl.length;z++){
if(tbl[z].width=="650" && tbl[z].rows[0].cells[0].innerHTML.match(/Gender:/)){
var zRow=tbl[z].insertRow(4);var zCell=zRow.insertCell(0);
var zCell2=zRow.insertCell(1);var zCell3=zRow.insertCell(2);
zCell.width="160";zCell.vAlign="top";
zCell.innerHTML='<font size="-1">Mood:</font>';
zCell2.width="245";zCell2.vAlign="top";
zCell2.innerHTML='<select name="zEmotion" onchange="zEmDis()"><option value="zNoEm">Emotion</option><option value="zNoEm">None</option>'+zEmoVar+'</select><b'+'r /><table><tr><td id="zEmDisCell"></td></tr></table>';zCell3.width="245";
zCell3.vAlign="top";
zCell3.innerHTML='<font size="-2">If you wish to have a mood emotion displayed in your profile, then you are able to select one of the provided emotions.</font>';
}
}
function zEmDis(){
for(z=0;z<tdz.length;z++){
if(tdz[z].id.match(/zEmDisCell/)){
for(a=0;a<sel.length;a++){
if(sel.name.match(/zEmotion/)){
tdz[z].innerHTML='<img src="'+sel.value+'">';
for(i=0;i<inp.length;i++){
if(inp.name.match(/zDataStore/)){
inp.value=sel.value
}
}
if(sel.value.match(/zNoEm/)){
tdz[z].innerHTML='';
}
}
}
}
}
}
for(a=0;a<inp.length;a++){
if(inp.name.match(/profileaction/) && inp.value.match(/Modify Profile/)){
inp.onclick=function(){
for(z=0;z<inp.length;z++){
if(inp[z].name.match(/zDataStore/) && !inp[z].value.match(/zNoEm/)){
document.modifyForm.signature.innerHTML+='{=}'+inp[z].value+'{\/=}';
};
}
}
}
}
}
for(z=0;z<tdz.length;z++){
if(tdz[z].width=="20%" && tdz[z].vAlign=="top" && tdz[z].className.match(/windowbg(2)?/) && tdz[z].innerHTML.match(/member is/) && tdz[z+1].innerHTML.match(/{=}(.+){\/=}/)){
var zzFFEEm=RegExp.$1
if(zzFFEEm!="zNoEm"){
tdz[z].innerHTML+='<b'+'r />Mood: <img src="'+zzFFEEm+'" />';
}
tdz[z+1].innerHTML=tdz[z+1].innerHTML.replace(/{=}(.+){\/=}/, '');
}
}
//-->
</script>
Currently this code will allow the member to select the default emotions as there mood. If you wish to change the mood images, then modify these lines:
zEmoVar[0]='<option value="Mood Url">Mood Name</option>';
Where the red is the url of the mood icon and the blue is the name of that mood.
If you wish to add more lines then simply just add more of these lines:
zEmoVar[17]='<option value="Mood Url">Mood Name</option>';
zEmoVar[18]='<option value="Mood Url">Mood Name</option>';
zEmoVar[19]='<option value="Mood Url">Mood Name</option>';
Note: If you are using Ross' & Peter's Money Hack v3, then please refer to this post to make the Mood Code and Money Hack compatiable.
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: =http://s2.images.proboards.com/smiley.gif=
Now, here are some previews:
Editing Profile - Clickies
Mini Profile - Clickies
Well, here is the code:
Global Footers
Cross Browser: IE & FF
<script type="text/javascript">
<!--
/*Allow Memebers to select a Mood in their profile, by Zando*/
var zEmoVar=new Array();
//Edit These
zEmoVar[0]='<option value="s2.images.proboards.com/smiley.gif">Happy</option>';
zEmoVar[1]='<option value="s4.images.proboards.com/cheesy.gif">Cheesy</option>';
zEmoVar[2]='<option value="s2.images.proboards.com/angry.gif">Angry</option>';
zEmoVar[3]='<option value="s2.images.proboards.com/shocked.gif">Shocked</option>';
zEmoVar[4]='<option value="s2.images.proboards.com/huh.gif">Huh</option>';
zEmoVar[5]='<option value="s2.images.proboards.com/tongue.gif">Silly</option>';
zEmoVar[6]='<option value="s2.images.proboards.com/lipsrsealed.gif">Silent</option>';
zEmoVar[7]='<option value="s2.images.proboards.com/kiss.gif">Kiss</option>';
zEmoVar[8]='<option value="s2.images.proboards.com/laugh.gif">Laugh</option>';
zEmoVar[9]='<option value="s2.images.proboards.com/wink.gif">Wink</option>';
zEmoVar[10]='<option value="s2.images.proboards.com/grin.gif">Grin</option>';
zEmoVar[11]='<option value="s2.images.proboards.com/sad.gif">Sad</option>';
zEmoVar[12]='<option value="s2.images.proboards.com/cool.gif">Cool</option>';
zEmoVar[13]='<option value="s2.images.proboards.com/rolleyes.gif">Roll</option>';
zEmoVar[14]='<option value="s2.images.proboards.com/embarassed.gif">Blush</option>';
zEmoVar[15]='<option value="s2.images.proboards.com/undecided.gif">Unsure</option>';
zEmoVar[16]='<option value="s2.images.proboards.com/cry.gif">Cry</option>';
//Do not Edit below here
var tdz=document.getElementsByTagName("td")
var inp=document.getElementsByTagName("input")
var sel=document.getElementsByTagName("select")
var tbl=document.getElementsByTagName("table")
if(location.href.match(/modifyprofile/)){
document.write('<input name="zDataStore" type="hidden"></input>')
if(document.modifyForm.signature.innerHTML.match(/{=}(.+){\/=}/)){
var zle124=RegExp.$1
for(z=0;z<inp.length;z++){
if(inp[z].name.match(/zDataStore/)){
inp[z].value=zle124
document.modifyForm.signature.innerHTML=document.modifyForm.signature.innerHTML.replace(/{=}(.+){\/=}/, '');
}
}
}
for(z=0;z<tbl.length;z++){
if(tbl[z].width=="650" && tbl[z].rows[0].cells[0].innerHTML.match(/Gender:/)){
var zRow=tbl[z].insertRow(4);var zCell=zRow.insertCell(0);
var zCell2=zRow.insertCell(1);var zCell3=zRow.insertCell(2);
zCell.width="160";zCell.vAlign="top";
zCell.innerHTML='<font size="-1">Mood:</font>';
zCell2.width="245";zCell2.vAlign="top";
zCell2.innerHTML='<select name="zEmotion" onchange="zEmDis()"><option value="zNoEm">Emotion</option><option value="zNoEm">None</option>'+zEmoVar+'</select><b'+'r /><table><tr><td id="zEmDisCell"></td></tr></table>';zCell3.width="245";
zCell3.vAlign="top";
zCell3.innerHTML='<font size="-2">If you wish to have a mood emotion displayed in your profile, then you are able to select one of the provided emotions.</font>';
}
}
function zEmDis(){
for(z=0;z<tdz.length;z++){
if(tdz[z].id.match(/zEmDisCell/)){
for(a=0;a<sel.length;a++){
if(sel.name.match(/zEmotion/)){
tdz[z].innerHTML='<img src="'+sel.value+'">';
for(i=0;i<inp.length;i++){
if(inp.name.match(/zDataStore/)){
inp.value=sel.value
}
}
if(sel.value.match(/zNoEm/)){
tdz[z].innerHTML='';
}
}
}
}
}
}
for(a=0;a<inp.length;a++){
if(inp.name.match(/profileaction/) && inp.value.match(/Modify Profile/)){
inp.onclick=function(){
for(z=0;z<inp.length;z++){
if(inp[z].name.match(/zDataStore/) && !inp[z].value.match(/zNoEm/)){
document.modifyForm.signature.innerHTML+='{=}'+inp[z].value+'{\/=}';
};
}
}
}
}
}
for(z=0;z<tdz.length;z++){
if(tdz[z].width=="20%" && tdz[z].vAlign=="top" && tdz[z].className.match(/windowbg(2)?/) && tdz[z].innerHTML.match(/member is/) && tdz[z+1].innerHTML.match(/{=}(.+){\/=}/)){
var zzFFEEm=RegExp.$1
if(zzFFEEm!="zNoEm"){
tdz[z].innerHTML+='<b'+'r />Mood: <img src="'+zzFFEEm+'" />';
}
tdz[z+1].innerHTML=tdz[z+1].innerHTML.replace(/{=}(.+){\/=}/, '');
}
}
//-->
</script>
Currently this code will allow the member to select the default emotions as there mood. If you wish to change the mood images, then modify these lines:
zEmoVar[0]='<option value="Mood Url">Mood Name</option>';
Where the red is the url of the mood icon and the blue is the name of that mood.
If you wish to add more lines then simply just add more of these lines:
zEmoVar[17]='<option value="Mood Url">Mood Name</option>';
zEmoVar[18]='<option value="Mood Url">Mood Name</option>';
zEmoVar[19]='<option value="Mood Url">Mood Name</option>';
Note: If you are using Ross' & Peter's Money Hack v3, then please refer to this post to make the Mood Code and Money Hack compatiable.
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: =http://s2.images.proboards.com/smiley.gif=