|
本帖最后由 alongken2005 于 2010-11-16 18:10 编辑
PHP复制代码 <?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Msg {
//对话框
function showmessage ($msg, $url_forward='', $second=1, $values=array()) {
$CI =& get_instance ();
//语言
if(isset($msg) && $values) {
if($values) {
foreach ($values as $k => $v) {
$rk = $k + 1;
$message = str_replace([url =file://\\]"\\".$k[/url], $v, $msg);
}
}
} else {
$message = $msg;
}
//显示
if($url_forward && empty($second)) {
header("HTTP/1.1 301 Moved Permanently");
header("Location: $url_forward");
} else {
if($url_forward) {
$message = "<a href=\"$url_forward\">$message</a><script>setTimeout(\"window.location.href ='$url_forward';\", ".($second*1000).");</script>";
}
$data['url_forward'] = $url_forward;
$data['message'] = $message;
echo $CI->load->view(BT_THEME . '/showmessage', $data, true);
exit;
}
}
}
?> 复制代码 |
|