Ignore:
Timestamp:
2010/11/06 21:19:13 (16 years ago)
Author:
no61
Message:

スマートフォンの判定とリダイレクト

Location:
branches/camp/camp-2_5-E/data/class
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • branches/camp/camp-2_5-E/data/class/SC_Display.php

    r19027 r19029  
    6565        if($nu->isMobile()){ 
    6666            $retDevice = 1; 
    67         }elseif ($this->isSmartphone()){ 
     67        }elseif ($nu->isSmartphone()){ 
    6868            $retDevice = 2; 
    6969        }else{ 
     
    7777    } 
    7878 
    79     function isSmartphone(){ 
    80         $useragents = array( 
    81             'iPhone',         // Apple iPhone 
    82     'iPod',           // Apple iPod touch 
    83     'Android',        // 1.5+ Android 
    84     'dream',          // Pre 1.5 Android 
    85     'CUPCAKE',        // 1.5+ Android 
    86     'blackberry9500', // Storm 
    87     'blackberry9530', // Storm 
    88     'blackberry9520', // Storm v2 
    89     'blackberry9550', // Storm v2 
    90     'blackberry9800', // Torch 
    91     'webOS',          // Palm Pre Experimental 
    92     'incognito',      // Other iPhone browser 
    93     'webmate'         // Other iPhone browser 
    94         ); 
    95  
    96         $pattern = implode("|", $useragents); 
    97         return preg_match('/['.$pattern.']/', $_SERVER['HTTP_USER_AGENT']); 
    98  
    99     } 
    100  
    101  
    10279    function assign(LC_Page $page){ 
    10380 
Note: See TracChangeset for help on using the changeset viewer.