Witam Państwa serdecznie mam na swojej stronie www wersje mobilną strony, jednak niektóre urządzenia jak ipad czy iphone, galaxy itd. mogą odpalać strony standardowe dlatego na swojej stronie mobilnej chce umieścić link do wersji standardowej wszystko byłoby ok jednak w pliku config dla całej strony mam umieszczony kod w php oczywiście mogę usunąc user agent dla tabletów i urządzeń ale mnie to nie zadowala wolałbym linka. Poniżej podaje skrypt jaki mam umieszczony co mogę zrobić dopisać aby wstawić sobie link np. www.mojadomena.pl/fullversion lub coś podobnego do strony mobilnej aby po kliknięciu mimo user agenta w pliku config ładował orginał strony.
if( !function_exists("is_mobile") ){
function is_mobile(){
$user_agent = $_SERVER['HTTP_USER_AGENT']; // get the user agent value - this should be cleaned to ensure no nefarious input gets executed
$accept = $_SERVER['HTTP_ACCEPT']; // get the content accept value - this should be cleaned to ensure no nefarious input gets executed
return false
|| (preg_match('/ipod/i',$user_agent)||preg_match
('/iphone/i',$user_agent)) || (preg_match('/(pre\/|palm os|palm|hiptop|avantgo|plucker|xiino|blazer|elaine)/i',$user_agent)) || (preg_match('/(iris|3g_t|windows ce|opera mobi|windows ce; smartphone;|windows ce; iemobile)/i',$user_agent)) || (preg_match('/(mini 9.5|vx1000|lge|cmd|motorola|up.browser|up.link|mmp|symbian|smartphone|midp|wap|v
odafone|o2|pocket|kindle|mobile|psp|treo (itd.) )/i',$user_agent)) || ((strpos($accept,'text/vnd.wap.wml')>0
)||(strpos($accept,'application/vnd.wap.xhtml+xml')>0
)) || (isset($_SERVER['HTTP_X_WAP_PROFILE'])||isset
($_SERVER['HTTP_PROFILE'])) ;
} }
if ( is_mobile
() && !ereg("^m\.",$_SERVER["HTTP_HOST"])) {
header ('HTTP/1.1 301 Moved Permanently'); }
if( ereg("^m\.",$_SERVER["HTTP_HOST"]) ){ $for_index["MOBILE"] = 1;
$_GET["MOBILE"] = 1;
$domain = "http://".$_SERVER["HTTP_HOST"];
} else if($domain && $_SERVER["HTTP_HOST"] != str_replace("http://", "", $domain) ){ if( ereg("www\.", $_SERVER["HTTP_HOST"]) ){ require_once($rdir . "data/functions_sql.php");
sql_connect();
$t = mysql_fetch_assoc(ask_sql
("SELECT * FROM `" . $master_name . "_structure` WHERE `domena` LIKE 'http://" . $_SERVER["HTTP_HOST"]. "%' Limit 1")); if( $t["id"] ){
$ok =1;
}
}
if( !$ok ){
header ('HTTP/1.1 301 Moved Permanently'); header ("Location: $domain" . ($_GET["PHPSESSID"] ?
"?PHPSESSID=" . $_GET["PHPSESSID"] : "")); }
}