'none'); $prevent_redirect = false; if (DA_USE_COOKIES && isset($_COOKIE['Mobi_Mtld_DA_Prevent_Redirect'])) { //Clear the redirect-prevention cookie if we see redirect=true parameter if($redirect == 'true') { setcookie('Mobi_Mtld_DA_Prevent_Redirect', 'false', time()-3600); } else { $prevent_redirect = isset($_COOKIE['Mobi_Mtld_DA_Prevent_Redirect']); if($prevent_redirect) { $da_results['_source'] = 'prevent_redirect'; } } } if (DA_USE_COOKIES && isset($_COOKIE['Mobi_Mtld_DA_Properties'])) { $da_results = (array)json_decode($_COOKIE['Mobi_Mtld_DA_Properties'], true); $da_results['_source'] = 'cookie'; } if (DA_USE_CACHE && $da_results['_source'] === 'none') { $da_cache_file = md5($_SERVER["HTTP_USER_AGENT"]) . '.json'; if (!file_exists(DA_CACHE_DIR) && !@mkdir(DA_CACHE_DIR)) { $da_results['_error'] = "Unable to create cache directory: " . DA_CACHE_DIR . "\n"; } else { $da_json = @file_get_contents(DA_CACHE_DIR . $da_cache_file); if ($da_json !== false) { $da_results = (array)json_decode($da_json, true); $da_results['_source'] = 'cache'; if (DA_USE_COOKIES) { setcookie('Mobi_Mtld_DA_Properties', $da_json); } } } } if ($da_results['_source'] === 'none') { $da_json = @file_get_contents(DA_URI . "?User-Agent=" . urlencode($_SERVER["HTTP_USER_AGENT"])); if ($da_json !== false) { $da_results = array_merge(json_decode($da_json, true), $da_results); $da_results['_source'] = 'webservice'; if (DA_USE_COOKIES) { setcookie('Mobi_Mtld_DA_Properties', $da_json); } if (DA_USE_CACHE) { if (@file_put_contents(DA_CACHE_DIR . $da_cache_file, $da_json) === false) { $da_results['_error'] .= "Unable to write cache file " . DA_CACHE_DIR . $da_cache_file . "\n"; } } } else { $da_results['_error'] .= "Error fetching DeviceAtlas data from webservice.\n"; } } if(isset($da_results['mobileDevice']) && $da_results['mobileDevice']=='true' && !$prevent_redirect) { header('Location: ' . MOBILE_SITE); die(); } } else { //Set a cookie so we remember not to redirect again in the future if (DA_USE_COOKIES && !isset($_COOKIE['Mobi_Mtld_DA_Prevent_Redirect'])) { setcookie('Mobi_Mtld_DA_Prevent_Redirect', "true", time() + COOKIE_EXPIRY_TIME); } } ?>
11.4.11 It appears it may be safe to venture out into the art world again! The economy shows some signs of recovery. I am planning my schedule for next year, and hope to see many of you out at the events. More to follow. Have a great Holiday season. Rod