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 Sept 13, 2005 7:04:46 GMT -8
Main FooterThis adds a section to the profile page showing the percentage of posts which that user has made <script type="text/javascript"> <!-- /* % of total posts in profile by elindir, do not edit or redistribute */ var td = document.getElementsByTagName('td'); for(i=0;i<td.length;i++) { if(td[i].width=="60%" && td[i].firstChild.innerHTML.match(/Total Posts: (.+?)</)) { document.cookie='totalPosts='+RegExp.$1.replace(/,/g,'')+';'; } else if(document.cookie.match(/totalPosts/) && td[i].width=="25%" && td[i].innerHTML.match(/>Posts:/)) { uPosts = parseInt(td[i+1].firstChild.innerHTML.replace(/,/g,'')); av=(uPosts/document.cookie.split('totalPosts=')[1].split(';')[0])*100; td[i].parentNode.parentNode.insertBefore(document.createElement('tr'),td[i].parentNode.nextSibling); obj=td[i].parentNode.nextSibling; obj.insertCell(0).innerHTML='<font size="2">% of Total Posts:</font>'; obj.insertCell(1).innerHTML+='<font size="2">'+Math.round(av*100)/100+'%</font>'; } } //--> </script>Note: In order for this code to work properly, guests should be able to view the majority of boards. Otherwise the percentage will look a bit strange to them.
|
|