source: trunk/admin/inc/mobile.php@ 363

Last change on this file since 363 was 358, checked in by roby, 3 years ago

Admin: aggiunta la funzione di gestione dello spoglio per la singola sezione tramite tema per cellulari

File size: 1.2 KB
Line 
1<?php
2# riconoscimento mobile
3# per Eleonline
4# by l.apolito 2012
5# www.linuxap.it
6#####################################################
7/*
8 $is_mobile=is_mobile();
9 if($is_mobile){
10 setcookie ("mobile", "yes", time()+3600, "/");
11 $mobile="yes";
12 }else{
13 setcookie ("mobile", "no", time()+3600, "/");
14 $mobile="no";
15 }
16
17*/
18
19 # funzione verifica se mobile
20
21 function is_mobile(){
22
23 // returns true if one of the specified mobile browsers is detected
24
25 $regex_match="/(nokia|iphone|android|motorola|^mot\-|softbank|foma|docomo|kddi|up\.browser|up\.link|";
26 $regex_match.="htc|dopod|blazer|netfront|helio|hosin|huawei|novarra|CoolPad|webos|techfaith|palmsource|";
27 $regex_match.="blackberry|alcatel|amoi|ktouch|nexian|samsung|^sam\-|s[cg]h|^lge|ericsson|philips|sagem|wellcom|bunjalloo|maui|";
28 $regex_match.="symbian|smartphone|midp|wap|phone|windows ce|iemobile|^spice|^bird|^zte\-|longcos|pantech|gionee|^sie\-|portalmmm|";
29 $regex_match.="jig\s browser|hiptop|^ucweb|^benq|haier|^lct|opera\s*mobi|opera\*mini|320x320|240x320|176x220";
30 $regex_match.=")/i";
31 return isset($_SERVER['HTTP_X_WAP_PROFILE']) or isset($_SERVER['HTTP_PROFILE']) or preg_match($regex_match, strtolower($_SERVER['HTTP_USER_AGENT']));
32 }
33
34
35
36?>
37
Note: See TracBrowser for help on using the repository browser.