Post by hey on Nov 8, 2005 17:16:49 GMT -8
Look at any info center on a phpbb board for a preview. It's exactly identical to it.
Main Footer, Crossbrowser
<script type="text/javascript">
//phpBB-Style Info Center by hey
//Don't Repost and keep this header intact. Edit if you wish.
var groups = [];
groups[0] = ["Administrator","#700000"];
groups[1] = ["Moderator","#007000"];
function executePhpbbInfoCenter(){
var td = document.getElementsByTagName('td');
for(t=0;t<td.length;t++){
if(td[t].className.match(/catbg/i) && td[t].innerHTML.match(/Forum Statistics/i)){
var totalPosts = (td[t+2].innerHTML.match(/Total Posts: (\d+)(,\d+)?<br/i)) ? RegExp.$1+RegExp.$2: '';
var totalTopics = (td[t+2].innerHTML.match(/Total Topics: (\d+)(,\d+)? &/i)) ? RegExp.$1+RegExp.$2: '';
var totalArticles = totalPosts + totalTopics;
infoHolder = 'Our users have posted a total of <b>'+totalArticles+'</b> articles';
infoHolder += '<br />';
var totalMembers = (td[t+2].innerHTML.match(/Total Members: (.+?)<br/i)) ? RegExp.$1: '';
infoHolder += 'We have <b>'+totalMembers+'</b> registered users';
infoHolder += '<br />';
var newestMember = (td[t+2].innerHTML.match(/Newest Member: (.+?)<\/a>/i)) ? RegExp.$1+'</a>': '[Newest Member Deleted]';
infoHolder += 'The newest registered user is <b>'+newestMember+'</b>';
td[t+1].rowSpan='7';
td[t+2].align='left';
td[t+2].innerHTML=''+infoHolder+'';}
if(td[t].className.match(/catbg/i) && td[t].innerHTML.match(/Today's Birthdays/i)){
td[t].parentNode.style.display='none';
td[t+1].parentNode.style.display='none';}
if(td[t].className.match(/catbg/i) && td[t].innerHTML.match(/Events This Month/i)){
td[t].parentNode.style.display='none';
td[t+1].parentNode.style.display='none';}
if(td[t].className.match(/catbg/i) && td[t].innerHTML.match(/Users Online/i)){
var staffOn = (td[t+2].innerHTML.match(/(\d+) Staff/i)) ? RegExp.$1: '0';
var membersOn = (td[t+2].innerHTML.match(/(\d+) Member/i)) ? RegExp.$1: '0';
var guestsOn = (td[t+2].innerHTML.match(/(\d+) Guest/i)) ? RegExp.$1: '0';
var hiddenOn = (td[t+2].innerHTML.match(/(\d+) Invisible/i)) ? RegExp.$1: '0';
if(pb_username=='admin'){
var iguestlinka = '<a href="javascript:popWindow(\'viewguests\')">';
var iguestlinkb = '</a>';} else {var iguestlinka = ''; var iguestlinkb = '';}
var totalOnline = parseInt(staffOn) + parseInt(membersOn) + parseInt(guestsOn) + parseInt(hiddenOn);
var registeredOnline = parseInt(staffOn) + parseInt(membersOn);
if(totalOnline==1){var toAre = 'is'; var toUsers = 'user';}
else{var toAre = 'are'; var toUsers = 'users';}
userHolder = 'In total there '+toAre+' '+totalOnline+' '+toUsers+' online :: ';
userHolder += ''+registeredOnline+' Registered, ';
userHolder += ''+hiddenOn+' Hidden and, ';
userHolder += ''+iguestlinka+guestsOn+' Guests'+iguestlinkb+'';
for(g=0;g<groups.length;g++){
userHolder += '&nb'+'sp;&nb'+'sp;&nb'+'sp;[<font color="'+groups[g][1]+'">'+groups[g][0]+'</font>]';}
userHolder += '<br />';
if(td[t+2].innerHTML.match(/Most users online was (\d+), (.+?)<br/i)){
var mostOnline = RegExp.$1;
var mostDate = RegExp.$2;}
userHolder += 'Most users ever online was <b>'+mostOnline+'</b> on '+mostDate+'';
userHolder += '<br />';
var usersOn = td[t+2].innerHTML.split(/<br\s?\/?>/i)[1].replace('\'','\'');
userHolder += 'Registered Users: '+usersOn+'';
td[t].parentNode.style.display='none';
td[t+1].style.display='none';
td[t+2].innerHTML=''+userHolder+'';
}}}
if(location.href.match(/com\/?((index\.cgi)?\??(action=(logout|home))?(#.+)?)?$/)){
executePhpbbInfoCenter();
}
</script>
The groups variables should not be edited at the beginning if you want a true phpBB info center.
Main Footer, Crossbrowser
<script type="text/javascript">
//phpBB-Style Info Center by hey
//Don't Repost and keep this header intact. Edit if you wish.
var groups = [];
groups[0] = ["Administrator","#700000"];
groups[1] = ["Moderator","#007000"];
function executePhpbbInfoCenter(){
var td = document.getElementsByTagName('td');
for(t=0;t<td.length;t++){
if(td[t].className.match(/catbg/i) && td[t].innerHTML.match(/Forum Statistics/i)){
var totalPosts = (td[t+2].innerHTML.match(/Total Posts: (\d+)(,\d+)?<br/i)) ? RegExp.$1+RegExp.$2: '';
var totalTopics = (td[t+2].innerHTML.match(/Total Topics: (\d+)(,\d+)? &/i)) ? RegExp.$1+RegExp.$2: '';
var totalArticles = totalPosts + totalTopics;
infoHolder = 'Our users have posted a total of <b>'+totalArticles+'</b> articles';
infoHolder += '<br />';
var totalMembers = (td[t+2].innerHTML.match(/Total Members: (.+?)<br/i)) ? RegExp.$1: '';
infoHolder += 'We have <b>'+totalMembers+'</b> registered users';
infoHolder += '<br />';
var newestMember = (td[t+2].innerHTML.match(/Newest Member: (.+?)<\/a>/i)) ? RegExp.$1+'</a>': '[Newest Member Deleted]';
infoHolder += 'The newest registered user is <b>'+newestMember+'</b>';
td[t+1].rowSpan='7';
td[t+2].align='left';
td[t+2].innerHTML=''+infoHolder+'';}
if(td[t].className.match(/catbg/i) && td[t].innerHTML.match(/Today's Birthdays/i)){
td[t].parentNode.style.display='none';
td[t+1].parentNode.style.display='none';}
if(td[t].className.match(/catbg/i) && td[t].innerHTML.match(/Events This Month/i)){
td[t].parentNode.style.display='none';
td[t+1].parentNode.style.display='none';}
if(td[t].className.match(/catbg/i) && td[t].innerHTML.match(/Users Online/i)){
var staffOn = (td[t+2].innerHTML.match(/(\d+) Staff/i)) ? RegExp.$1: '0';
var membersOn = (td[t+2].innerHTML.match(/(\d+) Member/i)) ? RegExp.$1: '0';
var guestsOn = (td[t+2].innerHTML.match(/(\d+) Guest/i)) ? RegExp.$1: '0';
var hiddenOn = (td[t+2].innerHTML.match(/(\d+) Invisible/i)) ? RegExp.$1: '0';
if(pb_username=='admin'){
var iguestlinka = '<a href="javascript:popWindow(\'viewguests\')">';
var iguestlinkb = '</a>';} else {var iguestlinka = ''; var iguestlinkb = '';}
var totalOnline = parseInt(staffOn) + parseInt(membersOn) + parseInt(guestsOn) + parseInt(hiddenOn);
var registeredOnline = parseInt(staffOn) + parseInt(membersOn);
if(totalOnline==1){var toAre = 'is'; var toUsers = 'user';}
else{var toAre = 'are'; var toUsers = 'users';}
userHolder = 'In total there '+toAre+' '+totalOnline+' '+toUsers+' online :: ';
userHolder += ''+registeredOnline+' Registered, ';
userHolder += ''+hiddenOn+' Hidden and, ';
userHolder += ''+iguestlinka+guestsOn+' Guests'+iguestlinkb+'';
for(g=0;g<groups.length;g++){
userHolder += '&nb'+'sp;&nb'+'sp;&nb'+'sp;[<font color="'+groups[g][1]+'">'+groups[g][0]+'</font>]';}
userHolder += '<br />';
if(td[t+2].innerHTML.match(/Most users online was (\d+), (.+?)<br/i)){
var mostOnline = RegExp.$1;
var mostDate = RegExp.$2;}
userHolder += 'Most users ever online was <b>'+mostOnline+'</b> on '+mostDate+'';
userHolder += '<br />';
var usersOn = td[t+2].innerHTML.split(/<br\s?\/?>/i)[1].replace('\'','\'');
userHolder += 'Registered Users: '+usersOn+'';
td[t].parentNode.style.display='none';
td[t+1].style.display='none';
td[t+2].innerHTML=''+userHolder+'';
}}}
if(location.href.match(/com\/?((index\.cgi)?\??(action=(logout|home))?(#.+)?)?$/)){
executePhpbbInfoCenter();
}
</script>
The groups variables should not be edited at the beginning if you want a true phpBB info center.