📄 global.func.php
字号:
<?php
function transsid($url, $tag = '', $wml = 0) {
global $sid;
$tag = stripslashes($tag);
if(!$tag || (!preg_match("/^(http:\/\/|mailto:|#|javascript)/i", $url) && !strpos($url, 'sid='))) {
if($pos = strpos($url, '#')) {
$urlret = substr($url, $pos);
$url = substr($url, 0, $pos);
} else {
$urlret = '';
}
$url .= (strpos($url, '?') ? ($wml ? '&' : '&') : '?').'sid='.$sid.$urlret;
}
return $tag.$url;
}
function wapheader($title) {
global $action, $_SERVER;
//header("Content-type: text/vnd.wap.wml; charset=utf-8");
ob_start();
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>".
"<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">".
"<html xmlns=\"http://www.w3.org/1999/xhtml\">".
"<head>".
"<title> $title</title>".
"<style type=\"text/css\">".
"body,ul,ol,form{margin:0 0;padding:0 0;font:normal 13px Arial, Helvetica}".
"ul,ol{list-style:none}".
"h2,li,.s{border-bottom:1px solid #ccc}".
"h1,h2,h3,div,li,p{margin:0 0;padding:2px 2px;font-size:medium}".
"h1{background:#8FE1FF}".
"h2{background:#d2edf6}".
".n{border:1px solid #ffed00;background:#fffcaa}".
".t,.a,.stamp,.stamp a,#ft{color:#999;font-size:small}".
"</style>".
"</head>".
"<body>".
"<h1><center><a href=\"index.php\"><img src=\"include/logo.gif\" alt=\"EasyTalk\" /></a></center></h1>";
}
function wapfooter() {
echo "<div id=\"ft\">ET报时:".gmdate('m/d H:i',time()+8*3600)."</div>".
"<div id=\"ft\">Powered by EasyTalk</div>".
"</body>".
"</html>";
wmloutput();
}
function wmloutput() {
global $sid, $charset, $wapcharset, $chs;
$content = preg_replace("/\<a(\s*[^\>]+\s*)href\=([\"|\']?)([^\"\'\s]+)/ies", "transsid('\\3','<a\\1href=\\2',1)", ob_get_contents());
ob_end_clean();
if($charset != 'utf-8') {
$target = $wapcharset == 1 ? 'UTF-8' : 'UNICODE';
if(empty($chs)) {
$chs = new Chinese($charset, $target);
} else {
$chs->config['SourceLang'] = $chs->_lang($charset);
$chs->config['TargetLang'] = $target;
}
echo ($wapcharset == 1 ? $chs->Convert($content) : str_replace(array('&#x;', '�'), array('??', ''), $chs->Convert($content)));
} else {
echo $content;
}
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -