Conforums Support
Board Enhancements >> Hacks >> Welcome table customization
http://support.conforums.com/index.cgi?board=code&action=display&num=1155978096

Welcome table customization
Post by Garet on Aug 19th, 2006, 04:01am

Well, this pretty much does exactly the same thing as the current welcome table on this forum. Except it is my version, and this one is shorter.

Global Headers
Cross Browser: IE, FF, Netscape and Opera


Submitted by Zando



<script type="text/javascript">
<!--

/*
Welcome Table Customiztion
Coded By Zando
http://eldesigns.conforums.com
*/

var td=document.getElementsByTagName("td")
var table=document.getElementsByTagName("table")
var end=table[0].insertRow(2).insertCell(0);
end.className="welcomebg";
if(table[0].innerHTML.match(/Welcome Guest. Please/)){
end.innerHTML="<table border='0' width='100%'><tr><td align='left' width='50%'>Welcome Guest.</td><td align='right' width='50%'>Please <a href='/index.cgi?action=login'>Login</a> or <a href='/index.cgi?action=register'>Register</a> to view your Inbox.</td></tr></table>";
} else {
if(table[0].innerHTML.match(/Hey, (\D+), you have/)){
var user=RegExp.$1;
}
if(table[0].innerHTML.match(/(\d+) (is|are) new./)){
var pm2=RegExp.$1;
}
if(table[0].innerHTML.match(/(\d+) messages/)){
var pm=RegExp.$1;
}
end.innerHTML="<table border='0' width='100%'><tr><td align='left' width='50%'>Welcome Back "+user+"</td><td align='right' width='50%'>You have a total of <a href='/index.cgi?action=im'>"+pm+" Private Messages</a>, "+pm2+" are new.</td></tr></table>";
}

document.getElementsByTagName("font")[1].style.display="none";
document.getElementsByTagName("font")[2].style.display="none";

//-->
</script>