Commit affea934 authored by dmorley's avatar dmorley

cleanup

parent 267082c8
......@@ -7,7 +7,6 @@ $dbh || die('Error in connection: ' . pg_last_error());
$sql = "SELECT domain,masterversion,shortversion,softwarename,monthsmonitored,score,signup,secure,name,country,city,state,lat,long,uptime_alltime,active_users_halfyear,active_users_monthly,service_facebook,service_twitter,service_tumblr,service_wordpress,service_xmpp,responsetime,dateupdated,ipv6,total_users,local_posts,comment_counts,stats_apikey,userrating,sslvalid FROM pods WHERE score < 50 ORDER BY weightedscore";
$result = pg_query($dbh, $sql);
$result || die('Error in SQL query: ' . pg_last_error());
$numrows = pg_num_rows($result);
?>
......@@ -80,11 +79,7 @@ $numrows = pg_num_rows($result);
echo '<td>' . $row['active_users_monthly'] . '</td>';
echo '<td>' . $row['local_posts'] . '</td>';
echo '<td>' . $row['comment_counts'] . '</td>';
if (strpos($row['stats_apikey'], 'pingdom.com')) {
$moreurl = $row['stats_apikey'];
} else {
$moreurl = 'https://api.uptimerobot.com/getMonitors?format=json&customUptimeRatio=7-30-60-90&apiKey=' . $row['stats_apikey'];
}
$moreurl = 'https://api.uptimerobot.com/getMonitors?format=json&customUptimeRatio=7-30-60-90&apiKey=' . $row['stats_apikey'];
echo '<td><div title="Last Check ' . $row['dateupdated'] . '" class="tipsy"><a target="_self" href="' . $moreurl . '">' . $row['monthsmonitored'] . '</a></div></td>';
echo '<td>' . $row['score'] . '</td>';
echo '<td><div class="tipsy" title="' . $row['sslvalid'] . '">con info </td>';
......
......@@ -291,7 +291,9 @@ while ($row = pg_fetch_all($result)) {
if ($uptr->monitors->monitor{'0'}->status == 9) {
$status = 'Down';
}
$pingdomdate = date('Y-m-d H:i:s');
if ($uptr) {
$statslastdate = date('Y-m-d H:i:s');
}
if ($uptimerobotstat == 'fail' || $status <> 'Up') {
$score = $score - 2;
}
......
......@@ -45,7 +45,7 @@ $numrows = pg_num_rows($result);
echo '<tr><td><div title="' . $tip . '" data-toggle="tooltip" data-placement="bottom"><a class="text-success url" target="_self" href="/go.php?url=https://' . $row['domain'] . '">' . $row['domain'] . '</a></div></td>';
echo '<td>' . $row['uptime_alltime'] . '%</td>';
echo '<td data-toggle="tooltip" data-placement="bottom" title="active six months: ' . $row['active_users_halfyear'] . ', active one month: ' . $row['active_users_monthly'] . '">' . $row['active_users_halfyear'] . '</td>';
echo '<td data-toggle="tooltip" data-placement="bottom" title="Active users six months: ' . $row['active_users_halfyear'] . ', Active users one month: ' . $row['active_users_monthly'] . '">' . $row['active_users_halfyear'] . '</td>';
if ($country_code === $row['country']) {
echo '<td class="text-success" data-toggle="tooltip" data-placement="bottom" title="City: ' . ($row['city'] ?? 'n/a') . ' State: ' . ($row['state'] ?? 'n/a') . '"><b>' . $row['country'] . '</b></td>';
} else {
......
......@@ -75,15 +75,9 @@ $numrows = pg_num_rows($result);
echo '<td>' . $row['active_users_monthly'] . '</td>';
echo '<td>' . $row['local_posts'] . '</td>';
echo '<td>' . $row['comment_counts'] . '</td>';
if (strpos($row['stats_apikey'], 'pingdom.com')) {
$moreurl = $row['stats_apikey'];
} else {
$moreurl = '/showstats.php?domain=' . $row['domain'];
}
$moreurl = '/showstats.php?domain=' . $row['domain'];
echo '<td><div title="Last Check ' . $row['date_updated'] . '" data-toggle="tooltip" data-placement="bottom"><a rel="facebox" href="' . $moreurl . '">' . $row['monthsmonitored'] . '</a></div></td>';
echo '<td><a rel="facebox" href="rate.php?domain=' . $row['domain'] . '">' . $row['userrating'] . '/10';
echo '</a></td>';
echo '<td>' . $row['score'] . '/100</td>';
if ($country_code === $row['country']) {
......@@ -92,10 +86,10 @@ $numrows = pg_num_rows($result);
echo '<td data-toggle="tooltip" data-placement="bottom" title="City: '. ($row['city'] ?? 'n/a') . ' State: ' . ($row['state'] ?? 'n/a') . '">' . $row['country'] . '</td>';
}
echo '<td>';
$row['service_facebook'] === 't' && print '<div class="smlogo smlogo-facebook"></div>';
$row['service_twitter'] === 't' && print '<div class="smlogo smlogo-twitter"></div>';
$row['service_tumblr'] === 't' && print '<div class="smlogo smlogo-tumblr"></div>';
$row['service_wordpress'] === 't' && print '<div class="smlogo smlogo-wordpress"></div>';
$row['service_facebook'] === 't' && print '<div class="smlogo smlogo-facebook" title="Publish to Facebook" alt="Publish to Facebook"></div>';
$row['service_twitter'] === 't' && print '<div class="smlogo smlogo-twitter" title="Publish to Twitter" alt="Publish to Twitter"></div>';
$row['service_tumblr'] === 't' && print '<div class="smlogo smlogo-tumblr" title="Publish to Tumblr" alt="Publish to Tumblr"></div>';
$row['service_wordpress'] === 't' && print '<div class="smlogo smlogo-wordpress" title="Publish to Wordpress" alt="Publish to Wordpress"></div>';
$row['service_xmpp'] === 't' && print '<div class="smlogo smlogo-xmpp"><img src="/images/icon-xmpp.png" width="16" height="16" title="XMPP chat server" alt="XMPP chat server"></div>';
echo '</td></tr>';
}
......
......@@ -40,10 +40,10 @@ foreach ($csv as $cords) {
$i++ > 0 && print ',';
$feat = '';
$row['service_facebook'] === 't' && $feat .= '<div class="smlogo smlogo-facebook"></div>';
$row['service_twitter'] === 't' && $feat .= '<div class="smlogo smlogo-twitter"></div>';
$row['service_tumblr'] === 't' && $feat .= '<div class="smlogo smlogo-tumblr"></div>';
$row['service_wordpress'] === 't' && $feat .= '<div class="smlogo smlogo-wordpress"></div>';
$row['service_facebook'] === 't' && $feat .= '<div class="smlogo smlogo-facebook" title="Publish to Facebook" alt="Publish to Facebook"></div>';
$row['service_twitter'] === 't' && $feat .= '<div class="smlogo smlogo-twitter" title="Publish to Twitter" alt="Publish to Twitter"></div>';
$row['service_tumblr'] === 't' && $feat .= '<div class="smlogo smlogo-tumblr" title="Publish to Tumblr" alt="Publish to Tumblr"></div>';
$row['service_wordpress'] === 't' && $feat .= '<div class="smlogo smlogo-wordpress" title="Publish to Wordpress" alt="Publish to Wordpress"></div>';
$row['service_xmpp'] === 't' && $feat .= '<div class="smlogo smlogo-xmpp"><img src="/images/icon-xmpp.png" width="16" height="16" title="XMPP chat server" alt="XMPP chat server"></div>';
$pod_name = htmlentities($row['name'], ENT_QUOTES);
......
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