Post by coolcoolcool on Mar 23, 2007 18:27:18 GMT -8
Description: Puts the total amount of boards and categories in info center. It moves the total members, posts, and threads into a seperate location in order to make it look good.
Example:
Total Topics: 12 - Total Posts: 15 - Total Boards: 3 - Total Categories: 2 - Total Members: 2
Last Updated Topic: DFSD by CXVCXVC (Today at 1:04am)
View the 10 most recent posts of this forum. Newest Member: sdfdf
Your Private Messages: 0 New: 0
Compatibility: Tested in Internet Explorer 6.0, and Firefox 2
Location: Main Footer
<script type="text/javascript">
// Add Categories and Boards to info center
// do not edit below
var resize;
var row;
var cell;
var td = document.getElementsByTagName("td");
var counter_for_info = {
boards: 0,
categories: 0,
topics: "",
posts: "",
members: ""
};
var count_for_info = {
init: function(){
this.countit();
},
countit: function(){
for(i = td.length-1; i > -1; i--){
if(td.item(i).className.match(/catbg/i) && td.item(i).firstChild.name != undefined){
counter_for_info.categories++;
} else if(td.item(i).className.match(/windowbg/i) && td.item(i).width=="66%"){
counter_for_info.boards++;
}
}
this.implement();
},
implement: function(){
for(j = td.length-1; j > -1; j--){
if(td.item(j).width=="40%" && td.item(j).innerHTML.match(/member/i)){
td.item(j).innerHTML = td.item(j).innerHTML.replace(/total members:.+?>(\d+)<\/.><(br|BR).?>/i, "");
counter_for_info.members = RegExp.$1;
} else if(td.item(j).width=="60%" && td.item(j).innerHTML.match(/total/i)){
td.item(j).innerHTML = td.item(j).innerHTML.replace(/total topics: (\d+).+-.+total posts: (\d+?)<(br|BR).?>/i, "");
counter_for_info.topics = RegExp.$1;
counter_for_info.posts = RegExp.$2;
row = td.item(j).parentNode.parentNode.insertRow(0);
cell = row.insertCell(0);
cell.colSpan = "2";
resize = document.createElement("font");
resize.size = "1";
resize.innerHTML = "Total Topics: " + counter_for_info.topics + " - Total Posts: " + counter_for_info.posts + " - Total Boards: " + counter_for_info.boards + " - Total Categories: " + counter_for_info.categories + " - Total Members: " + counter_for_info.members;
cell.appendChild(resize);
cell.align = "center";
break;
}
}
}
};
count_for_info.init();
</script>
Example:
Total Topics: 12 - Total Posts: 15 - Total Boards: 3 - Total Categories: 2 - Total Members: 2
Last Updated Topic: DFSD by CXVCXVC (Today at 1:04am)
View the 10 most recent posts of this forum. Newest Member: sdfdf
Your Private Messages: 0 New: 0
Compatibility: Tested in Internet Explorer 6.0, and Firefox 2
Location: Main Footer
<script type="text/javascript">
// Add Categories and Boards to info center
// do not edit below
var resize;
var row;
var cell;
var td = document.getElementsByTagName("td");
var counter_for_info = {
boards: 0,
categories: 0,
topics: "",
posts: "",
members: ""
};
var count_for_info = {
init: function(){
this.countit();
},
countit: function(){
for(i = td.length-1; i > -1; i--){
if(td.item(i).className.match(/catbg/i) && td.item(i).firstChild.name != undefined){
counter_for_info.categories++;
} else if(td.item(i).className.match(/windowbg/i) && td.item(i).width=="66%"){
counter_for_info.boards++;
}
}
this.implement();
},
implement: function(){
for(j = td.length-1; j > -1; j--){
if(td.item(j).width=="40%" && td.item(j).innerHTML.match(/member/i)){
td.item(j).innerHTML = td.item(j).innerHTML.replace(/total members:.+?>(\d+)<\/.><(br|BR).?>/i, "");
counter_for_info.members = RegExp.$1;
} else if(td.item(j).width=="60%" && td.item(j).innerHTML.match(/total/i)){
td.item(j).innerHTML = td.item(j).innerHTML.replace(/total topics: (\d+).+-.+total posts: (\d+?)<(br|BR).?>/i, "");
counter_for_info.topics = RegExp.$1;
counter_for_info.posts = RegExp.$2;
row = td.item(j).parentNode.parentNode.insertRow(0);
cell = row.insertCell(0);
cell.colSpan = "2";
resize = document.createElement("font");
resize.size = "1";
resize.innerHTML = "Total Topics: " + counter_for_info.topics + " - Total Posts: " + counter_for_info.posts + " - Total Boards: " + counter_for_info.boards + " - Total Categories: " + counter_for_info.categories + " - Total Members: " + counter_for_info.members;
cell.appendChild(resize);
cell.align = "center";
break;
}
}
}
};
count_for_info.init();
</script>