修改前:
修改后效果:
打开 /bbs/index.aspx
将
<td><asp:Literal ID="Literal_statistics" runat="server"></asp:Literal></td>
<td class="ar">
修改为
<td id="self_bbs_statistics"><asp:Literal ID="Literal_statistics" runat="server"></asp:Literal></td>
<td class="ar">
<script type="text/javascript">
function self_change_total(increase,re)
{
var obj=document.getElementById("self_bbs_statistics");
var val=obj.innerHTML.match(re)[0];val=val.substring(val.indexOf(">")+1);val=val.substring(0,val.indexOf("<"));
var newval=parseInt(val)+parseInt(increase);
obj.innerHTML=obj.innerHTML.replace(obj.innerHTML.match(re)[0],obj.innerHTML.match(re)[0].replace(val,newval));
}
self_change_total(100,/今日:<\/strong>(.*)<\/td>/ig);
self_change_total(120,/昨日:<\/strong>(.*)<\/td>/ig);
self_change_total(3000,/帖子:<\/strong>(.*)<\/td>/ig);
self_change_total(1000,/会员:<\/strong>(.*)<\/td>/ig);
</script>