此修改为防止网站超时或者是其他的原因导致会员发送写好帖子内容却在点发表时,因发送不成功,导致内容丢失,前功尽弃。修改后,发表前内容将被同时复制到系统剪贴板,只要使用粘贴,即可找回帖子内容.
具体修改办法如下:
1、快速回复的修改,打开后台风格模板总管理page_dispbbs temp(0),找到
var cookiesstr=readCookie(‘mofaface_‘+ topicid);
if (cookiesstr ==null){
createCookie(‘mofaface_‘+ topicid,MagicID,365)
DispMagicEmot(MagicID,350,500)
}
}
</script>
在</script>上面添加下面代码
function CopyBody()
{
IframeID.focus();
IframeID.document.execCommand(‘selectAll‘);
IframeID.document.execCommand(‘copy‘);
alert("你发表的内容已被复制到剪贴板,如果发帖不成功,请在编辑框中按下CTRL+V即可找回帖子内容!")
}
修改结果如下:红色部分即增加的代码!
var cookiesstr=readCookie(‘mofaface_‘+ topicid);
if (cookiesstr ==null){
createCookie(‘mofaface_‘+ topicid,MagicID,365)
DispMagicEmot(MagicID,350,500)
}
}
function CopyBody()
{
IframeID.focus();
IframeID.document.execCommand(‘selectAll‘);
IframeID.document.execCommand(‘copy‘);
alert("你发表的内容已被复制到剪贴板,如果发帖不成功,请在编辑框中按下CTRL+V即可找回帖子内容!")
}
</script>
2、然后找到
<form id="Dvform" name="Dvform" action="savepost.asp?action=sre&method=fastreply&BoardID={post/postinfo/@boardid}" onkeydown="ctlent();" onsubmit="Dvbbs_CopyData(‘Body‘);" method="post">
修改为下面代码,红色为添加部分
<form id="Dvform" name="Dvform" action="savepost.asp?action=sre&method=fastreply&BoardID={post/postinfo/@boardid}" onkeydown="ctlent();" onsubmit="CopyBody(); Dvbbs_CopyData(‘Body‘);" method="post">
3、主题发布的修改,打开后台风格模板总管理page_post temp(0),找到
<form name="Dvform" method="post" action="{$toaction}" onsubmit="Dvbbs_CopyData(‘Body‘);return Checkpostdata();">
修改为下面代码,
<form name="Dvform" method="post" action="{$toaction}" onsubmit="CopyBody(); Dvbbs_CopyData(‘Body‘);return Checkpostdata();">
4、找到
function showtitle()
在上面增加
function CopyBody()
{
IframeID.focus();
IframeID.document.execCommand(‘selectAll‘);
IframeID.document.execCommand(‘copy‘);
alert("你发表的内容已被复制到剪贴板,如果发帖不成功,请在编辑框中按下CTRL+V即可找回帖子内容!")
}
OK!修改完成!
这个修改在发贴时会出现提示窗,"你发表的内容已被复制到剪贴板,如果发帖不成功,请在编辑框中按下CTRL+V即可找回帖子内容!"
如果你不想要提示窗,那么请按下面的方法修改:
1. 去掉上面1. 4.步代码中的这句代码,下面红色显示,此句为提示窗,其他修改同上!
alert("你发表的内容已被复制到剪贴板,如果发帖不成功,请在编辑框中按下CTRL+V即可找回帖子内容!")
2.主题发布的修改,在动网默认风格分页面模板(page_post)界面风格管理,----template.html(0),找到
④ 如果您觉得自己的帖子有一定价值,或管理人员希望用户付出一定代价才能浏览相关内容,可发起金币购买贴<br />
在下面增加一句提示代码
<font color="#FF0000"><img src="skins/Default/ztop.gif"> 发贴时内容将被复制到剪贴板,如果发贴失败,请重新在编辑框中用鼠标右键粘贴或用"CTRL+V"即可找回帖子内容!</font><br/>
或者(没有图片的提示)
<font color="#FF0000">★发贴时内容将被复制到剪贴板,如果发贴失败,请重新在编辑框中用鼠标右键粘贴或用"CTRL+V"即可找回帖子内容!★</font><br/>
3.快速回复的修改,后台风格模板总管理page_dispbbs temp(0),找到
<div class="postlary2" style="height:28px;line-height:28px;border-top:0px; " >
<div class="postuserinfo" style="height:28px;"><input type="checkbox" checked="checked" value="yes" name="signflag" /><b>显示签名</b></div>
<div class="postie" style="height:28px;padding:0px;text-indent:10px;text-align:left; "><div>
<input type="Submit" value="OK!发表回复" name="Submit" style="margin:3px;"/> <input type="button" value="预 览" name="Button" style="margin:3px;" onclick="Gopreview()" /> <input style="margin:3px;" type="reset" name="Clear" value="清空内容!" onclick="ClearReset()"/>
内容限制:<input class="Dvbbs_Reply" disabled="disabled" maxLength="6" size="8" value="{post/setting/@maxpostlen}" name="total" /> 字节.
</div></div>
修改为下面代码,红色为修改和增加部分
<div class="postlary2" style="height:50px;line-height:28px;border-top:0px; " >
<div class="postuserinfo" style="height:28px;"><input type="checkbox" checked="checked" value="yes" name="signflag" /><b>显示签名</b></div>
<div class="postie" style="height:50px;padding:0px;text-indent:10px;text-align:left; "><div>
<input type="Submit" value="OK!发表回复" name="Submit" style="margin:3px;"/> <input type="button" value="预 览" name="Button" style="margin:3px;" onclick="Gopreview()" /> <input style="margin:3px;" type="reset" name="Clear" value="清空内容!" onclick="ClearReset()"/>
内容限制:<input class="Dvbbs_Reply" disabled="disabled" maxLength="6" size="8" value="{post/setting/@maxpostlen}" name="total" /> 字节.
<br /><font color="#FF0000">★发贴时内容将被复制到剪贴板,如果发贴失败,请重新在编辑框中用鼠标右键粘贴或用"CTRL+V"即可找回帖子内容!★</font>
</div></div>
按照以上的方法修改,很好用,不过有一点不足,如果用快捷键Ctrl+Enter发送则会无效
经过研究,终于发现修改方法
找到 BBS目录/images/post/DhtmlEdit.js文件,打开,查找如下内容:
function ctlent(){
var ispost=0;
if (document.all)
{
if(event.ctrlKey && event.keyCode==13)
{
Dvbbs_CopyData(‘Body‘)
Checkdata()
if (ischeck==true){this.document.Dvform.submit();}
}
}
}
修改成如下:
function ctlent(){
var ispost=0;
if (document.all)
{
if(event.ctrlKey && event.keyCode==13)
{
CopyBody()
Dvbbs_CopyData(‘Body‘)
Checkdata()
if (ischeck==true){this.document.Dvform.submit();}
}
}
}
找到 BBS目录/images/post/reply.js文件,打开,查找如下内容(文件最后一段):
var ispost=0;
function ctlent(){
if (document.all)
{
if(event.ctrlKey && event.keyCode==13&&ispost==0)
{
ispost=1;
Dvbbs_CopyData(‘Body‘)
this.document.Dvform.submit();
}
}
}
修改成如下:
var ispost=0;
function ctlent(){
if (document.all)
{
if(event.ctrlKey && event.keyCode==13&&ispost==0)
{
CopyBody()
ispost=1;
Dvbbs_CopyData(‘Body‘)
this.document.Dvform.submit();
}
}
}
红色部分为添加的内容,记住前提是您已经按照原帖修改完毕,
经此修改之后,发帖、交易帖、投票帖、快速回复和回复都能实现按快捷键发送时复制功能.
但是有一点,在文本编辑框里编辑完以后鼠标必须移到编辑框以外任何地方点击一下,
这样才能实现快捷发帖时的复制,这也算是个遗憾!
联系客服