修改1:针对发贴和完整的回复模式。
打开"images/post/DhtmlEdit1.js"修改Checkpostdata函数(红色部分新增):
[color=Red]String.prototype.Trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"");}[/color]
function Checkpostdata(theform)
{
[color=Red]//检测文件是否上传
try{
if(frames["ad"].document.forms["form"].file1)
{
if((frames["ad"].document.forms["form"].file1.value).Trim() != "")
{
if(! confirm("文件还没有上传,确定不传吗?"))
{
frames["ad"].document.forms["form"].file1.focus();
return false;
}
}
}
}
catch(e){}[/color]
Dvbbs_CopyData('Body');
Checkdata();
if (ischeck==false)
{
return false;
}
else{
try{
if (typeof(ajaxpost) != "undefined")
return ajaxpost.postForm(theform);
else
return true;
}
catch (e){return true;}
}
}
修改2:针对快速回复模式。登录后台"风格模板管理→分页面模板(dispbbs)→界面风格管理→template.html(0)",找到Js的Checkpostdata函数修改如下(红色部分新增):
[color=Red]String.prototype.Trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"");}[/color]
function Checkpostdata(theform){
[color=Red]//检测文件是否上传
try{
if(frames["ad"].document.forms["form"].file1)
{
if((frames["ad"].document.forms["form"].file1.value).Trim() != "")
{
if(! confirm("文件还没有上传,确定不传吗?"))
{
frames["ad"].document.forms["form"].file1.focus();
return false;
}
}
}
}
catch(e){}[/color]
Dvbbs_CopyData('Body');
var Dvbbs_bIsIE5=document.all;
var Dvbbs_Mode = 0;
if (Dvbbs_bIsIE5){
var IframeID=frames["Dvbbs_Composition"];
}
else{
var IframeID=document.getElementById("Dvbbs_Composition").contentWindow;
var Dvbbs_bIsNC=true;
}
if (theform.codestr!=null){
if (theform.codestr.value==''){
document.getElementById('errinfo').innerHTML='<li><font color="red">你忘记输入验证码了!</font></li>';
theform.codestr.focus();
return false;
}
}
if (theform.Body.value.length==0){
document.getElementById('errinfo').innerHTML='<li><font color="red">你忘记填写回复内容了!</font></li>';
IframeID.focus();
return false;
}else{
if (theform.Body.value.length <xsl:value-of select="'>'" disable-output-escaping="yes"/> <xsl:value-of select="post/setting/@maxpostlen"/>) {
document.getElementById('errinfo').innerHTML='<li><font color="red">回复内容不能大于 <xsl:value-of select="post/setting/@maxpostlen"/> 字节!</font></li>';
IframeID.focus();
return false;
}
if (theform.Body.value.length <xsl:value-of select="'<'" disable-output-escaping="yes"/> <xsl:value-of select="post/setting/@leastpostlen"/>) {
document.getElementById('errinfo').innerHTML='<li><font color="red">回复内容不能小于 <xsl:value-of select="post/setting/@leastpostlen"/> 字节!</font></li>';
IframeID.focus();
return false;
}
}
return ajaxpost.postForm(theform);
}
上边代码在Dvbbs8.1.1中检测通过!
评论(0)
暂无评论。