3 include("plotconf.inc");
7 $user = get_record("user", "id", $user);
8 $fullname = fullname($user, true);
9 $username = "<b>$fullname</b> [$user->city, $user->country] : ";
14 if($warnings == "1") {
15 error_reporting(E_ALL
);
17 error_reporting(E_ERROR
);
20 // check if it is the user's ip, or another host
22 if(!isset($HTTP_GET_VARS["address"]) ||
($HTTP_GET_VARS["address"] == "")) {
23 $address = $HTTP_SERVER_VARS['REMOTE_ADDR'];
26 $address = $HTTP_GET_VARS["address"];
30 // this is the most important function, gets lat/lon and description of location
31 $values = getstuff($address, $local) or die("Error in plot.inc");
33 if(isset($logging) && is_writable("plotlog.txt")) {
34 $log = @fopen
("plotlog.txt", "a") or print "";
35 @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 "";
39 if(isset($HTTP_COOKIE_VARS["atlasprefs"]) && validcookie($HTTP_COOKIE_VARS["atlasprefs"])) {
40 list( , , , $imagething) = split(":", $HTTP_COOKIE_VARS["atlasprefs"]);
41 $earthimage = isvalidimage($imagething, $earthimages, $defaultimage);
43 $earthimage = $earthimages[$defaultimage];
46 if(strstr($earthimage, ":")) {
47 list($earthimage, , , ) = split(":", $earthimage);
50 // check if we need to run it in css mode
51 if(!shouldrun($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) {
53 list($width, $height) = getimagecoords($earthimages, $earthimage);
55 // make sure some coords were found
56 if($values["lat"] == "" ||
$values["lon"] == "") {
63 list($x, $y) = getlocationcoords($values["lat"], $values["lon"], $width, $height);
65 if(isset($HTTP_COOKIE_VARS["atlasprefs"])) {
66 list( , , , , $dotname) = split(":", $HTTP_COOKIE_VARS["atlasprefs"]);
67 list($thedot, $dotwidth, $dotheight) = finddot($dotname, $cssdots, $defaultdot);
69 $dotname = $cssdots[$defaultdot];
70 list($dotname, , , ) = split(":", $dotname);
71 list($thedot, $dotwidth, $dotheight) = finddot($dotname, $cssdots, $defaultdot);
74 // magical formula for placing the css dot
75 $x = ($x - floor($dotwidth / 2));
76 $y = ($y - floor($dotheight / 2));
79 #dotDiv { padding-left:$x; padding-top:$y; }
81 $display = "<div id=\"dotDiv\"><img width=\"$dotwidth\" height=\"$dotheight\" src=\"$thedot\">";
89 list($width, $height) = getimagecoords($earthimages, $earthimage) or die("Unable to find width/height for image $earthimage in config file");
91 $display = "<img src=\"plotimage.php?lat=$values[lat]&lon=$values[lon]\" width=\"$width\" height=\"$height\">";
99 <html><head><title>'.t("Plotting").' '.$values["address"].'</title>
102 <!-- your head tags here -->
103 <link rel="Stylesheet" href="ip-atlas.css">
104 </head><body bgcolor="'.$THEME->body
.'">
109 <table valign="top" cellpadding=0 cellspacing=0 border=0 background="'.$earthimage.'" width="'.$width.'" height="'.$height.'"><tr><td valign="top">'.$display.'</td></tr></table>
115 if(isset($address)) {
116 print "$username $values[desc]";
119 $PHP_SELF = 'plot.php';
123 <form method="GET" action="'.$PHP_SELF.'#map">
124 <table width="100%"><tr><td nowrap align="left">
125 '.t("IP/Hostname:").' <input value="'.$values["address"].'" type="text" size="30" name="address"><input type="Submit" value="'.t("Submit").'"></td><td align="right" width="100%">
126 [ <a href="ip-atlas_prefs.php?lastquery='?
><?php
if(isset($HTTP_GET_VARS["address"])) { echo $HTTP_GET_VARS["address"]; } ?
><?php
echo '">'.t("preferences").'</a> ]
127 [ <a href="'."$PHP_SELF".'">'.t("locate me").'</a> ]
132 include("footer.inc");
134 print "</body></html>";