Post by hey on Oct 27, 2005 8:40:43 GMT -8
This is a very simple info center. It loads quickly, however.
Preview: heytest8.proboards57.com
Cross Browser.
Main Footer:
<script type="text/javascript">
/* Fusion Info Center A by hey - No Reposting */
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: '';
infoHolder = '<div>Total Posts: '+totalPosts+' - ';
var totalTopics = (td[t+2].innerHTML.match(/Total Topics: (\d+)(,\d+)? &/i)) ? RegExp.$1+RegExp.$2: '';
infoHolder += 'Total Topics: '+totalTopics+' - ';
var totalMembers = (td[t+2].innerHTML.match(/Total Members: (.+?)<br/i)) ? RegExp.$1: '';
infoHolder += 'Members: '+totalMembers+' - ';
var newMember = (td[t+2].innerHTML.match(/Newest Member: (.+?)<\/a>/i)) ? RegExp.$1+'</a>': '';
infoHolder += 'Newest Member: '+newMember+'</div>';
var lastPost = (td[t+2].innerHTML.match(/Last Updated Topic: (.+?) by/i)) ? RegExp.$1: 'n/a';
postHolder = '<div>Last Post: '+lastPost+' ';
var lastUser = (td[t+2].innerHTML.match(/by (.+?) \(/i)) ? RegExp.$1: 'n/a';
postHolder += 'by '+lastUser+' ';
var lastDate = (td[t+2].innerHTML.match(/<\/a> \((.+?)\)<br\s?\/?>/i)) ? RegExp.$1: 'n/a';
postHolder += 'on '+lastDate+'.</div>';
td[t].parentNode.style.display='none';
td[t+2].parentNode.style.display='none';}
if(td[t].className.match(/catbg/i) && td[t].innerHTML.match(/(Events This Month|Today's Birthdays)/i)){
td[t].parentNode.style.display='none';
td[t+4].parentNode.style.display='none';}
if(td[t].className.match(/catbg/i) && td[t].innerHTML.match(/Users Online/i)){
var staffOn = (td[t+4].innerHTML.match(/(\d+) Staff/i)) ? RegExp.$1: '0';
usersHolder = '<div><span style="font-weight: bold;">Online Now</span> Staff: '+staffOn+' - ';
var membersOn = (td[t+4].innerHTML.match(/(\d+) Member/i)) ? RegExp.$1: '0';
usersHolder += 'Members: '+membersOn+' - ';
var guestsOn = (td[t+4].innerHTML.match(/(\d+) Guest/i)) ? RegExp.$1: '0';
if(document.cookie.match(/user=admin/i)){
var iguestlinka = '<a href="javascript:popWindow(\'viewguests\')">';
var iguestlinkb = '</a>';} else {var iguestlinka = ''; var iguestlinkb = '';}
usersHolder += ''+iguestlinka+'Guests: '+guestsOn+iguestlinkb+'<br />';
var usersOn = td[t+4].innerHTML.split(/<br\s?\/?>/i)[1];
usersHolder += ''+usersOn+'';
td[t].parentNode.style.display = 'none';
td[t+3].parentNode.style.display = 'none';
}
if(td[t].className == "catbg" && td[t].innerHTML.match(/Active Users/i)){
var staffOn = (td[t+4].innerHTML.match(/(\d+) Staff/i)) ? RegExp.$1: '0';
todayHolder = '<div><span style="font-weight: bold;">Online Today</span> Staff: '+staffOn+' - ';
var membersOn = (td[t+4].innerHTML.match(/(\d+) Member/i)) ? RegExp.$1: '0';
todayHolder += 'Members: '+membersOn+' - ';
var guestsOn = (td[t+4].innerHTML.match(/(\d+) Guest/i)) ? RegExp.$1: '0';
if(document.cookie.match(/user=admin/i)){
var iguestlinka = '<a href="javascript:popWindow(\'viewgueststoday\')">';
var iguestlinkb = '</a>';} else {var iguestlinka = ''; var iguestlinkb = '';}
todayHolder += ''+iguestlinka+'Guests: '+guestsOn+iguestlinkb+'<br />';
var usersOn = td[t+4].innerHTML.split(/<br\s?\/?>/i)[1];
todayHolder += ''+usersOn+'';
td[t+4].innerHTML = ''+infoHolder+'';
td[t+4].innerHTML += ''+postHolder+'';
td[t+4].innerHTML += ''+usersHolder+'';
td[t+4].innerHTML += ''+todayHolder+'';
td[t].parentNode.style.display = 'none';
}
}
</script>
Edit 29/12/2007 - This code has been updated to be 4.5 compatible by Ross
Preview: heytest8.proboards57.com
Cross Browser.
Main Footer:
<script type="text/javascript">
/* Fusion Info Center A by hey - No Reposting */
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: '';
infoHolder = '<div>Total Posts: '+totalPosts+' - ';
var totalTopics = (td[t+2].innerHTML.match(/Total Topics: (\d+)(,\d+)? &/i)) ? RegExp.$1+RegExp.$2: '';
infoHolder += 'Total Topics: '+totalTopics+' - ';
var totalMembers = (td[t+2].innerHTML.match(/Total Members: (.+?)<br/i)) ? RegExp.$1: '';
infoHolder += 'Members: '+totalMembers+' - ';
var newMember = (td[t+2].innerHTML.match(/Newest Member: (.+?)<\/a>/i)) ? RegExp.$1+'</a>': '';
infoHolder += 'Newest Member: '+newMember+'</div>';
var lastPost = (td[t+2].innerHTML.match(/Last Updated Topic: (.+?) by/i)) ? RegExp.$1: 'n/a';
postHolder = '<div>Last Post: '+lastPost+' ';
var lastUser = (td[t+2].innerHTML.match(/by (.+?) \(/i)) ? RegExp.$1: 'n/a';
postHolder += 'by '+lastUser+' ';
var lastDate = (td[t+2].innerHTML.match(/<\/a> \((.+?)\)<br\s?\/?>/i)) ? RegExp.$1: 'n/a';
postHolder += 'on '+lastDate+'.</div>';
td[t].parentNode.style.display='none';
td[t+2].parentNode.style.display='none';}
if(td[t].className.match(/catbg/i) && td[t].innerHTML.match(/(Events This Month|Today's Birthdays)/i)){
td[t].parentNode.style.display='none';
td[t+4].parentNode.style.display='none';}
if(td[t].className.match(/catbg/i) && td[t].innerHTML.match(/Users Online/i)){
var staffOn = (td[t+4].innerHTML.match(/(\d+) Staff/i)) ? RegExp.$1: '0';
usersHolder = '<div><span style="font-weight: bold;">Online Now</span> Staff: '+staffOn+' - ';
var membersOn = (td[t+4].innerHTML.match(/(\d+) Member/i)) ? RegExp.$1: '0';
usersHolder += 'Members: '+membersOn+' - ';
var guestsOn = (td[t+4].innerHTML.match(/(\d+) Guest/i)) ? RegExp.$1: '0';
if(document.cookie.match(/user=admin/i)){
var iguestlinka = '<a href="javascript:popWindow(\'viewguests\')">';
var iguestlinkb = '</a>';} else {var iguestlinka = ''; var iguestlinkb = '';}
usersHolder += ''+iguestlinka+'Guests: '+guestsOn+iguestlinkb+'<br />';
var usersOn = td[t+4].innerHTML.split(/<br\s?\/?>/i)[1];
usersHolder += ''+usersOn+'';
td[t].parentNode.style.display = 'none';
td[t+3].parentNode.style.display = 'none';
}
if(td[t].className == "catbg" && td[t].innerHTML.match(/Active Users/i)){
var staffOn = (td[t+4].innerHTML.match(/(\d+) Staff/i)) ? RegExp.$1: '0';
todayHolder = '<div><span style="font-weight: bold;">Online Today</span> Staff: '+staffOn+' - ';
var membersOn = (td[t+4].innerHTML.match(/(\d+) Member/i)) ? RegExp.$1: '0';
todayHolder += 'Members: '+membersOn+' - ';
var guestsOn = (td[t+4].innerHTML.match(/(\d+) Guest/i)) ? RegExp.$1: '0';
if(document.cookie.match(/user=admin/i)){
var iguestlinka = '<a href="javascript:popWindow(\'viewgueststoday\')">';
var iguestlinkb = '</a>';} else {var iguestlinka = ''; var iguestlinkb = '';}
todayHolder += ''+iguestlinka+'Guests: '+guestsOn+iguestlinkb+'<br />';
var usersOn = td[t+4].innerHTML.split(/<br\s?\/?>/i)[1];
todayHolder += ''+usersOn+'';
td[t+4].innerHTML = ''+infoHolder+'';
td[t+4].innerHTML += ''+postHolder+'';
td[t+4].innerHTML += ''+usersHolder+'';
td[t+4].innerHTML += ''+todayHolder+'';
td[t].parentNode.style.display = 'none';
}
}
</script>
Edit 29/12/2007 - This code has been updated to be 4.5 compatible by Ross