Peter
Junior Member
Coding God
Posts: 50
|
Post by Peter on Apr 29, 2006 13:36:09 GMT
With this code you can change the topics and posts for a board on the main page. <script type="text/javascript"> <!--
// expertsonline.pixeldepth.net // Increase topics and posts for specific board
function changeTotals(board, topics, posts){ function formatNum(num){ var re = /(-?\d+)(\d{3})/; while(re.test(num)){ num = num.toString().replace(re, "$1,$2"); } return num; }
var topics = (topics)? topics : 0; var posts = (posts)? posts : 0; var bID = new RegExp("\\?board=" + board); var iCell = document.getElementsByTagName("td");
for(c = 0; c < iCell.length; c ++){ if(iCell.item(c).className == "windowbg" && iCell.item(c).width == "1%" && iCell.item(c).previousSibling.firstChild.innerHTML.match(bID)){ var curTopics = parseInt(iCell.item(c).firstChild.lastChild.nodeValue); var curPosts = parseInt(iCell.item(c).nextSibling.firstChild.lastChild.nodeValue); iCell.item(c).firstChild.lastChild.nodeValue = formatNum(parseInt(topics + curTopics)); iCell.item(c).nextSibling.firstChild.lastChild.nodeValue = formatNum(parseInt(posts + curPosts)); } } }
changeTotals("BOARD_ID", 0, 0);
//--> </script>changeTotals("BOARD_ID", TOPICS, POSTS); You can add more if needed. Main footer
|
|
|
Post by warrenfrancois on Oct 18, 2006 1:22:33 GMT
Does this code mean that you have more characters in the one post or?
|
|
ME!
Moderator
~Remanifesting-Eternal.~
Posts: 778
|
Post by ME! on Oct 18, 2006 14:59:02 GMT
no, it just increses the number of posts or topics for a specifc board. meaning the total number of posts...
|
|