Commit 9a3f383c authored by David Morley's avatar David Morley

show IP country data in ipv6 hover, not sure that API is current or not.

parent a37e9469
......@@ -143,6 +143,17 @@ $ipv6="no";
} else {
$ipv6="yes";
}
//curl ip
$hostip = curl_init();
curl_setopt($hostip, CURLOPT_URL, "http://api.hostip.info/get_html.php?ip=".$ipnum);
curl_setopt($hostip, CURLOPT_POST, 0);
curl_setopt($hostip, CURLOPT_HEADER, 0);
curl_setopt($hostip, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($hostip, CURLOPT_NOBODY, 0);
curl_setopt($hostip, CURLOPT_MAXCONNECTS, 5);
curl_setopt($hostip, CURLOPT_FOLLOWLOCATION, true);
$ipdata = curl_exec($hostip);
curl_close($hostip);
//curl the pingdom page
$ping = curl_init();
......@@ -204,7 +215,7 @@ else {$live="error";}
//sql it
$timenow = date('Y-m-d H:i:s');
$sql = "UPDATE pods SET Hgitdate='$gitdate', Hencoding='$encoding', secure='$secure', hidden='$hidden', Hruntime='$runtime', Hgitref='$gitrev', ip='$ipnum', ipv6='$ipv6', monthsmonitored='$months', uptimelast7='$uptime', status='$live', dateLaststats='$pingdomdate', dateUpdated='$timenow', responsetimelast7='$responsetime', score='$score', adminrating='$adminrating', userrating='$userrating' WHERE domain='$domain'";
$sql = "UPDATE pods SET Hgitdate='$gitdate', Hencoding='$encoding', secure='$secure', hidden='$hidden', Hruntime='$runtime', Hgitref='$gitrev', ip='$ipnum', ipv6='$ipv6', monthsmonitored='$months', uptimelast7='$uptime', status='$live', dateLaststats='$pingdomdate', dateUpdated='$timenow', responsetimelast7='$responsetime', score='$score', adminrating='$adminrating', country='$ipdata', userrating='$userrating' WHERE domain='$domain'";
$result = pg_query($dbh, $sql);
if (!$result) {
die("Error in SQL query: " . pg_last_error());
......
......@@ -39,7 +39,7 @@ if ($row["secure"] == "true") {$method = "https://";$class="green";$tip="This po
echo "<td><div title='Last Check ".$row["dateupdated"]."' class='tipsy'><a target='new' href='".$row["pingdomurl"]."'>" . $row["monthsmonitored"] . "</a></div></td>";
if ($row["userrating"] >6) {$userratingclass="green";} elseif ($row["userrating"] <7) {$userratingclass="yellow";} elseif ($row["userrating"] <3) {$userratingclass="red";}
echo "<td><a rel=\"facebox\" href=\"rate.php?domain=".$row["domain"]."\"><div class='tipsy rating ".$userratingclass."' title='User rating is ".$row["userrating"]."'>";
if ($row["userrating"]) {echo "no rating yet";}
if ($row["userrating"] == 0) {echo "no rating yet";}
for ($i = 0; $i < $row["userrating"]; $i++) {
echo "✪";
}
......@@ -51,7 +51,7 @@ echo "✪";
echo "</div></a></td>";
echo "<td>" . $row["responsetimelast7"] . "</td>";
echo "<td class='tipsy' title='IP Address ".$row["ip"]." '>" . $row["ipv6"] . "</td></tr>\n";
echo "<td class='tipsy' title='IP Address ".$row["ip"]." Ip Data ".$row["country"]." '>" . $row["ipv6"] . "</td></tr>\n";
}
pg_free_result($result);
pg_close($dbh);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment