帝国cms教程栏目,提供精品建站,仿站,二次开发,安装,标签使用等图文教程,帮助建设和管理好你的帝国cms站点。
今天帝国模板之家小编给大家聊聊帝国cms二次开发中常用到的printerror2介绍。区别printerror函数,printerror2可以直接设置错误提示文字。
函数作用:
用于系统错误提示,可以直接设置提示文字。
函数位置:
/e/class/connetc.php
函数代码:
//错误提示2:直接文字
function printerror2($error='',$gotourl='',$ecms=0,$noautourl=0){
global $empire,$public_r;
if(strstr($gotourl,"(")||empty($gotourl))
{
if(strstr($gotourl,"(-2"))
{
$gotourl_js="history.go(-2)";
$gotourl="javascript:history.go(-2)";
}
else
{
$gotourl_js="history.go(-1)";
$gotourl="javascript:history.go(-1)";
}
}
else
{$gotourl_js="self.location.href='$gotourl';";}
if($ecms==9)//弹出对话框
{
echo"<script>alert('".$error."');".$gotourl_js."</script>";
}
elseif($ecms==7)//弹出对话框并关闭窗口
{
echo"<script>alert('".$error."');window.close();</script>";
}
else
{
@include(ECMS_PATH.'e/message/index.php');
}
db_close();
exit();
}
参数说明:
$error="" // 错误提示语
$gotourl=""//跳转地址
$ecms=0 //错误提示类型: 默认值 9 弹出对话框 ,值为7:弹出对话框并关闭窗口
$noautourl=0 //默认值为0 ,无效参数
函数调用示例:
printerror2('请在主端下使用本操作','history.go(-1)',9);
printerror2('本栏目需要会员级别以上才能查看','');
printerror2('您没有足够权限查看此栏目','');
以上就是帝国cms二次开发常用函数printerror2介绍(系统错误提示),更多相关内容请关注帝国模板之家其他文章。
转载请注明来源:帝国cms二次开发常用函数printerror2介绍(错误提示2:直接文字)
本文永久链接地址:https://www.moyouyouw.cn/code/748.html
郑重声明:本站所有主题/文章除标明原创外,均来自网络转载,版权归原作者所有,如果有侵犯到您的权益,请联系本站删除,谢谢!我们不承担任何技术及版权问题,且不对任何资源负法律责任。
售价: 300 16 ℃ 0 评论
售价: 300 8 ℃ 0 评论
售价: 200 22 ℃ 0 评论
已有 位小伙伴发表了看法
欢迎 你 发表评论