vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Database of Codes/Hacks/Mods :: Extra Board Stats - View Topic
Topic Rating: *****
Printable View
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Extra Board Stats (1st Apr 08 at 2:29pm UTC)
This code will add the following to the bottom of the board page:

1 Stickied Thread | 1 Locked Thread | 1 Announced Thread | 1 Sticky Lock Thread | 6 Normal Threads | 114 Views | 7 Replies

Which shows the various stats for that page.

<script>
/*Extra Board Stats.
Coded By Wrighty
Do Not Rip, Repost or Claim!*/

if(location.href.match(/\/board/) && !location.href.match(/topic/)){
    var a = s = sl = l = n = v = re = 0;
    var r = document.getElementsByTagName('tr');
    for(i=0;i<r.length;i++){
        if(r[i].cells[0].width == "6%"){
            var v = parseInt(v + (r[i].cells[3].firstChild.innerHTML.replace(/,/,'')*1));
            var re = parseInt(re + (r[i].cells[2].firstChild.innerHTML.replace(/,/,'')*1));
            var x = (r[i].cells[0].getElementsByTagName('img')[0].alt.match(/\[(.+?)\]/))? RegExp.$1 : '';
            switch(x){
                case 'A':
                    a++;
                    break;
                case 'SL':
                    sl++;
                    break;
                case 'L':
                    l++;
                    break;
                case 'S':
                    s++;
                    break;
                default:
                    n++;
            }
        }
        if(r[i].cells[0].width == "6%" && r[i+1].cells[0].className == 'title1'){
            var _r = document.createElement('tr');
            var _d = document.createElement('td');
            var _f = document.createElement('font');
            _s = (s == 1)? '' : 's';
            _a = (a == 1)? '' : 's';
            _sl = (sl == 1)? '' : 's';
            _l = (l == 1)? '' : 's';
            _n = (n == 1)? '' : 's';
            _v = (v == 1)? '' : 's';
            _re = (re == 1)? 'Reply' : 'Replies';
            with(_f){
                appendChild(document.createTextNode(s + ' Stickied Thread' + _s));
                appendChild(document.createTextNode(' | '));
                appendChild(document.createTextNode(l + ' Locked Thread' + _l));
                appendChild(document.createTextNode(' | '));
                appendChild(document.createTextNode(a + ' Announced Thread' + _a));
                appendChild(document.createTextNode(' | '));
                appendChild(document.createTextNode(sl + ' Sticky Lock Thread' + _sl));
                appendChild(document.createTextNode(' | '));
                appendChild(document.createTextNode(n + ' Normal Thread' + _n));
                appendChild(document.createTextNode(' | '));
                appendChild(document.createTextNode(v + ' View' + _v));
                appendChild(document.createTextNode(' | '));
                appendChild(document.createTextNode(re + ' ' + _re));
                size = '1';
            }
            with(_d){
                className = 'title2';
                appendChild(_f);
                colSpan = '5';
                align = "center";
            }
            _r.appendChild(_d);
            r[i].parentNode.insertBefore(_r, r[i+1]);
            break;
        }
    }
}
</script>


Global Footer
 Printable View

All times are GMT+0 :: The current time is 1:15pm
Page generated in 0.2189 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums