Post by Tressa on Nov 13, 2012 19:47:19 GMT -8
Anyone else still using this code? Could it, or something similar, be made into a plugin?
<script type="text/javascript">
<!--
/* Forum Age Inside Info Center by UnChained */
/* Please leave this header intact. Do not repost. */
/* http://proboardcoding.proboards58.com */
var startMessage= "The STO forum is: "; // Start message.
var endMessage= "old."; // End message.
var startDate= "2007 September 07"; // Forum start date.
// Do Not Edit Below.
var td=document.getElementsByTagName('td');
if(location.href.match(/com\/?((\index\.cgi)?\??(action=(change.+?|home))?)?(#.+)?$/)){
function showDate(){
for(x=0;x<td.length;x++){
if(td[x].className.match(/catbg/i) && td[x].innerHTML.match(/Forum Statistics/i)){
var aDate= new Date(startDate);
var bDate= new Date();
var eTime= bDate-aDate;
var xDays= parseInt(eTime/86400000);
var xHours= parseInt((eTime-(xDays*86400000))/3600000);
var xMin= parseInt((eTime-(xDays*86400000)-(xHours*3600000))/60000);
var xSec= bDate.getSeconds();
var xYears= parseInt(xDays/365);
var xMonths= parseInt((xDays-(xYears*365))/30);
var yDays= parseInt((xDays-(xYears*365)-(xMonths*30)));
var zYears= "year"; if(xYears !=1){zYears +="s,"}
var zMonths= "month"; if(xMonths !=1){zMonths +="s,"}
var zDays="day"; if(yDays !=1){zDays +="s,"}
var zHours="hour"; if(xHours !=1){zHours +="s,"}
var zMinutes="minute"; if(xMin !=1){zMinutes +="s,"}
var zSeconds="second"; if(xSec !=1){zSeconds +="s,"}
td[x+2].innerHTML+=startMessage+xYears+" "+zYears+" "+xMonths+" "+zMonths+" "+yDays+" "+zDays+" "+xHours+" "+zHours+" "+xMin+" "+zMinutes+" and "+xSec+" "+zSeconds+" "+endMessage;
break;
}
}
}
}
showDate();
//-->
</script>