- 積分
- 12
- 威望
- 12
- 金錢
- 12
- 最後登錄
- 2010-10-9
|
如果要改为[06-01]只要把return语句中引号里的.改为-就可以了.下同.
形式:[09.06.01]
第3统计处代码:- <script>function aDate(date){var year=date.getFullYear().toString().substring(2,4);var month = (date.getMonth() + 1)<10? "0" + (date.getMonth() + 1):(date.getMonth() + 1); var day = date.getDate()<10? "0" + date.getDate(): date.getDate();return year+"."+month + "." + day; }var sub= document.getElementById("subject"),date=new Date();if(document.getElementById("returnmessage")!=null&&document.getElementById("returnmessage").innerHTML.indexOf("发新话题")!=-1){if(sub&&sub.value==""){sub.value="[" + aDate(date) + "]";}}
- </script>
複製代碼 局部模式: (只要某个或者某几个版块)
第3统计处代码:- <script>function format(date){var year=date.getFullYear().toString().substring(2,4);var month = (date.getMonth() + 1)<10? "0" + (date.getMonth() + 1):(date.getMonth() + 1); var day = date.getDate()<10? "0" + date.getDate(): date.getDate();return year+"."+month + "." + day; }var sub= document.getElementById("subject"),date=new Date();if(location.href.indexOf("fid=2")!=-1&&document.getElementById("returnmessage")!=null&&document.getElementById("returnmessage").innerHTML.indexOf("发新话题")!=-1){if(sub&&sub.value==""){sub.value="[" + format(date) + "]";}}
- </script>
複製代碼 其中fid=2是发帖框那个IE浏览器地址栏上的.你要哪个版块就直接修改为那地址栏的数值就可以了. |
|