include("plotconf.inc"); include("plot.inc"); if($warnings == "1") { error_reporting(E_ALL); } else { error_reporting(E_ERROR); } // check if it is the user's ip, or another host if(!isset($HTTP_GET_VARS["address"]) || ($HTTP_GET_VARS["address"] == "")) { $address = $HTTP_SERVER_VARS['REMOTE_ADDR']; $local = 1; } else { $address = $HTTP_GET_VARS["address"]; $local = 0; } // this is the most important function, gets lat/lon and description of location $values = getstuff($address, $local) or die("Error in plot.inc"); if(isset($logging) && is_writable("plotlog.txt")) { $log = @fopen("plotlog.txt", "a") or print ""; @fputs($log, $HTTP_SERVER_VARS["REMOTE_ADDR"] ."\t". date("F j, Y, g:i a") . "\t$address\t$values[address]\t$values[lat]\t$values[lon]\n") or print ""; @fclose($log); } if(isset($HTTP_COOKIE_VARS["atlasprefs"]) && validcookie($HTTP_COOKIE_VARS["atlasprefs"])) { list( , , , $imagething) = split(":", $HTTP_COOKIE_VARS["atlasprefs"]); $earthimage = isvalidimage($imagething, $earthimages, $defaultimage); } else { $earthimage = $earthimages[$defaultimage]; } if(strstr($earthimage, ":")) { list($earthimage, , , ) = split(":", $earthimage); } // check if we need to run it in css mode if(!shouldrun($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) { list($width, $height) = getimagecoords($earthimages, $earthimage); // make sure some coords were found if($values["lat"] == "" || $values["lon"] == "") { $display = " "; $extracss = ""; } else { list($x, $y) = getlocationcoords($values["lat"], $values["lon"], $width, $height); if(isset($HTTP_COOKIE_VARS["atlasprefs"])) { list( , , , , $dotname) = split(":", $HTTP_COOKIE_VARS["atlasprefs"]); list($thedot, $dotwidth, $dotheight) = finddot($dotname, $cssdots, $defaultdot); } else { $dotname = $cssdots[$defaultdot]; list($dotname, , , ) = split(":", $dotname); list($thedot, $dotwidth, $dotheight) = finddot($dotname, $cssdots, $defaultdot); } // magical formula for placing the css dot $x = ($x - floor($dotwidth / 2)); $y = ($y - floor($dotheight / 2)); $extracss = ""; $display = "
IP Atlas
'.$display.' |