Post by Bradley on Jul 6, 2005 11:29:20 GMT -5
This will transform your welcome table to have a simple PM bar like here on GGD.
Global Headers
<script type="text/javascript">
<!--
var tables = document.getElementsByTagName("table");
var tds = document.getElementsByTagName("td");
var pmA ='';var pmText='';
var tempCN = tds.item(1).childNodes;
tds.item(1).removeChild(tempCN.item(3));
tds.item(1).removeChild(tempCN.item(2));
tds.item(1).removeChild(tempCN.item(1));
tds.item(2).style.display='none';
var tehTd = tds.item(2).innerHTML;
if(tehTd.split(',').length>=4) {
pmA = tehTd.split(',')[3].split(' ')[1];}
if(pmA=="1") {
pmText = 'You Have <'+'a href="index.cgi?action=pm">1 New Message</'+'a>';}
else if(pmA!="") {
pmText = 'You Have <'+'a href="index.cgi?action=pm">'+pmA+' New Messages</'+'a>';}
else {
pmText = 'Please <'+'a href="index.cgi?action=login">Login</'+'a> or <'+'a href="index.cgi?action=register">Register</'+'a>';}
tables.item(3).getElementsByTagName("td").item(0).innerHTML='<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td align="left">'+tables[3].getElementsByTagName("td")[0].innerHTML+'</td><td align="right">'+pmText+'</td></tr></table>';
// -->
</script>
If you would like to have the PM bar on the left instead of the right switch this, last line:
tables.item(3).getElementsByTagName("td").item(0).innerHTML='<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td align="left">'+tables[3].getElementsByTagName("td")[0].innerHTML+'</td><td align="right">'+pmText+'</td></tr></table>';
With this:
tables.item(3).getElementsByTagName("td").item(0).innerHTML='<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td align="left">'+pmText+'</td><td align="right">'+tables[3].getElementsByTagName("td")[0].innerHTML+'</td></tr></table>';
Global Headers
<script type="text/javascript">
<!--
var tables = document.getElementsByTagName("table");
var tds = document.getElementsByTagName("td");
var pmA ='';var pmText='';
var tempCN = tds.item(1).childNodes;
tds.item(1).removeChild(tempCN.item(3));
tds.item(1).removeChild(tempCN.item(2));
tds.item(1).removeChild(tempCN.item(1));
tds.item(2).style.display='none';
var tehTd = tds.item(2).innerHTML;
if(tehTd.split(',').length>=4) {
pmA = tehTd.split(',')[3].split(' ')[1];}
if(pmA=="1") {
pmText = 'You Have <'+'a href="index.cgi?action=pm">1 New Message</'+'a>';}
else if(pmA!="") {
pmText = 'You Have <'+'a href="index.cgi?action=pm">'+pmA+' New Messages</'+'a>';}
else {
pmText = 'Please <'+'a href="index.cgi?action=login">Login</'+'a> or <'+'a href="index.cgi?action=register">Register</'+'a>';}
tables.item(3).getElementsByTagName("td").item(0).innerHTML='<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td align="left">'+tables[3].getElementsByTagName("td")[0].innerHTML+'</td><td align="right">'+pmText+'</td></tr></table>';
// -->
</script>
If you would like to have the PM bar on the left instead of the right switch this, last line:
tables.item(3).getElementsByTagName("td").item(0).innerHTML='<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td align="left">'+tables[3].getElementsByTagName("td")[0].innerHTML+'</td><td align="right">'+pmText+'</td></tr></table>';
With this:
tables.item(3).getElementsByTagName("td").item(0).innerHTML='<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td align="left">'+pmText+'</td><td align="right">'+tables[3].getElementsByTagName("td")[0].innerHTML+'</td></tr></table>';