inherit
Beware the ever changing head
33588
0
Nov 18, 2023 0:32:44 GMT -8
Ross
19,039
November 2004
elindir
|
Post by Ross on Jul 3, 2007 11:16:00 GMT -8
Global Footer
Similar to the one written by Wonder except this one displays in the Mini-profile rather than the full profile. However, because the full registration date is not shown in the mini-profile it is nowhere near as accurate, the code presumes they registered on the 15th since that's the middle of the month.
<script type="text/javascript"> <!--
/* Addon to Average Posts Per Day - Adds to MP */
var months = new Array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); var date = new Date(); var year = date.getYear(); if(year <= 1900) year += 1900 var month = date.getMonth(); var td = document.getElementsByTagName('td'); for(i=0; i<td.length; i++) { if(td.item(i).width == '20%' && td.item(i).innerHTML.match(/Joined: (\w{3})\s(\d{4})/)) { var total_days = date.getDate() - 15; for(m=0; m<months.length; m++) { if(months[m] == RegExp.$1) { reg_month = m; break; } } var total_months = month - reg_month; total_days += (total_months * 30); var total_years = year - parseInt(RegExp.$2); total_days += 365 * total_years; td.item(i).innerHTML.match(/Posts: (.+?)(<|$)/); posts = parseInt(RegExp.$1.replace(/,/g, '')); average = Math.ceil((posts / total_days) * 100) / 100 td.item(i).innerHTML = td.item(i).innerHTML.replace(/(Posts: .+?)(<|$)/, '$1/'+ average +' per day$2'); } } //--> </script>
|
|