对IE6的GMAP进行特殊处理
This commit is contained in:
parent
5d2e2f7d63
commit
988d180fdc
|
@ -105,12 +105,20 @@ else
|
|||
|
||||
</div>
|
||||
<hr />
|
||||
<h2>位置图</h2>
|
||||
<h2>空间位置</h2>
|
||||
<?php
|
||||
$bt=new BrowserDetector();
|
||||
if ($bt->BROWSER=='IE' && $bt->VERSION<7)
|
||||
{
|
||||
echo '建议使用Firefox浏览器或IE7+!<ul><li>经度:'.$md->east.' - '.$md->west.'</li>';
|
||||
echo '<li>纬度:'.$md->north.' - '.$md->south.'</li></ul>';
|
||||
} else {
|
||||
?>
|
||||
<div id='watermap'></div>
|
||||
<?php } ?>
|
||||
<hr />
|
||||
<h2>联系信息</h2>
|
||||
<div id="authors">
|
||||
|
||||
<ul>
|
||||
<?php
|
||||
$party_zh=array('resourceProvider'=>'资源提供者','custodian'=>'维护者','owner'=>'拥有者','user'=>'用户','distributor'=>'数据服务联系人','originator'=>'创建者','pointOfContact'=>'联系人','principalInvestigator'=>'数据调查与处理者','processor'=>'处理者','publisher'=>'元数据发布者','author'=>'元数据作者');
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
class BrowserDetector {
|
||||
var $UA = ""; //$HTTP_USER_AGENT的内容
|
||||
var $BROWSER= "Unknown"; //浏览器类型
|
||||
var $PLATFORM = "Unknown"; //操作系统
|
||||
var $VERSION= ""; //浏览器版本号
|
||||
|
||||
/* 构造函数开始 */
|
||||
function __construct(){
|
||||
$this->UA = getenv(HTTP_USER_AGENT);
|
||||
$start = strpos($this->UA,"(")+1;//查看起始位置
|
||||
$length = strpos($this->UA,")")-$start;//查看结束位置
|
||||
$middle = trim(substr($this->UA,$start,$length)); //查看内容
|
||||
$end = trim(substr($this->UA,$start+$length+1));//附加内容
|
||||
$message = explode(";",$middle);//转换成数组
|
||||
//----------操作系统-----------------
|
||||
$os = trim($message['2']);
|
||||
$os_array = explode(" ",$os);
|
||||
$this->PLATFORM = trim($os_array['0']);//操作系统
|
||||
//------------浏览器------------
|
||||
$brower = trim($message['1']);
|
||||
if(preg_match("/msie/i",$brower)){//IE核心浏览器
|
||||
$brow_array =explode(" ",$brower);
|
||||
$this->BROWSER = "IE";
|
||||
$this->VERSION = $brow_array['1'];
|
||||
}else{//其它浏览器
|
||||
$brower =explode(" ",$end);
|
||||
$brow_array =explode("/",$brower['1']);
|
||||
$this->BROWSER = $brow_array['0'];
|
||||
$this->VERSION = $brow_array['1'];
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue