inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Sept 22, 2005 12:48:10 GMT -8
With this code you can change the topics and posts for a board on the main page.
<script type="text/javascript"> <!--
// Created by PopThosePringles // 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
|
|