=====================================================================
||HACK:[V]发帖全面 自动检查字数 [快速回复,发新主题,编辑帖子,回复主题均有] For Dz5.0+4.X
||作者: 折翼の天使♂
||性质: 绿色 人性化 美化
||安装: 易
||发新帖演示: http://www.rplive.cn/post.php?ac ... &extra=page%3D1
||快速回复演示: http://www.rplive.cn/thread-2220-1-1.html
||更多HACK请见: http://www.rplive.cn
=====================================================================
===================================================
这是FOR DZ5的..FOR4.X的在2楼
========================================================================
快速回复 自动检查
打开 viewthread.htm
找 - <span class="smalltxt"><textarea
复制代码
注 5.00RC2 找
- <div style="width: 97%" class="smalltxt">
复制代码
前面加
- <table><tr><td width="65" class="header">[{lang post_check_length}]</td><td class="altbg1"><span class="smalltxt"><span id=show_leave ></span></td></tr></table>
复制代码
找
下面加
- <script language="JavaScript">function showleave() {
- if (postmaxchars != 0) in_message = "<br> 限 <b><font face="Gulim" color="#808000">"+postminchars+"--"+postmaxchars+"</font></b> 字节"; else in_message = "";
- nowtxt=document.input.message.value; nowtxt=nowtxt.replace(/[^\x00-\xff]/g,"ab").length; leavetxt=eval(postmaxchars-nowtxt);
- if(leavetxt==0) alert(" 你输入的字数已达到限制个数:"+postmaxchars);
- if(leavetxt< 0) alert(" 你输入的字数超过限制个数: 超出"+eval(nowtxt-postmaxchars)+"个");
- document.getElementById('show_leave').innerHTML= " 现 <b><font face="Gulim" color="#FF0000">"+nowtxt+"</font></b> 字节 剩 <b><font face="Gulim" color="blue">"+leavetxt+"</font></b> 字节"+in_message;
- }
- </script>
复制代码
找
- onKeyDown="ctlent(event);"
复制代码
前面加上:
- onKeyUp="javascript: storeCaret(this);showleave();"
复制代码
===========================================================================
发新主题,编辑帖子,回复主题 自动检查
打开post_sminsert.htm
最顶部加
- <script language="JavaScript">
- function showleave() {
- if (postmaxchars != 0) in_message = "<br> 限 <b><font face="Gulim" color="#808000">"+postminchars+"--"+postmaxchars+"</font></b> 字节"; else in_message = "";
- nowtxt=document.input.message.value; nowtxt=nowtxt.replace(/[^\x00-\xff]/g,"ab").length; leavetxt=eval(postmaxchars-nowtxt);
- if(leavetxt==0) alert(" 你输入的字数已达到限制个数:"+postmaxchars);
- if(leavetxt< 0) alert(" 你输入的字数超过限制个数: 超出"+eval(nowtxt-postmaxchars)+"个");
- document.getElementById('show_leave').innerHTML= " 现 <b><font face="Gulim" color="#FF0000">"+nowtxt+"</font></b> 字节 剩 <b><font face="Gulim" color="blue">"+leavetxt+"</font></b> 字节"+in_message;
- }
- </script>
复制代码
找
- <!--{if isset($trade) && $allowposttrade}-->{lang post_trade_description}:<!--{elseif isset($activity) && $allowpostactivity}-->{lang activity_description}:<!--{else}-->{lang message}:<!--{/if}--><br><br>
复制代码
替换成
- <table><tr><td width="65" class="header">[{lang post_check_length}]</td><td class="altbg1"><span class="smalltxt"><span id=show_leave ></span></td></tr></table><br>
复制代码
打开 post_newthread.htm post_newreply.htm post_editpost.htm
- onKeyUp="javascript: storeCaret(this);
复制代码
后面加
==============================================================================
==============================================================================
[ 本帖最后由 折翼の天使♂ 于 2007-3-12 07:42 编辑 ] |