Post by Todge on Aug 29, 2009 9:23:44 GMT -8
This will replace the most recent 10 posts with the most recently updates THREADS on your forum..
You will need to go into your admin panel and, in General Settings, increase the 'Display Recent Posts' number.. The higher the number the more likely you'll get the full 10 threads, but also the slower the code will sort the posts.. I suggest 50..
And put this in your Main Footer...
No editing is required.
You will need to go into your admin panel and, in General Settings, increase the 'Display Recent Posts' number.. The higher the number the more likely you'll get the full 10 threads, but also the slower the code will sort the posts.. I suggest 50..
And put this in your Main Footer...
<script type="text/javascript">
<!--
/*
Top 10 threads instead of posts..
By Todge
Copyright © 2009
Please keep this header intact
*/
if(location.href.match(/tion=recent/))
{
var threads = new Array();
var peeps = new Array();
var posts = document.links;
for(p=0; p<posts.length; p++)
{
if(posts[p].href.match(/thread=(\d)+&/) && posts[p].parentNode.className == 'cattext')
{
var thisthread = 'thread='+posts[p].href.split('thread=')[1].split('page')[0];
if(!threads.join('').match(thisthread))
{
threads[threads.length] = posts[p].href+'|'+posts[p].innerHTML;
var mini = posts[p].parentNode.parentNode.parentNode.nextSibling.firstChild.getElementsByTagName('a');
var when = posts[p].parentNode.parentNode.parentNode.nextSibling.firstChild.nextSibling.innerHTML.split('»')[0].split(/Result #\d+/)[1];
if(mini.length !=2)
{
peeps[threads.length] = '<a href="'+mini[2].href+'">'+mini[2].innerHTML+'</a>'+when;
}
else
{
peeps[threads.length] = 'Guest'+when;
}
if(threads.length > 10)
{
break;
}}}}
var threadcount = 0;
var results = document.getElementsByTagName('b');
for(r=0; r<results.length; r++)
{
if(results[r].innerHTML.match(/(\d)+ Most Recent Posts/))
{
results[r].innerHTML = '10 Most Recent Threads';
}
if(results[r].innerHTML.match(/(\d)+ Results Found/))
{
results[r].innerHTML = threads.length-1+' Results Found';
}
if(results[r].innerHTML.match(/Result (\d)+ of 100:/))
{
threadcount++;
if(threadcount < threads.length)
{
results[r].innerHTML = 'Result '+threadcount+' of 10:';
var table = document.createElement('table');
var table1 = document.createElement('table');
var tbody = document.createElement('tbody');
var tbody1 = document.createElement('tbody');
var tr = document.createElement('tr');
var tr1 = document.createElement('tr');
var td = document.createElement('td');
var td1 = document.createElement('td');
var td2 = document.createElement('td');
with(table){className='bordercolor'; width='100%'}
with(table1){width='100%'}
tr1.appendChild(td1);
tr1.appendChild(td2);
tbody1.appendChild(tr1);
table1.appendChild(tbody1)
td.appendChild(table1);
tr.appendChild(td);
tbody.appendChild(tr);
table.appendChild(tbody);
with(td){className='catbg'; height='25px'; width='100%';}
with(td1){className='catbg'; width='50%'; innerHTML='<a href="'+threads[threadcount-1].split('|')[0]+'">'+threads[threadcount-1].split('|')[1]+'</a>';}
with(td2){className='catbg'; width='50%'; align='right'; innerHTML=peeps[threadcount];}
results[r].parentNode.replaceChild(table,results[r].nextSibling.nextSibling);
}
else
{
results[r].style.display='none';
results[r].nextSibling.style.display='none';
results[r].nextSibling.nextSibling.style.display='none';
results[r].nextSibling.nextSibling.nextSibling.style.display='none';
results[r].nextSibling.nextSibling.nextSibling.nextSibling.style.display='none';
}}}}
if(document.title.match(/- Home$/))
{
var recent = document.links;
for(r=0; r<recent.length; r++)
{
if(recent[r].innerHTML.match(/(\d)+ most recent posts/))
{
recent[r].innerHTML = '10 most recent threads';
}}}
// -->
</script>
No editing is required.