Dedecms提示信息及提示内容的修改方法
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>本文实例讲述了Dedecms提示信息及提示内容的修改方法。分享给大家供大家参考。具体分析如下:</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
由于为客户做网站希望不让它看出是dedecms系统,所以我希望把所有页面的错误提示信息全部改成如www.jb51.net提示您这类,下面整理了一些方法.</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
<strong>官方回复解决办法:</strong></p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
在/include/inc_funtions.php 中修改 function ShowMsg 函数中相关文字,然后自己找到两处,在include里的common.func.php中 查找 提示文字 替换即可<br>
</p>
<div class="msgheader" style='margin: 3px auto 0px; padding: 0px 3px; outline: none; line-height: 21.6px; clear: both; border-width: 1px; border-style: solid; border-color: rgb(0, 153, 204); background: rgb(246, 251, 255); overflow: hidden; font-family: tahoma, arial, "Microsoft YaHei";'>
<div class="right">
<span><u>复制代码</u></span>
</div>
<p>
代码如下:</p>
</div>
<div class="msgborder" id="phpcode5" style='margin: 0px auto 3px; padding: 0px 3px; outline: none; line-height: 25.2px; font-size: 14px; clear: both; border-right: 1px solid rgb(0, 153, 204); background: rgb(221, 237, 251); overflow: hidden; border-left: 1px solid rgb(0, 153, 204); word-break: break-all; border-bottom: 1px solid rgb(0, 153, 204); word-wrap: break-word; font-family: tahoma, arial, "Microsoft YaHei";'>
/** <br>
* 短消息函数,可以在某个动作处理后友好的提示信息 <br>
* <br>
* @param string $msg 消息提示信息 <br>
* @param string $gourl 跳转地址 <br>
* @param int $onlymsg 仅显示信息 <br>
* @param int $limittime 限制时间 uu6c.com <br>
* @return void <br>
*/ <br>
function ShowMsg($msg, $gourl, $onlymsg=0, $limittime=0) <br>
{ <br>
if(emptyempty($GLOBALS['cfg_plus_dir'])) $GLOBALS['cfg_plus_dir'] = '..'; <br>
$htmlhead = "<html> <head> <title>DedeCMS提示信息</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> "; <br>
$htmlhead .= "<base target='_self'/> <style>div{line-height:160%;}</style></head> <body leftmargin='0' topmargin='0' bgcolor='#FFFFFF'>".(isset($GLOBALS['ucsynlogin']) ? $GLOBALS['ucsynlogin'] : '')." <center></center> </body> </html> "; <br>
$litime = ($limittime==0 ? 1000 : $limittime); <br>
$func = ''; <br>
if($gourl=='-1') <br>
{ <br>
if($limittime==0) $litime = 5000; <br>
$gourl = "javascript:history.go(-1);"; <br>
} <br>
if($gourl=='' || $onlymsg==1) <br>
{ <br>
$msg = ""; <br>
} <br>
else <br>
{ <br>
//当网址为:close::objname 时, 关闭父框架的id=objname元素 <br>
if(preg_match('/close::/',$gourl)) <br>
{ <br>
$tgobj = trim(preg_replace('/close::/', '', $gourl)); <br>
$gourl = 'javascript:;'; <br>
$func .= "window.parent.document.getElementById('{$tgobj}').style.display='none'; "; <br>
} <br><br>
$func .= " var pgo=0; <br>
function JumpUrl(){ <br>
if(pgo==0){ location='$gourl'; pgo=1; } <br>
} "; <br>
$rmsg = $func; <br>
$rmsg .= "document.write("<br>
<div style='width:450px;padding:0px;border:1px solid #DADADA;'>"; <br>
$rmsg .= "<div style='padding:6px;font-size:12px;border-bottom:1px solid #DADADA;background:#DBEEBD url({$GLOBALS['cfg_plus_dir']}/img/wbg.gif)';'><b>DedeCMS 提示信息!</b></div>"); "; <br>
$rmsg .= "document.write("<div style='height:130px;font-size:10pt;background:#ffffff'><br>
"); "; <br>
$rmsg .= "document.write("".str_replace(""","“",$msg).""); "; <br>
$rmsg .= "document.write(""; <br><br>
if($onlymsg==0) <br>
{ <br>
if( $gourl != 'javascript:;' && $gourl != '') <br>
{ <br>
$rmsg .= "<br>
<a href='{$gourl}'>如果你的浏览器没反应,请点击这里...</a>"; <br>
$rmsg .= "<br/></div>"); "; <br>
$rmsg .= "setTimeout('JumpUrl()',$litime);"; <br>
} <br>
else <br>
{ <br>
$rmsg .= "<br/></div>"); "; <br>
} <br>
} <br>
else <br>
{ <br>
$rmsg .= "<br/><br/></div>"); "; <br>
} <br>
$msg = $htmlhead.$rmsg.$htmlfoot; <br>
} <br>
echo $msg; <br>
}</div>
<p>
<br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>可以看出ShowMsg有四个参数,第一个参数是提示的信息,第二个就参数是跳转的地址,如果设置为-1的话,就是返回上一个页面,第三个参数其它就是定义是用alert()弹出提示框,还是显示提示信息,第四个参数就是信息提示页面显示多久再进行跳转,默认是1秒种,修改这个提示框比较简单了,直接替换对应的文字.</span></p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
<strong>注意:一共有两处需要修改!</strong></p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
下面我们学习如何修改提示信息框中的内容,比如提示信息,请登录后发布文章 等这样的信息,我们找到dede/sys_data_done.php,里面有各种对应的出错信息提示,改成自己的即可</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
<strong>小结:</strong>dedecms提示信息到处都有不只这几个页面,如果模板页面也有,我们可以利用如dw软件直接批量搜索整理站然后进行替换了,我就是这样干的。</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
希望本文所述对大家的dedecms建站有所帮助。</p>
頁:
[1]