dz 6.0小修改:自动排版
<P></P><P></P>
<P></P>
<P>那天见一个转帖工具带自动排版功能,经过小修改放到论坛里,和大家共享(代码来自网上,非原创,仅仅做了适用于dz6.0的修改),我修改后的自动排版按钮放的地方是发帖的标题输入框后面,你可以按照自己的喜好随意变换位置。<BR><BR>修改的文件:<BR><FONT color=blue>viewthread.htm</FONT>:帖子阅读页面模板,用于快速发帖时的自动排版。<BR><FONT color=blue>post_newthread.htm</FONT>:发新帖模板<BR><FONT color=blue>post_newreply.htm</FONT>:发新回复模板<BR><FONT color=blue>post_editpost.htm</FONT>:帖子编辑模板。<BR><BR>方法为:分别在以上四个模板页面(常用的也就这几个了)查找如下代码(每个文件可能不太一样,但ID基本上都是subject): </P>
<DIV class=blockcode><SPAN class=headactions onclick=\"copycode($(\'code0\'));\">复制内容到剪贴板</SPAN>
<H5>代码:</H5><CODE id=code0><FONT face=新宋体><input type=\"text\" name=\"subject\" id=\"subject\" size=\"45\" value=\"$subject\" tabindex=\"3\" /></FONT></CODE></DIV>在下面添加:
<DIV class=blockcode><SPAN class=headactions onclick=\"copycode($(\'code1\'));\">复制内容到剪贴板</SPAN>
<H5>代码:</H5><CODE id=code1><FONT face=新宋体><input style=\"width: 120px; height: 24px;color:#FF3300;font-weight:bold;\"type=\"button\" value=\"帖子内容自动排版\"name=\"body\"title=\"系统自动排版\"class=button onClick=\"javascript:format()\"><BR><SCRIPT language=JavaScript type=text/JavaScript><BR>function format()<BR>{<BR>var body = \"\\n\"+document.getElementById(\"posteditor_textarea\").value;<BR>body = body.replace(/ | /ig,\"\");<BR>body = body.replace(/\\r\\n/ig,\"\\n\");<BR>body = body.replace(/\\n\\n/ig,\"\\n\");<BR>body = body.replace(/\\n\\n/ig,\"\\n\");<BR>body = body.replace(/\\n\\n/ig,\"\\n\");<BR>body = body.replace(/\\n\\n/ig,\"\\n\");<BR>body = body.replace(/\\n/ig,\"\\n\\n \");<BR>body = body.replace(\"\\n\\n\",\"\");<BR>body = body.replace(/\\?/g,\"\");<BR>body = body.replace(/\\?/g,\"\");<BR>body = body.replace(/,/g,\",\");<BR>body = body.replace(/;/g,\";\");<BR>body = body.replace(/\\?/g,\"?\");<BR>document.getElementById(\"posteditor_textarea\").value=body;<BR>}<BR></script></FONT></CODE></DIV>
<P>不想修改的直接覆盖吧。</P>
<P></P>
<P><BR></P>
[ 本帖最后由 蓝雨 于 2008-2-29 08:47 编辑 ]
页:
[1]