--- a/common.inc.php +++ b/common.inc.php @@ -22,7 +22,7 @@ $_SESSION['lat'] = $_REQUEST['lat']; $_SESSION['lon'] = $_REQUEST['lon']; } else { - $contents = geocode(var_filter($_REQUEST['geolocate'],FILTER_SANITIZE_URL),true); + $contents = geocode(filter_var($_REQUEST['geolocate'],FILTER_SANITIZE_URL),true); if (isset($contents[0]->centroid)) { $_SESSION['lat'] = $contents[0]->centroid->coordinates[0]; $_SESSION['lon'] = $contents[0]->centroid->coordinates[1]; @@ -33,7 +33,7 @@ } } } -//print_r ($_SESSION); +debug(print_r($_SESSION,true)); function isDebug() { return $_SERVER['SERVER_NAME'] == "10.0.1.154" || $_SERVER['SERVER_NAME'] == "localhost" || $_SERVER['SERVER_NAME'] == "127.0.0.1" || !$_SERVER['SERVER_NAME']; @@ -48,7 +48,9 @@ if (isDebug()) echo "\n\n"; } function isFastDevice() { + $ua = $_SERVER['HTTP_USER_AGENT']; $fastDevices = Array("Mozilla/5.0 (X11;", "Mozilla/5.0 (Windows;", "Mozilla/5.0 (iP", "Mozilla/5.0 (Linux; U; Android", "Mozilla/4.0 (compatible; MSIE"); + $slowDevices = Array("J2ME","MIDP","Opera/","Mozilla/2.0 (compatible;","Mozilla/3.0 (compatible;"); return true; } @@ -105,7 +107,7 @@ function success(position) { $('#geolocate').val(position.coords.latitude+','+position.coords.longitude); -// setCookie('geolocate',position.coords.latitude+','+position.coords.longitude,1); +$.ajax({ url: \"common.inc.php?geolocate=yes&lat=\"+position.coords.latitude+\"&lon=\"+position.coords.longitude }); $('#here').click(function(event) { $('#geolocate').val(doAJAXrequestForGeolocSessionHere()); return false;}); $('#here').show(); } @@ -454,11 +456,11 @@
- +
- Current Time? + Current Time?