Post by Ross on Jul 5, 2005 18:42:32 GMT
Global Header
This may take some explaining. This code will do two main things:
a) It will display a PM center for members with links to PM functions.
b) There is an optional "Admin Panel" giving yourself and other Admins/Global Mods access to some of the frequently used admin options straight from any page.
<script type="text/javascript">
/*
Elindirs PM Center Code
Do Not repost or edit without permission
101support.proboards43.com
*/
var ForumName="Forum Name";
var tadmin="1"; //Change to 1 to display admin panel for admins
var adminpanel="<a href='/index.cgi?action=fixaboard'>Fix-a-Board<\/a> | <a href='/index.cgi?action=pmall'>Mass PM<\/a> | <a href='/index.cgi?action=ban'>Ban Members<\/a> | <a href='/index.cgi?action=recountmembers'>Recount Members<\/a> | <a href='/index.cgi?action=searchmembers'>Search Members<\/a> | <a href='/index.cgi?action=newsfader'>News Fader<\/a>"; //This can be edited to change the admin options displayed. Note, all members with access to the admin area will be able to see this.
//Do Not Edit Below
var TD = document.getElementsByTagName("TD");
var table = document.getElementsByTagName("table");
var iPM = table[0].insertRow(2).insertCell(0);
if(TD[2].innerHTML.match(/Hey,/)){
var iName=TD[2].innerHTML.split("Hey,")[1].split(", you")[0];
var iTotal=TD[2].innerHTML.split("have ")[1].split(" message")[0];
if(TD[2].innerHTML.match(/is new./)){
var iNew=TD[2].innerHTML.split(">, ")[1].split(" is new.")[0];
var messages="message";} else
{var iNew=TD[2].innerHTML.split(">, ")[1].split(" are new.")[0]; var messages="messages";}}
if(TD[2].innerHTML.match(/<BR>/)){var iTime=TD[2].innerHTML.split("<BR>")[1];
}else{var iTime=TD[2].innerHTML.split("<br>")[1];}
if(TD[5].innerHTML.match(/action=(logout|members)/)){
iPM.innerHTML="<table width='100%' align='center' class='bordercolor' cellpadding='0' cellspacing='1' border='0'><tr><td><table cellpadding='0' cellspacing='0' border='0' width='100%'><tr><td class='windowbg' width='15%' align='left'>Forum Date & Time: <br/>"+iTime+"<br\/><\/td><td class='windowbg' width='50%'><font size='2'><center>Hi "+iName+", Welcome to "+ForumName+"\!<br\/>You have <a href='\/index.cgi\?action=pm'>"+iNew+" new<\/a> "+messages+" out of a total of "+iTotal+"<\/center><\/font><\/td><td width='15%' class='windowbg' align='left'><a href='/index.cgi?action=pm&view=2'>Outbox</a><br\/><br\/><a href='\/index.cgi?action=pmsend'>New Message<\/a><br\/><br\/><a href='\/index.cgi?action=pmprefs'>PM Preferences<\/a><\/td><\/tr><\/table><\/td><\/tr><\/table>";
}else{iPM.innerHTML="<table width='100%' align='center' class='bordercolor' cellpadding='0' cellspacing='1' border='0'><tr><td><table cellpadding='0' cellspacing='0' border='0' width='100%'><tr><td class='windowbg' width='15%' align='center'><font size='2'>Welcome to "+ForumName+" Guest!<br\/>Please <a href='/index.cgi?action=login'>Login<\/a>. Or if you're not already a member, <a href='/index.cgi?action=register'>Register<\/a>.<\/font><\/td><\/tr><\/table><\/td><\/tr><\/table>";
}TD[2].style.display="none";
if(TD[5].innerHTML.match(/action=admin/) && tadmin.match(/1/)){
iAdmin=table[0].insertRow(3).insertCell(0);
iAdmin.innerHTML="<table width='100%' align='center' class='bordercolor' cellpadding='0' cellspacing='1' border='0'><tr><td><table cellpadding='0' cellspacing='0' border='0' width='100%'><tr><td width='100%' height='40' class='windowbg'><center>"+adminpanel+"<\/center><\/td><\/tr><\/table><\/td><\/tr><\/table>";}
</script>
Red: This is the name of your forum and will be shown in the PM center.
Yellow: The on/off switch for the admin Panel. If you wish to remove the admin bar, just change the 1 to anything else. 0 for example.
Blue: This is the Admin Bar. You can add or remove different links from here. Just be careful not to use any double quotes (") and follow the pattern.
Reason For Edit: Fixed stupid bug
This may take some explaining. This code will do two main things:
a) It will display a PM center for members with links to PM functions.
b) There is an optional "Admin Panel" giving yourself and other Admins/Global Mods access to some of the frequently used admin options straight from any page.
<script type="text/javascript">
/*
Elindirs PM Center Code
Do Not repost or edit without permission
101support.proboards43.com
*/
var ForumName="Forum Name";
var tadmin="1"; //Change to 1 to display admin panel for admins
var adminpanel="<a href='/index.cgi?action=fixaboard'>Fix-a-Board<\/a> | <a href='/index.cgi?action=pmall'>Mass PM<\/a> | <a href='/index.cgi?action=ban'>Ban Members<\/a> | <a href='/index.cgi?action=recountmembers'>Recount Members<\/a> | <a href='/index.cgi?action=searchmembers'>Search Members<\/a> | <a href='/index.cgi?action=newsfader'>News Fader<\/a>"; //This can be edited to change the admin options displayed. Note, all members with access to the admin area will be able to see this.
//Do Not Edit Below
var TD = document.getElementsByTagName("TD");
var table = document.getElementsByTagName("table");
var iPM = table[0].insertRow(2).insertCell(0);
if(TD[2].innerHTML.match(/Hey,/)){
var iName=TD[2].innerHTML.split("Hey,")[1].split(", you")[0];
var iTotal=TD[2].innerHTML.split("have ")[1].split(" message")[0];
if(TD[2].innerHTML.match(/is new./)){
var iNew=TD[2].innerHTML.split(">, ")[1].split(" is new.")[0];
var messages="message";} else
{var iNew=TD[2].innerHTML.split(">, ")[1].split(" are new.")[0]; var messages="messages";}}
if(TD[2].innerHTML.match(/<BR>/)){var iTime=TD[2].innerHTML.split("<BR>")[1];
}else{var iTime=TD[2].innerHTML.split("<br>")[1];}
if(TD[5].innerHTML.match(/action=(logout|members)/)){
iPM.innerHTML="<table width='100%' align='center' class='bordercolor' cellpadding='0' cellspacing='1' border='0'><tr><td><table cellpadding='0' cellspacing='0' border='0' width='100%'><tr><td class='windowbg' width='15%' align='left'>Forum Date & Time: <br/>"+iTime+"<br\/><\/td><td class='windowbg' width='50%'><font size='2'><center>Hi "+iName+", Welcome to "+ForumName+"\!<br\/>You have <a href='\/index.cgi\?action=pm'>"+iNew+" new<\/a> "+messages+" out of a total of "+iTotal+"<\/center><\/font><\/td><td width='15%' class='windowbg' align='left'><a href='/index.cgi?action=pm&view=2'>Outbox</a><br\/><br\/><a href='\/index.cgi?action=pmsend'>New Message<\/a><br\/><br\/><a href='\/index.cgi?action=pmprefs'>PM Preferences<\/a><\/td><\/tr><\/table><\/td><\/tr><\/table>";
}else{iPM.innerHTML="<table width='100%' align='center' class='bordercolor' cellpadding='0' cellspacing='1' border='0'><tr><td><table cellpadding='0' cellspacing='0' border='0' width='100%'><tr><td class='windowbg' width='15%' align='center'><font size='2'>Welcome to "+ForumName+" Guest!<br\/>Please <a href='/index.cgi?action=login'>Login<\/a>. Or if you're not already a member, <a href='/index.cgi?action=register'>Register<\/a>.<\/font><\/td><\/tr><\/table><\/td><\/tr><\/table>";
}TD[2].style.display="none";
if(TD[5].innerHTML.match(/action=admin/) && tadmin.match(/1/)){
iAdmin=table[0].insertRow(3).insertCell(0);
iAdmin.innerHTML="<table width='100%' align='center' class='bordercolor' cellpadding='0' cellspacing='1' border='0'><tr><td><table cellpadding='0' cellspacing='0' border='0' width='100%'><tr><td width='100%' height='40' class='windowbg'><center>"+adminpanel+"<\/center><\/td><\/tr><\/table><\/td><\/tr><\/table>";}
</script>
Red: This is the name of your forum and will be shown in the PM center.
Yellow: The on/off switch for the admin Panel. If you wish to remove the admin bar, just change the 1 to anything else. 0 for example.
Blue: This is the Admin Bar. You can add or remove different links from here. Just be careful not to use any double quotes (") and follow the pattern.
Reason For Edit: Fixed stupid bug