Post by »Prodigy™ on Feb 23, 2007 15:29:43 GMT -5
My first attempt at an info center. No Bugs Found. I will continue editing this. I am allowing usage of this. Though, Im sure no one will use it
Main Footer
Preview: None, Test It Out.
Main Footer
Preview: None, Test It Out.
<script language="javascript">
//Code Copyright Xino
if(location.href.match(/com\/?((index\.cgi)?\??(action=(logout|home))?(#.+)?)?$/i)){
var td = document.getElementsByTagName('td');
var amount= 'SB Test Board'; //Put Your Board Name Here
var staffLHTML = '<font size="1" color="B80000">Administrator</font><br>';
staffLHTML += '<font size="1" color="0900B8">Global Moderator</font><br>';
staffLHTML += '<font size="1" color="00B845">Moderator</font>';
//Last Post
for(h=0;h<td.length;h++){
if(td[h].align=="left" && td[h].vAlign=="top" && td[h].width=="60%" && td[h].innerHTML.match(/Total Topics:/)){
var splitLPost = td[h].innerHTML.split("Last Updated Topic: ")[1];
var splitLPost2 = splitLPost.split("<br>")[0];
var lastPost = splitLPost2.split("\(")[0];
}}
//Total Topics
for(t=0;t<td.length;t++){
if(td[t].width=="60%" && td[t].vAlign=="top" && td[t].innerHTML.match("Total Topics:") && td[t].innerHTML.match("Total Posts:")){
var splitTTopics = td[t].innerHTML.split("Total Topics:")[1];
var splitTTopics2 = (document.all)? splitTTopics.split("<BR>")[0] : splitTTopics.split("<br>")[0];
var totalTopics = splitTTopics2.split(" - ")[0];
}}
//Total Posts
for(p=0;p<td.length;p++){
if(td[p].width=="60%" && td[p].vAlign=="top" && td[p].innerHTML.match("Total Topics:") && td[p].innerHTML.match("Total Posts:")){
var splitTPosts = td[p].innerHTML.split("Total Posts:")[1];
var totalPosts = (document.all)? splitTPosts.split("<BR>")[0] : splitTPosts.split("<br>")[0];
}}
//PMs
if(td[2].innerHTML.match(/Guest/i)){
var PMs = 'Please <a href="?action=login">Login</a> or <a href="?action=register">Signup</a>';
}
if(td[2].innerHTML.match(/, (\d+) (\w+) new/i)){
var PMs = '<a href="?action=pm">'+RegExp.$1+' new messages</a>';
}
//Total Members and Newest Member and Misc
for(m=0;m<td.length;m++){
if(td[m].width=="60%" && td[m].vAlign=="top" && td[m].innerHTML.match("Total Topics:") && td[m].innerHTML.match("Total Posts:")){
td[m].width = "90%";
var splitTMembers = td[m+1].innerHTML.split("Total Members:")[1];
var totalMembers = (document.all)? splitTMembers.split("<BR>")[0] : splitTMembers.split("<br>")[0];
var splitNMember = (document.all)? splitTMembers.split("<BR>")[1] : splitTMembers.split("<br>")[1];
var newMember = splitNMember.split(":")[1];
td[m+1].innerHTML = '';
}}
//Users Online
for(t=0;t<td.length;t++){
if(td[t].className.match(/catbg/i) && td[t].innerHTML.match(/Users Online/i)){
var SusersOn = td[t+2].innerHTML.split(/<br>/i)[1];
var usersOn = SusersOn.split(/<\/td>/i)[0];
var membersOn = (td[t+2].innerHTML.match(/(\d+) Member/i)) ? RegExp.$1: '';
var guestsOn = (td[t+2].innerHTML.match(/(\d+) Visitor/i)) ? RegExp.$1: '';
var staffOn = (td[t+2].innerHTML.match(/(\d+) Staff/i)) ? RegExp.$1: '';
}}
//Insert Into Table
for(i=0;i<td.length;i++){
if(td[i].width=="90%" && td[i].vAlign=="top" && td[i].innerHTML.match("Total Topics:") && td[i].innerHTML.match("Total Posts:")){
td[i].innerHTML = '<font size="1">At '+amount+' We have a total of '+totalMembers+' members.<br> Please welcome '+newMember+' as '+amount+' newest member.<br><b>Last Post: </b>'+lastPost+' <br> <b>Amount Of Topics:</b> '+totalTopics+' <br><b>Total Posts:</b>'+totalPosts+'<hr size="1"><a href="?action=members&view=staff">View Staff Members</a> | '+PMs+'</font></center>';
td[i+5].innerHTML = '<table width="100%"><tr><td><font size="1">Staff Online: '+staffOn+' | Members Online: '+membersOn+' | Visitors Online: '+guestsOn+'<br>'+usersOn+'</font></td></tr></table><br><hr size="1">'+staffLHTML+'';
}}}
</script>