优化 部分函数
This commit is contained in:
parent
21087b7d73
commit
29fd1e0b2d
|
@ -16,12 +16,10 @@ function dstrpos($string, $arr) {
|
||||||
function checkmobile() {
|
function checkmobile() {
|
||||||
$useragent = strtolower($_SERVER['HTTP_USER_AGENT']);
|
$useragent = strtolower($_SERVER['HTTP_USER_AGENT']);
|
||||||
$ualist = array('android', 'midp', 'nokia', 'mobile', 'iphone', 'ipod', 'blackberry', 'windows phone');
|
$ualist = array('android', 'midp', 'nokia', 'mobile', 'iphone', 'ipod', 'blackberry', 'windows phone');
|
||||||
if((dstrpos($useragent, $ualist) || strexists($_SERVER['HTTP_ACCEPT'], "VND.WAP") || strexists($_SERVER['HTTP_VIA'],"wap"))){
|
if((dstrpos($useragent, $ualist) || strexists($_SERVER['HTTP_ACCEPT'], "VND.WAP") || strexists(isset($_SERVER['HTTP_VIA']),"wap"))){
|
||||||
$ua = 'wap';
|
return true;
|
||||||
return $ua;
|
|
||||||
}else{
|
}else{
|
||||||
$ua = 'pc';
|
return false;
|
||||||
return $ua;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,8 +73,24 @@ function authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) {
|
||||||
return $keyc . str_replace('=', '', base64_encode($result));
|
return $keyc . str_replace('=', '', base64_encode($result));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function cdnpublic($cdnpublic) {
|
||||||
|
if(empty($cdnpublic)){
|
||||||
|
return '.';
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return $cdnpublic.$conf['version'];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function background() {
|
||||||
|
if (empty($conf['background'])){if (file_exists(ROOT.'assets/img/background.jpg'))return '../assets/img/background.jpg';else return '../assets/img/bing.php';}
|
||||||
|
else { return $conf['background'];}
|
||||||
|
}
|
||||||
function update() {
|
function update() {
|
||||||
$update_host = 'cdn.lylme.com'; //程序更新服务器,请勿删除和修改,否则将导致无法接收版本更新和报错
|
$update_host = 'cdn.lylme.com'; //程序更新服务器,请勿删除和修改,否则将导致无法接收版本更新和程序报错
|
||||||
@$update = json_decode(file_get_contents('https://' . $update_host . '/lylmes_page/update.json') , true);
|
@$update = json_decode(file_get_contents('https://' . $update_host . '/lylmes_page/update.json') , true);
|
||||||
return $update;
|
return $update;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue