Revolution X

Coding Community => Other Forum Coding => Topic started by: Vitality on November 03, 2008, 07:06:55 pm



Title: [IF] Add Today's Top 10 Posters Link To Index
Post by: Vitality on November 03, 2008, 07:06:55 pm
I went for another fairly simple code. This one does what the title says it does, it adds the "Today's top 10 posters" link next to the "Overall top 10 posters" link on the board index.

Admin CP - Footers

Preview: [url=http://z9.invisionfree.com/Vitcodetesting/index.php?act=idx]http://z9.invisionfree.com/Vitcodetesting/index.php?act=idx (http://z9.invisionfree.com/Vitcodetesting/index.php?act=idx)[/url]

Code:
<script type='text/javascript'>
<!--
//Code by Vitality of Phantom-Designs
var b = location.href.split("?")[0];
if(location.href.match(/act=idx||act=index||index.php?||index.php/i)){
var a=document.getElementsByTagName('div')
for(i=0;i<a.length;i++){
if(a[i].innerHTML.match('Overall top 10 posters')){
a[i].innerHTML += "| <a href='"+b+"?&act=Stats'>Today's top 10 posters</a>"
}}}
//-->
</script>