Post by acoolie530 on Mar 8, 2005 22:30:25 GMT
Name: Acoolie Info Center v1
Compatibility: Firefox/IE
Placement: Main Footer
Edit: Instructions in code. Moderators names and hex colors
Preview: Preview
Notes: Similiar to the G101 info center but with many new functions. First, along the left side there is Total Topics, Posts, Articles (Posts + Topics), Categories, and Boards. Along the right, there is average Posts per Topic, average Posts per Board, average Topics per board, and average Boards per Category. In the center, there is a PM Center which displays total new PM's and some links for members only.
Next, there is an extra section split into 3 parts. On the left is Last updated Topic, Newest Member, Total Members, and boards updated today. In the center is a welcome with your username, a dynamic clock (actual seconds, minutes, and hours go by), and a back to top button. On the right is Users Online.
Beneath those sections is a staff legend.
Ok, i think thats it
Extras:
Update (March 8): I found out how to use XignaHosting and they have a much better hosting plan for me so I updated the link. I also now will include a free ".js" file so you do not need to download it. The .js file will be updated with a more centered PM center when i get it working correctly. If you wish to do modifications to the code, you must download the .zip file to get the full source code. So, if you want to use a completely unbugged version, use either. Or, if you want the info Center tweaked to fit your needs you will need to download the .zip file
Update (March 13): I fixed a bug so now there is a link to the last poster.
Update (April 15): Xigna closed my account and all other free hosted ones. Please recopy the code. I fixed alot. Now, there is staff online. No more inputing moderators/colors. They are all default. So, if you have a code for moderators to be black, then my info center IS compatible with it. Also, if you want moderator colors, i recomend Skystrifes auto-moderator colors. Ok... the code is much shorter too. Finally, i fixed the line color (showed up as blue in IE).
Also, i updated the copyright. I may post it somewhere but anyone is free to repost or redistribute any of my codes (unless they were a request and the user wants it not used anywhere else). All you have to do is keep the top header (usually one or two lines including the "this header must stay in tact" and the code name
To inform you, this is the code that won the G101 Code Competition ;D
Compatibility: Firefox/IE
Placement: Main Footer
Edit: Instructions in code. Moderators names and hex colors
Preview: Preview
Notes: Similiar to the G101 info center but with many new functions. First, along the left side there is Total Topics, Posts, Articles (Posts + Topics), Categories, and Boards. Along the right, there is average Posts per Topic, average Posts per Board, average Topics per board, and average Boards per Category. In the center, there is a PM Center which displays total new PM's and some links for members only.
Next, there is an extra section split into 3 parts. On the left is Last updated Topic, Newest Member, Total Members, and boards updated today. In the center is a welcome with your username, a dynamic clock (actual seconds, minutes, and hours go by), and a back to top button. On the right is Users Online.
Beneath those sections is a staff legend.
Ok, i think thats it
<script type="text/javascript">
<!--
/* acoolie info center v1
This header must stay in tact*/
if(document.title.match(/(Home|Mode Enabled)/i)){
var tab = document.getElementsByTagName("table");
var totBoards = 0;
var totCats = 0;
var updated = 0;
var time='<div id="clock"></div>'
function up(){
var dte = new Date();
var hrs = dte.getHours();
var min = dte.getMinutes();
var sec = dte.getSeconds();
var col = ":";
var spc = " ";
var apm;
if (12 < hrs) { hrs-=12;}
apm=(12<hrs) ? "PM":"AM"
if (hrs == 0) hrs=12;
if (min<=9) min="0"+min;
if (sec<=9) sec="0"+sec;
clock.innerHTML = hrs+":"+min+":"+sec+" "+apm;
}
setInterval("up()",1000);
var td = document.getElementsByTagName("td");
for(var n=0;n<tab.length;n++) {
if(tab[n].width=="100%" && tab[n].cellPadding=="4" && tab[n].cellSpacing=="1" && tab[n].innerHTML.match(/Info Center/i) && !tab[n].innerHTML.match(/Main Page/i)) {
var tabtr = tab[n].getElementsByTagName("tr");
tabtr[0].style.display = "none";
tabtr[1].style.display = "none";
tabtr[4].style.display = "none";
tabtr[5].style.display = "none";
var row = tab[n].insertRow(0);
var cell = row.insertCell(0)
cell.width = "100%"
cell.Align = "center";
cell.innerHTML = "<center><font class='text1' size='2'>Info Center</font></center>";
cell.className = "titlebg";
}}
var dname= (td[2].innerHTML.match(/Hey, (.+?), /i)) ? RegExp.$1:"guest"
var pms=(td[2].innerHTML.match(/(\d+)\s(are|is)\snew/i)) ? RegExp.$1:false;
var pmcent = (dname!="guest") ? "<a href='/index.cgi?action=im'>You have <b>"+pms+"</b> new message(s)</a>" : "Please <a href='/index.cgi?action=login'>login</a> or <a href='/index.cgi?action=register'>register</a>"
var pmcent2 = (dname!="guest") ? "| <a href=/index.cgi?action=im>Inbox</a> | <a href='/index.cgi?action=im&view=outbox'>Outbox</a> | <a href='/index.cgi?action=imsend'>Compose</a> | <a href='/index.cgi?action=imprefs'>Preferences</a> |" : ""
for(var o=0;o<td.length;o++) {if(td[o].width=="24%" && td[o].className=="windowbg2" && td[o].innerHTML.match(/<b>Today<\/b>/i)){updated++;}}
for(var f=0;f<td.length;f++) {if(td[f].className=="catbg" && !td[f].innerHTML.match(/(Forum Statistics|Users Online|action=markallboardsread)/i)){totCats++;}}
for(var e=0;e<td.length;e++) {if(td[e].width=="66%" && td[e].align=="left" && td[e].className=="windowbg2"){totBoards++;}}
for(w=0;w<td.length;w++) {
if(td[w].className=="windowbg2" && td[w].innerHTML.match(/Total (Posts|Topics)/i)) {
var topic = (td[w].innerHTML.match(/Total Topics: <b>(\d+)<\/b>/i)) ? RegExp.$1:false;
var post = (td[w].innerHTML.match(/Total Posts: <b>(\d+)<\/b>/i)) ? RegExp.$1:false;
var article = Math.floor(topic) + Math.floor(post);
td[w-1].style.display="none"
var guests = (td[w+5].innerHTML.match(/(\d+) Guest/i)) ? RegExp.$1:false;
var members = (td[w+5].innerHTML.match(/(\d+) Member/i)) ? RegExp.$1:false;
var uoTot = Math.floor(guests) + Math.floor(members);
var mem = td[w+2].getElementsByTagName("a");
var memo = td[w+5].innerHTML.split(/<br\/?>/i);
var lin = td[w].getElementsByTagName("a");
var staff=0;
var st = td[w+5].getElementsByTagName("a")
for(var e=0;e<st.length;e++){if(st[e].className.match(/(gmod|admin|mod)user/i)){staff++}}
var by = (lin[1].href.match(/index.cgi?action=viewprofile&username=(.+?)/i)) ? RegExp.$1:"javascript:void(0)"
var by2 = (td[w].innerHTML.match(/by (.+?)<\/b>/i)) ? RegExp.$1:""
var avppb = Math.round(post/totBoards);
var avtpb = Math.round(topic/totBoards);
var avppt = Math.round(post/topic);
var avbpc = Math.round(totBoards/totCats);
var legend = "<div align='center' style='padding-top: 4px; padding-bottom: 3px;'><font size=1>[ <a href='javascript:void(0)' class='adminuser'><strong>Administator</strong></a> ] - [ <a href='javascript:void(0)' class='gmoduser'><i>Global Moderator</i></a> ] - [ <a href='javascript:void(0)' class='moduser'>Moderator</a> ] - [ <a href='javascript:void(0)' class='memuser'>Member</a> ]</font></div>"
var pmcentall = "<table width='50%' align='center'><tr><td align='center'>"+pmcent+"</td></tr><tr><td align='center'>"+pmcent2+"</td></tr></table>"
var totals = "<table border='0' width='20%' height='0' align='left' cellpadding='5' cellspacing='0' style='text-align: justify; padding-bottom: 6;'><tr><td><font size=1>Total Topics: <b>"+topic+"</b><br/>Total Posts: <b>"+post+"</b><br/>Total Articles: <b>"+article+"</b><br/>Total Boards: <b>"+totBoards+"</b><br/>Total Categories: <b>"+totCats+"</b></font></td></tr></table>"
var averages = "<TABLE width='30%' height='0' cellspacing='0' cellpadding='5' align='right' style='text-align: justify; padding-bottom: 6px;'><tr><td width='20%' class='windowbg2' align='right'><font size=1>Average Posts Per Board: <b>"+avppb+"</b><br/>Average Topics Per Board: <b>"+avtpb+"</b><br/>Average Posts Per Topic: <b>"+avppt+"</b><br/>Average Boards Per Category: <b>"+avbpc+"</b></font></td></tr></table>"
var infoleft = "<tr><td align='left' valign='middle' width='40%' rowspan='2' class='windowbg'><font size='1'>Last Updated Topic: <a href='" + lin[0].href + "'>" + lin[0].innerHTML + "</a> by <a href='"+by+"'>" + by2 + "</a></b><br/>Newest Member: <a href='" + mem[1].href + "'><b>" + mem[1].innerHTML + "</b></a><br/>Total Members: <a href='" + mem[0].href + "'><b>" + mem[0].innerHTML + "</b></a><br/>Boards updated today: <b>" + updated + "</b> </font>"
var infocent = "<td class='windowbg2' align='right' width='20%'><center>Welcome back, "+dname+"<br/>"+time+"<br/><a href='#'>Top</a></center></td></td>"
var inforight = "<td class='windowbg' align='left' valign='middle' width='40%'><font size=1>Users Online ("+uoTot+"): [ Guests: <b>" + guests + "</b> ~ Members: <b> " + members + "</b> ~ Staff: <b> "+staff+"</b>]</font><hr width='100%' size='1px' color='#000000' style='position: relative; bottom: 1px;'><div style='position: relative; bottom: 4px;'><font size=1>" + memo[1] + "</font></div></td>"
var infoall = "<br/><br/><br/><br/><table width='100%' cellpadding='5' cellspacing='1' class='bordercolor' align='center' style='padding-top:0px;'>"+infoleft+""+infocent+""+inforight+"</tr></table>"
td[w].innerHTML = ""+totals+""+averages+""+pmcentall+""+infoall+""+legend+"";
}}}
//-->
</script>
Extras:
Update (March 13): I fixed a bug so now there is a link to the last poster.
Update (April 15): Xigna closed my account and all other free hosted ones. Please recopy the code. I fixed alot. Now, there is staff online. No more inputing moderators/colors. They are all default. So, if you have a code for moderators to be black, then my info center IS compatible with it. Also, if you want moderator colors, i recomend Skystrifes auto-moderator colors. Ok... the code is much shorter too. Finally, i fixed the line color (showed up as blue in IE).
Also, i updated the copyright. I may post it somewhere but anyone is free to repost or redistribute any of my codes (unless they were a request and the user wants it not used anywhere else). All you have to do is keep the top header (usually one or two lines including the "this header must stay in tact" and the code name
To inform you, this is the code that won the G101 Code Competition ;D