Post by Wedge on Apr 12, 2009 1:48:10 GMT -5
Code Name: Simple Info Center
Creator: Wedge
Preview:
Definition: A basic info center - nothing much more I can say. Except, read the notes underneath =]
Placement: Main Footer
What to Edit: A note when editing the news. Ensure that the numbers in the boxes run consecutively. There is no limit to news items, but naturally, too many will stretch the page. Just replace the link of the thread into the '#'.
Note: The icon used in the info center, will pull the link from your custom images page, in the modify skin section of your board.
Additional Comments:
Creator: Wedge
Preview:
Definition: A basic info center - nothing much more I can say. Except, read the notes underneath =]
Placement: Main Footer
<script type="text/javascript">
<!--
/*Simple Info Center - Wedge*/
//Edit Here
var News=new Array();
News[0]="<a href='#'>Link #1</a>";
News[1]="<a href='#'>Link #2</a>";
News[2]="<a href='#'>Link #3</a>";
//No Edits
if(!location.href.match(/action/) || location.href.match(/action=home/)){
var tB = document.getElementsByTagName("table");
var gtd = document.getElementsByTagName('td');
if(gtd[2].innerHTML.match(/you have <.+?>(.+?) (message|messages)<.+?>, (\d+) (are|is) new./i)){
totPM = RegExp.$1;
newPM = RegExp.$3;
}
if(pb_username != 'Guest'){
var PMinfo = " Total PMs: "+totPM+" <br />New PMs: "+newPM;
var inout = "<a href='?action=pm'>Inbox</a> | <a href='?action=pm&view=2'>Outbox</a>";
}else{
var PMinfo = 'Welcome, Guest!<br />Please <a href="?action=login">Login</a> or <a href="?action=register">Register</a> to view.';
var inout = 'Login or Register';
}
for(t=tB.length-1;t>0;t--){
if(tB[t].width == "100%" && tB[t].cellPadding == "4" && tB[t].innerHTML.match(/Info Center/i)){
var tD = tB[t].getElementsByTagName('td');
for(e=0;e<tD.length;e++){
if(tD[e].className == "catbg" && tD[e].innerHTML.match(/Forum Statistics/)){
var tposts = (tD[e+2].innerHTML.match(/Total Posts: (.+?)<br/i)) ? RegExp.$1: 0;
var ttopics = (tD[e+2].innerHTML.match(/Total Topics: (.+?) -/i)) ? RegExp.$1: 0;
var lpost = (tD[e+2].innerHTML.match(/Last Updated Topic: (.+?) by/i)) ? RegExp.$1: 'N/a';
var lpostusr = (tD[e+2].innerHTML.match(/by (.+?) \((.+?)\)</i)) ? RegExp.$1 + ' (' + RegExp.$2 + ') ': 'N/a';
var totmem = (tD[e+2].innerHTML.match(/Total Members: (.+?)<br/i)) ? RegExp.$1: 'N/a';
var newmem = (tD[e+2].innerHTML.match(/Newest Member: (.+?)</i)) ? RegExp.$1: 'N/a';
}else if(tD[e].className == "catbg" && tD[e].innerHTML.match(/Users Online/)){
var staffonl = (tD[e+4].innerHTML.match(/(\d+) Staff/i)) ? RegExp.$1: 0;
var memonl = (tD[e+4].innerHTML.match(/(\d+) Member/i)) ? RegExp.$1: 0;
var guestonl = (tD[e+4].innerHTML.match(/(\d+) Guest/i)) ? RegExp.$1: 0;
var nowonl = tD[e+4].innerHTML.split(/<br ?\/?>/i)[1].split(/<\/font>/i)[0];
var simg = (tD[e+3].innerHTML.match(/<img src="(.+?)" alt="online" border="0"/i)) ? RegExp.$1: 'N/a';
if(staffonl+memonl==0){
var nowonl = "<i>No Users Online</i>";
}
}else if(tD[e].className == "catbg" && tD[e].innerHTML.match(/Active Users In The Past 24 Hours/)){
var staffonltdy = (tD[e+4].innerHTML.match(/(\d+) Staff/i)) ? RegExp.$1: 0;
var memonltdy = (tD[e+4].innerHTML.match(/(\d+) Member/i)) ? RegExp.$1: 0;
var guestonltdy = (tD[e+4].innerHTML.match(/(\d+) Guest/i)) ? RegExp.$1: 0;
var onltdy = tD[e+4].innerHTML.split(/<br ?\/?>/i)[1].split(/<\/font>/i)[0];
if(staffonltdy+memonltdy==0){
var onltdy = "<i>No Users Online Today</i>";
}
}
}
tB[t].parentNode.innerHTML = '<table width="100%" cellpadding="5" class="bordercolor" cellspacing="1"><tr><td colspan="5" class="titlebg">Info Center</td></tr><tr><td width="10%" rowspan="6" align="center" valign="middle" class="windowbg"><img src="'+simg+'" alt="online" border="0"></td><td colspan="2" rowspan="2" class="windowbg2">Total Topics: '+ttopics+' | Total Posts: '+tposts+'<br />Last Post: '+lpost+' by '+lpostusr+'</td><td width="15%" class="catbg">PM Center</td><td width="20%" rowspan="2" class="windowbg2">'+PMinfo+'</td></tr><tr><td class="windowbg2" align="center">'+inout+'</td></tr><tr><td colspan="4" class="catbg">Online</td></tr><tr><td width="10%" class="windowbg2">'+staffonl+' Staff<br />'+memonl+' Members<br />'+guestonl+' Guests</td><td width="45%" class="windowbg2">'+nowonl+'</td><td colspan="2" class="windowbg2">Total Members: '+totmem+' <br />Newest Member: '+newmem+'</td></tr><tr><td colspan="4" class="catbg">In the Last 24 hours</td></tr><tr><td class="windowbg2">'+staffonltdy+' Staff<br />'+memonltdy+' Members<br />'+guestonltdy+' Guests</td><td colspan="3" class="windowbg2">'+onltdy+'</td></tr><tr><td colspan="5" class="catbg">News: '+News.join(' - ')+'</td></tr></table>';
break;
}
}
}
//-->
</script>
What to Edit: A note when editing the news. Ensure that the numbers in the boxes run consecutively. There is no limit to news items, but naturally, too many will stretch the page. Just replace the link of the thread into the '#'.
Note: The icon used in the info center, will pull the link from your custom images page, in the modify skin section of your board.
Additional Comments: