Warning: Invalid argument supplied for foreach() in /home/jihswbiz/public_html/t6.gwilt.org/refDox.php on line 212
Docs-eatLocalInfoCookie

 

ReLoad

Keys


Functions

arraybrowsercolorcookiedatetimeDBdebugdeviceDSTequiverrorflagsfontformatgeo
holidayhtmlisjsonmathparsePHPprintsearchsortstringtabletexttracetype
VOTDweatherxml

Function  eatLocalInfoCookie   Lines 941-1022 (81 lines)Updated: 2015-06-20 file  utils.php   Last mod: Fri 2021-05-14 21:45:07

function eatLocalInfoCookie $str )
        {
#-k     cookie
#-      this decodes the cookie we wrote with js
#-d     6/20/15 - Fixed

        
if (substr($e,2) == '{"')       { $ret json_decode ($strTRUE); }
        else                            { 
$ret explode '|'$str ); }

        if (!isset(
$ret['ip']))
                { 
$ret['ip']  = $_SERVER['REMOTE_ADDR']; }      # just threw that in for luck
        
if (!isset($ret['mob']))
                { 
$ret['mob'] = detectMobileDevice($ret['sw']); }

        if (
$ret['os'] == 'Android')
                {
                
$p strpos($ret['bv'],'(');
                
$q strpos($ret['bv'],';');
                
$ret['os'] .= substr $ret['bv'], $p+9$q-$p-);
                }

        elseif ((
$ret['os'] == 'Win32')  or  ($ret['os'] == 'Win64'))
                {
                if     (
strpos($ret['ba'],'Win95'))             $ret['os'] = 'Windows 95';
                elseif (
strpos($ret['ba'],'Windows 98'))        $ret['os'] = 'Windows 98';
                elseif (
strpos($ret['ba'],'Windows NT 4.0'))    $ret['os'] = 'Windows NT';
                elseif (
strpos($ret['ba'],'Windows NT 5.0'))    $ret['os'] = 'Windows 2000';
                elseif (
strpos($ret['ba'],'Windows NT 5.1'))    $ret['os'] = 'Windows XP';
                elseif (
strpos($ret['ba'],'Windows NT 5.2'))    $ret['os'] = 'Windows XP x64';
                elseif (
strpos($ret['ba'],'Windows NT 6.0'))    $ret['os'] = 'Windows Vista';
                elseif (
strpos($ret['ba'],'Windows NT 6.1'))    $ret['os'] = 'Windows 7';
                else                                            
$ret['os'] = 'Windows ?';
                }
        else
                {
                
$ret['os'] = 'Unknown: ' $ret['bv'];  # work it out later
                
}

        if (
$ret['br'] == 'Microsoft Internet Explorer')
                {
#Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SearchToolbar 1.2; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322; .NET4.0C)
                
$ret['br'] = 'IE';
                if (
$p=strpos($ret['ba'],'MSIE'))
                        {
                        
$p strpos($ret['ba'],' ',$p);
                        
$q strpos($ret['ba'],';',$p);
                        
$ret['bv'] = substr($ret['ba'],$p+1,$q-$p-2);
                        }
                }

        elseif ((
$ret['br'] == 'Opera')  &&  ($p=strpos($ret['ba'],'Version')))
                {
#Opera/9.80 (Windows NT 5.1; U; en) Presto/2.8.131 Version/11.11
                
$ret['bv'] = substr($ret['ba'],$p+8);
                if (
strpos($ret['br'],'Opera Mobi')) $ret['br'] .= ' (Mobile)';
                }

        elseif (
$p=strpos($ret['br'],'Firefox'))
                {
                
$ret['bv'] = substr($ar[7],$p+8);
#Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
                
}

        else
                {
#Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101
                
$ret['bv'] = 'unknown';
                }

        switch (
$ret['mob'])
                {
case 
6:
                
$ret['reas'] = "Screen size";
                break;

default:
                break;
                }

        return 
$ret;
        }

?>