mrthomas
Not New Member
Posts: 9
mrthomas said 0 great things
|
Post by mrthomas on Jun 24, 2010 23:01:03 GMT -8
Hello... I installed the posting activity meter but I was wondering where to get the "Longevity" code?
|
|
|
Post by Wormopolis on Jun 25, 2010 11:18:40 GMT -8
I'm not sure I ever really published that one... I didnt think anyone else would want it.
Its based off the site's start date, so you will have to edit that. and since the MP doesnt have the ACTUAL start day, only the start month, if a new user joins at the end of the month his marker isnt all the way to the left. After a few months, however, it becomes moot.
<script type="text/javascript"> <!-- // longevity meter in MP v1.0 // by Wormopolis - www.wormocodes.com // keep header intact - do not repost // thanks to rhondairv for the idea
var forumStartDate="Nov 2008";
function getColor(n) { red=parseInt(2.55*(100-n)); green=parseInt(2.55*(n)); return ((red<16?'0':'') + red.toString(16) + (green<16?'0':'') + green.toString(16) + '00'); }
tstArray=['jan','feb','mar','apr','may','jun','jul','aug','sept','oct','nov','dec']; stDate=new Date(); for (m=0; m<tstArray.length; m++) { if (forumStartDate.split(' ')[0].toLowerCase()==tstArray[m]) break; } stDate.setMonth(m); stDate.setDate(1); stDate.setFullYear(forumStartDate.split(' ')[1]); curDate=new Date(); monthsAlive=Math.round((curDate-stDate)/(1000*60*60*24*30.5)); monthsAlive=(monthsAlive<1 ? 1 : monthsAlive);
for (tds=document.getElementsByTagName('td'), t=0; t<tds.length; t++) { if (tds[t].width=='20%' && tds[t].className.match(/windowbg/) && tds[t].vAlign=='top' && tds[t].innerHTML.match(/joined: (.*?) (\d+)<br>/i)) { datechkM=RegExp.$1; datechkY=RegExp.$2; for (m=0; m<tstArray.length; m++) { if (datechkM.toLowerCase()==tstArray[m]) break; } jDate=new Date(); jDate.setDate(1); jDate.setYear(datechkY); jDate.setMonth(m); cDate=new Date(); timeSpan=Math.round((cDate-jDate)/(1000*60*60*24*30.5)); //timeSpan=(timeSpan<1 ? 1 : timeSpan); longet=parseInt(100*(timeSpan/(monthsAlive*1.0))); notch=(longet>100 ? 100 : longet); for (br=tds[t].getElementsByTagName('br'), b=0; b<br.length; b++) { if (br[b].nextSibling && br[b].nextSibling.nodeName.match(/text/) && br[b].nextSibling.nodeValue.match(/joined:/i)) { spot=br[b].nextSibling.nextSibling; break; } } nwdv=document.createElement('div'); nwdv.width='100%'; nwdv.vAlign='middle'; nwdv.style.height=20; nwdv.align='center' hdr=nwdv.appendChild(document.createElement('font')); hdr.innerHTML='Longevity'; hdr.size=1; nwtbl=nwdv.appendChild(document.createElement('table')); nwtbl.cellSpacing=nwtbl.cellPadding=0; nwtbl.insertRow(0); for (i=0; i<=100; i++) { nwcl=nwtbl.rows[0].insertCell(-1); nwcl.style.width='1'; nwcl.style.height='20'; nwcl.vAlign='middle'; cdiv=nwcl.appendChild(document.createElement('div')); cdiv.style.width='1'; if (i==notch) { cdiv.style.height='20'; cdiv.style.backgroundColor='ffffff'; } else { cdiv.style.height='5'; test=getColor(i); cdiv.style.backgroundColor=getColor(i); } } spot.parentNode.insertBefore(nwdv,spot);
} } // --> </script>
|
|
mrthomas
Not New Member
Posts: 9
mrthomas said 0 great things
|
Post by mrthomas on Jun 25, 2010 12:38:06 GMT -8
Thanks for sharing the code... There is just one minor problem... since I have recently applied the script, now my "Posting Activity Meter" looks bigger... the two meters are not the same size.... any suggestions? I've placed both scripts in the "Global Footer" and I currently have no other scripts running on the forum. If you click the link below it will take you to my forum... hopefully you will be able to see what's going on... registration is not required. phoenix-united.proboards.com
|
|
|
Post by Wormopolis on Jun 25, 2010 21:45:04 GMT -8
find this line:
cdiv.style.height='5';
change to
cdiv.style.height='8px';
|
|
mrthomas
Not New Member
Posts: 9
mrthomas said 0 great things
|
Post by mrthomas on Jun 26, 2010 11:06:56 GMT -8
Ha! I fixed it =)
Now I will try and apply the colorsmear script again... last time it seemed as if it broke my activity posting meter lol.... if I have problems with it should I open a new thread?
|
|
|
Post by Wormopolis on Jun 26, 2010 12:05:34 GMT -8
or continue with the posts in the activity meter thread you already have.
and again.. If I have a URL I can look at, I can troubleshoot easier.
|
|
mrthomas
Not New Member
Posts: 9
mrthomas said 0 great things
|
Post by mrthomas on Jun 26, 2010 18:17:07 GMT -8
Seems as if everything is working now... for future reference you may access our forum here... "http://phoenix-united.proboards.com".
Thanks for all your help wormo! YOU ROCK!
|
|
|
Post by Wormopolis on Jun 26, 2010 18:28:56 GMT -8
FINALLY! lol!
and thank you for flying Wormo Airlines...
|
|