Post by Peter on Jul 12, 2004 23:13:44 GMT
This will work in IE and Mozilla :)
If you have any other codes that change the profile or mini profile, they might conflict with each other.
This code will show the drop down mood list in the edit profile page. It will show the mood selected in the view profile page, mini profile in PM, Calendar, and with the extra code below, it will show in the mini profile :)
Previews:
The code:
This first big code must go into your MAIN footer
<script type="text/javascript">
<!--
/*
Copyright © 2003 - 2004 SolidSnakeDesigns.com
All Rights Reserved
This code may not be redistributed without express permission from the creator.
This header must stay intact at all times.
*/
var iMoods = [
"Happy","Cheerful","Euphoric","Joyful","Blissful","Content","Glad",
"Sad","Gloomy","Heavyhearted","Melancholic","Depressive",
"Angry","Furious","Wild","Raging","Aggravated","Mad","Huffy"
]
var re = /(curMood\[(.+?)\])/
var curMood = "No Mood Set";
var txt = document.createTextNode("Mood: ");
var iFont = document.createElement("font");
iFont.size = "2";
iFont.style.fontWeight = "bold";
iFont.appendChild(txt);
function renSelect(){
var sel = document.createElement("select")
sel.id = "moods";
var iTable = document.getElementsByTagName("table");
for(t=0;t<iTable.length;t++){
with(iTable[t]){
if(width=="100%" && cellPadding=="3" && rows[0].cells[0].innerHTML.match(/Gender:/i)){
var mRow = iTable[t].insertRow(1);
var mCell = mRow.insertCell(0);
mCell.appendChild(iFont);
mCell = mRow.insertCell(1);
mCell.appendChild(sel);
}
}
}
for(m=0;m<iMoods.length;m++){
sel.options[0] = new Option("","");
sel.options[0].selected = true;
sel.options[sel.options.length] = new Option(iMoods[m],iMoods[m]);
}
}
function compileUT(){
curMood = document.getElementById("moods").value;
var re = /(curMood\[.+?\])/
if(curMood){
with(document.creator){
if(usertext.value.match(re)){
usertext.value = usertext.value.replace(RegExp.$,"curMood[" + curMood + "]");
} else if(!usertext.value.match(re)){
usertext.value += "curMood[" + curMood + "]"
}
}
}
}
function whichSelected(){
if(document.creator.usertext.value.match(re)){
document.getElementById("moods").value = RegExp.$2;
document.creator.usertext.value = document.creator.usertext.value.replace(RegExp.$1,"");
}
}
function viewProfile(){
var iCell = document.getElementsByTagName("td");
for(c=0;c<iCell.length;c++){
with(iCell[c]){
if(width=="30%" && vAlign=="middle" && innerHTML.match(re)){
curMood = RegExp.$2;
innerHTML = innerHTML.replace(RegExp.$1,"");
}
}
}
var vTable = document.getElementsByTagName("table");
for(v=0;v<vTable.length;v++){
with(vTable[v]){
if(width=="100%" && cellPadding=="2" && rows[0].cells[0].innerHTML.match(/b>Name: <\//i)){
var vRow = vTable[v].insertRow(13);
var vCell = vRow.insertCell(0);
vCell.appendChild(iFont);
vCell = vRow.insertCell(1);
vCell.innerHTML = curMood;
}
}
}
}
function mainMiniPro(){
var iCell = document.getElementsByTagName("td");
for(c=0;c<iCell.length;c++){
with(iCell[c]){
if(width=="20%" && className.match(/windowbg/i) && rowSpan=="2" && innerHTML.match(re)){
innerHTML += "<center>Mood: " + RegExp.$2 + "</center>";
innerHTML = innerHTML.replace(RegExp.$1,"");
}
}
}
}
if(location.href.match(/=profile&username=/i)){
renSelect();
document.creator.onsubmit = compileUT;
window.onload = whichSelected;
}
if(location.href.match(/(viewprofile|profile2)/)){
viewProfile();
}
if(location.href.match(/(calendarview|imshow)/)){
mainMiniPro();
}
//-->
</script>
And this needs to go into ALL BOARD footers
<script type="text/javascript">
<!--
function miniPro(){
var re = /(curMood\[(.+?)\])/
var iCell = document.getElementsByTagName("td");
for(c=0;c<iCell.length;c++){
with(iCell[c]){
if(width=="20%" && className.match(/windowbg/i) && rowSpan=="2" && innerHTML.match(re)){
innerHTML += "<center>Mood: " + RegExp.$2 + "</center>";
innerHTML = innerHTML.replace(RegExp.$1,"");
}
}
}
}
if(location.href.match(/=display/)){
miniPro();
}
//-->
</script>
#nosmileys
If you have any other codes that change the profile or mini profile, they might conflict with each other.
This code will show the drop down mood list in the edit profile page. It will show the mood selected in the view profile page, mini profile in PM, Calendar, and with the extra code below, it will show in the mini profile :)
Previews:
The code:
This first big code must go into your MAIN footer
<script type="text/javascript">
<!--
/*
Copyright © 2003 - 2004 SolidSnakeDesigns.com
All Rights Reserved
This code may not be redistributed without express permission from the creator.
This header must stay intact at all times.
*/
var iMoods = [
"Happy","Cheerful","Euphoric","Joyful","Blissful","Content","Glad",
"Sad","Gloomy","Heavyhearted","Melancholic","Depressive",
"Angry","Furious","Wild","Raging","Aggravated","Mad","Huffy"
]
var re = /(curMood\[(.+?)\])/
var curMood = "No Mood Set";
var txt = document.createTextNode("Mood: ");
var iFont = document.createElement("font");
iFont.size = "2";
iFont.style.fontWeight = "bold";
iFont.appendChild(txt);
function renSelect(){
var sel = document.createElement("select")
sel.id = "moods";
var iTable = document.getElementsByTagName("table");
for(t=0;t<iTable.length;t++){
with(iTable[t]){
if(width=="100%" && cellPadding=="3" && rows[0].cells[0].innerHTML.match(/Gender:/i)){
var mRow = iTable[t].insertRow(1);
var mCell = mRow.insertCell(0);
mCell.appendChild(iFont);
mCell = mRow.insertCell(1);
mCell.appendChild(sel);
}
}
}
for(m=0;m<iMoods.length;m++){
sel.options[0] = new Option("","");
sel.options[0].selected = true;
sel.options[sel.options.length] = new Option(iMoods[m],iMoods[m]);
}
}
function compileUT(){
curMood = document.getElementById("moods").value;
var re = /(curMood\[.+?\])/
if(curMood){
with(document.creator){
if(usertext.value.match(re)){
usertext.value = usertext.value.replace(RegExp.$,"curMood[" + curMood + "]");
} else if(!usertext.value.match(re)){
usertext.value += "curMood[" + curMood + "]"
}
}
}
}
function whichSelected(){
if(document.creator.usertext.value.match(re)){
document.getElementById("moods").value = RegExp.$2;
document.creator.usertext.value = document.creator.usertext.value.replace(RegExp.$1,"");
}
}
function viewProfile(){
var iCell = document.getElementsByTagName("td");
for(c=0;c<iCell.length;c++){
with(iCell[c]){
if(width=="30%" && vAlign=="middle" && innerHTML.match(re)){
curMood = RegExp.$2;
innerHTML = innerHTML.replace(RegExp.$1,"");
}
}
}
var vTable = document.getElementsByTagName("table");
for(v=0;v<vTable.length;v++){
with(vTable[v]){
if(width=="100%" && cellPadding=="2" && rows[0].cells[0].innerHTML.match(/b>Name: <\//i)){
var vRow = vTable[v].insertRow(13);
var vCell = vRow.insertCell(0);
vCell.appendChild(iFont);
vCell = vRow.insertCell(1);
vCell.innerHTML = curMood;
}
}
}
}
function mainMiniPro(){
var iCell = document.getElementsByTagName("td");
for(c=0;c<iCell.length;c++){
with(iCell[c]){
if(width=="20%" && className.match(/windowbg/i) && rowSpan=="2" && innerHTML.match(re)){
innerHTML += "<center>Mood: " + RegExp.$2 + "</center>";
innerHTML = innerHTML.replace(RegExp.$1,"");
}
}
}
}
if(location.href.match(/=profile&username=/i)){
renSelect();
document.creator.onsubmit = compileUT;
window.onload = whichSelected;
}
if(location.href.match(/(viewprofile|profile2)/)){
viewProfile();
}
if(location.href.match(/(calendarview|imshow)/)){
mainMiniPro();
}
//-->
</script>
And this needs to go into ALL BOARD footers
<script type="text/javascript">
<!--
function miniPro(){
var re = /(curMood\[(.+?)\])/
var iCell = document.getElementsByTagName("td");
for(c=0;c<iCell.length;c++){
with(iCell[c]){
if(width=="20%" && className.match(/windowbg/i) && rowSpan=="2" && innerHTML.match(re)){
innerHTML += "<center>Mood: " + RegExp.$2 + "</center>";
innerHTML = innerHTML.replace(RegExp.$1,"");
}
}
}
}
if(location.href.match(/=display/)){
miniPro();
}
//-->
</script>
#nosmileys