Post by Ћ€ Dog Monst€Я on Oct 20, 2006 4:00:33 GMT -8
Preview
This code will change your info center to the one that appears on the bottom of the preview page. The areas that the information appears in are set to show a scrollbar if the height of the information exceeds the pixel limit, so that the info center won't take too much space. On the preview page, you can see an example of a scrolling area.
[/size]This code will change your info center to the one that appears on the bottom of the preview page. The areas that the information appears in are set to show a scrollbar if the height of the information exceeds the pixel limit, so that the info center won't take too much space. On the preview page, you can see an example of a scrolling area.
Editing
The only editing you need to make concerns the groups that will appear in the info center with the amount of users from them currently logged. The red parts are names of groups.
The blue parts are the number of the group that will increase the amount of users that are logged on from the group (for example: Administrator is group no. 1 so you will write 1 there). If you want more than one group to increase the amount, write: (y|x). y is one group number and x is another. To add more group numbers, seperate with a | inside the brackets.
The orange parts are the color in which the name of the group will show up.
The purple parts should stay as they are, unless you want to tweak the amount of users logged on from the group.
The brown parts tell the code if the group is staff or not. If they are set to yes, the group is staff and if they are set to no, the group is not staff.
To add more groups, copy one of the rows that have group information in it and paste it inside the yellow brackets. Note that all rows of group information must have a comma at the end except the last one.
<script type="text/javascript">
/*El Codificador Vertical Info Center
Coded by The Dog Monster
Do not Edit or repost without permission*/
groups=[
['Administrator','(1|4)','FF0000','0','yes'],
['Global Moderator','2','0000FF','0','yes'],
['Moderator','3','00FF00','0','yes']
]
eventsMonth="<center>There are no events this month.</center>"
birthNow="<center>There are no birthdays today.</center>"
function falseLink(){
alert('This user has been deleted.')
}
if(location.href.match(/\.com(\/|.+cgi(\?|#.+|\?\w+=home)?)?$/i)){
infoTab=document.getElementsByTagName('td')
boardAmnt="0";
catAmnt="0";
for(t=0;t<infoTab.length;t++){
if(infoTab[t].innerHTML.match(/Info Center/i) && infoTab[t+1].innerHTML.match(/Forum Statistics/i) && !this.location.href.match(/(header|modify)/i)){
if(infoTab[t+3].innerHTML.match(/Total Topics: (\d+) /i)){
totalTopics=RegExp.$1
}
if(infoTab[t+3].innerHTML.match(/Total Posts: (\d+)<br/gi)){
totalPosts=RegExp.$1
}
if(infoTab[t+3].innerHTML.match(/Last Updated Topic: <a href="(.+?)">(.+?)<\/a>/gi)){
updatedLink=RegExp.$1
updatedName=RegExp.$2
}
if(infoTab[t+3].innerHTML.match(/by (<a|)(.+?)(a>|) \((.+?)\)/gi)){
firstA=RegExp.$1
updateByName=RegExp.$2
secondA=RegExp.$3
updatedOn=RegExp.$4
}
if(infoTab[t+3].innerHTML.match(/(\d+) Most Recent/gi)){
recentPosts=RegExp.$1
}
if(infoTab[t+5].innerHTML.match(/Total Members: <a href="(.+?)">(\d+)<\/a>/gi)){
newMembers=RegExp.$2
}
if(infoTab[t+5].innerHTML.match(/Newest Member: <a href=(")?(.+?)(")? (class=(")?(.+?)(")?)?>(.+?)<\/a>/gi)){
newMemLink=RegExp.$2
newMemName=RegExp.$8
}else if(infoTab[t+5].innerHTML.match(/Newest Member: (.+?)</gi)){
newMemName=RegExp.$1
newMemLink="javascript:falseLink()"
}
if(infoTab[t+5].innerHTML.match(/Your Private Messages: <a href="(.+?)">(\d+)<\/a> New: <a href="(.+?)">(\d+)<\/a>/gi)){
pmAmnt=RegExp.$2
pmNewAmnt=RegExp.$4
pmOldAmnt=Math.floor(pmAmnt-pmNewAmnt)
}
}
if(infoTab[t].className=="catbg" && infoTab[t].colSpan=="2" && infoTab[t].innerHTML.match(/Events This Month/i)){
eventsThis=infoTab[t+3].innerHTML
eventsMonth=eventsThis.split(',').join('<br/>')
}
if(infoTab[t].className=="catbg" && infoTab[t].colSpan=="2" && infoTab[t].innerHTML.match(/Today's Birthdays/i)){
birthdays=infoTab[t+3].innerHTML.split(/<br>/i)[1];
birthNow=birthdays.split(',').join('<br/>')
}
if(infoTab[t].className=="catbg" && infoTab[t].colSpan=="2" && infoTab[t].innerHTML.match(/Users Online/i)){
if(infoTab[t+3].innerHTML.match(/(, |>)(\d+) Staff Member/gi)){
staffOnline=RegExp.$2 //Currently not used in the code
}
if(infoTab[t+3].innerHTML.match(/(, |>)(\d+) Guest/gi)){
guestOnline=RegExp.$2
}
if(infoTab[t+3].innerHTML.match(/(, |>)(\d+) Member/gi)){
memberOnline=RegExp.$2
}
onlineMems=infoTab[t+3].innerHTML.split(/<br>/i)[1].split(',')
onlineNames=onlineMems.join('<br/>')
for(z=0;z<groups.length;z++){
for(s=0;s<onlineMems.length;s++){
if(onlineMems.match('group'+groups[z][1])){
groups[z][3]++
if(groups[z][4]=="no"){
memberOnline--
}
}
}
}
}
if(infoTab[t].innerHTML.match(/<img/gi) && infoTab[t+1].width=="66%" && infoTab[t+1].className=="windowbg2"){
boardAmnt++
}
if(infoTab[t].className=="catbg" && infoTab[t+1].width=="8%" && infoTab[t+1].className=="windowbg"){
catAmnt++
}
}
averagePosts=Math.round(totalPosts/boardAmnt)
averageTopics=Math.round(totalTopics/boardAmnt)
averageBoards=Math.round(boardAmnt/catAmnt)
for(t=0;t<infoTab.length;t++){
if(infoTab[t].align=="right" && infoTab[t].innerHTML.match(/Forum Jump/i)){
infoTab[t].parentNode.parentNode.parentNode.style.display="none"
forJ=infoTab[t].innerHTML
forJA=infoTab[t].align
}
}
var infoCenter="Info Center"
infTable='<table width="92%" cellspacing="0" cellpadding="0" align="center"><tr><td valign="top" width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0" class="bordercolor"><tr><td><table cellpadding="4" cellspacing="1" border="0" width="100%">'
infTable+='<tr><td colspan="4" class="titlebg" width="100%" align="center"><font size="2" style="font-weight:bold;">'+infoCenter+'</font></td></tr>'
infTable+='<tr class="catbg" align="center"><td width="25%">Important Stats</td><td width="25%">Member Info</td><td width="25%">Online Members</td><td width="25%">Events & Birthdays</td></tr>'
infTable+='<tr valign="top">'
infTable+='<td width="25%" align="left" class="windowbg"><div style="display:inline" width="95%">Numeric<hr size="1" class="hr" width="25%"/>[<b>Categories:</b> '+catAmnt+']<br/>[<b>Boards:</b> '+boardAmnt+' | <i>Per Category:</i> '+averageBoards+']<br/>[<b>Topics:</b> '+totalTopics+' | <i>Per Board:</i> '+averageTopics+']<br/>[<b>Posts:</b> '+totalPosts+' | <i>Per Board:</i> '+averagePosts+']<br/><br/>Posting<hr size="1" class="hr" width="25%"/><i>View <a href="index.cgi?action=recent">'+recentPosts+' Newest</a> Posts</i><br/>[<b>Last Update In:</b> <a href="'+updatedLink+'">'+updatedName+'</a>]<br/>[<b>Made By:</b> '+firstA+''+updateByName+''+secondA+']<br/>[<b>On:</b> <i>'+updatedOn+'</i>]</div></td>'
infTable+='<td width="25%" align="left" class="windowbg2"><div style="display:inline" width="95%">General<hr size="1" class="hr" width="25%"/>[<b>Total Members:</b> '+newMembers+']<br/>[<b>Our Newest:</b> <i><a href="'+newMemLink+'">'+newMemName+'</a></i>]<br/><br/>Personal Information<hr size="1" class="hr" width="25%"/>'
if(pb_username!="Guest"){
infTable+='[<b>Display Name:</b> '+pb_displayname+']<br/>[<i>User Name:</i> <a href="/index.cgi?action=viewprofile">'+pb_username+'</a>]<br/>[<b>Personal Messages:</b> <a href="/index.cgi?action=pm">'+pmAmnt+'</a>]<br/>[<i>New:</i> '+pmNewAmnt+' | <i>Old:</i> '+pmOldAmnt+']'
}else{
infTable+='<div width="50%" class="windowbg">You may not view this section of the info center as a guest. Please <a href="/index.cgi?action=login">Login</a> or <a href="/index.cgi?action=register">Register</a></div>'
}
infTable+='</div></td>'
infTable+='<td width="25%" align="left" class="windowbg"><div style="display:inline" width="95%">Online Stats<hr size="1" class="hr" width="25%"/><div style="width:100%; height:55px; overflow-y:auto; overflow-x:hidden;">'
for(t=0;t<groups.length;t++){
infTable+=groups[t][3]+' <font style="color:'+groups[t][2]+';">'+groups[t][0]+'</font><br/>'
}
infTable+=memberOnline+' Members<br/><a href="javascript:popWindow(\'viewguests\')">'+guestOnline+'</a> Guests</div>'
infTable+='<br/><br/>Online Members<hr size="1" class="hr" width="25%"/><div style="width:100%; height:100px; overflow-y:auto; overflow-x:hidden;">'+onlineNames+'</div></div></td>'
infTable+='<td width="25%" align="left" class="windowbg2"><div style="display:inline" width="95%">Events<hr size="1" class="hr" width="25%"/><div style="width:100%; height:65px; overflow-y:auto; overflow-x:hidden;">'+eventsMonth+'</div><br/>Birthdays<hr size="1" class="hr" width="25%"/><div style="width:100%; height:65px; overflow-y:auto; overflow-x:hidden;">'+birthNow+'</div></div></td>'
infTable+='</tr>'
infTable+='</table></td></tr></table></td></tr><tr><td align="'+forJA+'">'+forJ+'</td></tr></table>'
document.write(infTable)
for(t=0;t<infoTab.length;t++){
if(infoTab[t].innerHTML.match(/Info Center/i) && infoTab[t+1].innerHTML.match(/Forum Statistics/i) && infoTab[t].className=="titlebg"){
infoTab[t].parentNode.parentNode.parentNode.parentNode.style.display="none"
}
}
}
</script>