function/common.func.php
function showmessage($message, $url_forward='', $second=3, $vars=array()) {
global $_SGLOBAL, $_SCONFIG, $_SC, $channels;
if(empty($_SGLOBAL['inajax']) && $url_forward && empty($second)) {
//直接301跳转
obclean();
header("HTTP/1.1 301 Moved Permanently");
header("Location: $url_forward");
} else {
if(!defined('IN_SUPESITE_ADMINCP')) {
$tpl_file = 'showmessage';
$fullpath = 0;
include_once(S_ROOT.'./language/message.lang.php');
if(!empty($mlang[$message])) $message = $mlang[$message];
} else {
$tpl_file = 'admin/tpl/showmessage.htm';
$fullpath = 1;
include_once(S_ROOT.'./language/admincp_message.lang.php');
if(!empty($amlang[$message])) $message = $amlang[$message];
}
if(isset($_SGLOBAL['mlang'][$message])) $message = $_SGLOBAL['mlang'][$message];
foreach ($vars as $key => $val) {
$message = str_replace('{'.$key.'}', $val, $message);
}
//显示
obclean();
if(!empty($url_forward)) {
$second = $second * 1000;
$message .= "<script>setTimeout(\"window.location.href ='$url_forward';\", $second);</script><ajaxok>";
}
include template($tpl_file, $fullpath);
ob_out();
}
exit();
}
$second=3改这儿,不过一改可全都变了,建议你再写个函数在改跳转时间。 |