0
ORDER BY weightedscore DESC
', [PodStatus::RECHECK]);
} catch (\RedBeanPHP\RedException $e) {
die('Error in SQL query: ' . $e->getMessage());
}
// CloudFlare country code pull.
$country_code = $_SERVER['HTTP_CF_IPCOUNTRY'] ?? '';
foreach ($pods as $pod) {
$humanmonitored = Carbon::now()->subDays($pod['daysmonitored'])->diffForHumans(null, true);
$tip = "Over the last {$humanmonitored} uptime was {$pod['uptime_alltime']}% and response time from Los Angeles was {$pod['latency']}ms.";
if (($_COOKIE['domain'] ?? null) === $pod['domain']) {
echo '
' . $pod['domain'] . ' | ';
}
if ($pod['shortversion'] > $pod['masterversion']) {
$version = $pod['shortversion'];
$pre = 'This pod runs pre release development code';
} elseif (!$pod['shortversion']) {
$version = '';
$pre = 'This pod runs unknown code';
} else {
$version = $pod['shortversion'];
$pre = 'This pod runs production code';
}
$classver = 'black';
if (version_compare($pod['shortversion'] ?? '', $pod['masterversion'] ?? '', '=')) {
$classver = 'text-success';
} elseif (version_compare($pod['shortversion'] ?? '', $pod['masterversion'] ?? '', '<')) {
$classver = 'text-warning';
}
echo '' . $pod['name'] . ' | ';
echo '' . $version . ' | ';
echo '' . $pod['softwarename'] . ' | ';
echo '' . ($pod['uptime_alltime'] > 0 ? $pod['uptime_alltime'] . '%' : '') . ' | ';
echo '' . ($pod['ipv6'] ? 'Yes' : 'No') . ' | ';
echo '' . ($pod['latency'] > 0 ? $pod['latency'] : '') . ' | ';
echo '' . ($pod['signup'] ? 'Yes' : 'No') . ' | ';
echo '' . ($pod['total_users'] > 0 ? $pod['total_users'] : '') . ' | ';
echo '' . ($pod['active_users_halfyear'] > 0 ? $pod['active_users_halfyear'] : '') . ' | ';
echo '' . ($pod['active_users_monthly'] > 0 ? $pod['active_users_monthly'] : '') . ' | ';
echo '' . ($pod['local_posts'] > 0 ? $pod['local_posts'] : '') . ' | ';
echo '' . ($pod['comment_counts'] > 0 ? $pod['comment_counts'] : '') . ' | ';
echo '' . $pod['monthsmonitored'] . ' | ';
echo '' . $pod['userrating'] . ' | ';
echo '' . $pod['score'] . ' | ';
echo '' . PodStatus::getKey((int) $pod['status']) . ' | ';
echo '' . ($pod['dnssec'] ? 'Yes' : 'No') . ' | ';
if ($country_code === $pod['country']) {
echo '' . $pod['country'] . ' | ';
} else {
echo '' . $pod['country'] . ' | ';
}
echo '' . $pod['city'] . ' | ';
echo '' . $pod['state'] . ' | ';
echo '' . ($pod['detectedlanguage'] ? strtoupper($pod['detectedlanguage']) : '') . ' | ';
$services = json_decode($pod['services'] ?? '[]') ?: [];
// Special case for XMPP, which is not an official service, but listed in the same cell.
($pod['service_xmpp'] ?? false) && $services[] = 'xmpp';
$services_list = [
'facebook' => ['img' => '/images/facebook.png', 'title' => 'Publish to Facebook'],
'twitter' => ['img' => '/images/twitter.png', 'title' => 'Publish to Twitter'],
'tumblr' => ['img' => '/images/tumblr.png', 'title' => 'Publish to Tumblr'],
'wordpress' => ['img' => '/images/wordpress.png', 'title' => 'Publish to WordPress'],
'xmpp' => ['img' => '/images/xmpp.png', 'title' => 'XMPP chat server'],
'appnet' => ['img' => '/images/appnet.png', 'title' => 'Publish to App.'],
'atom' => ['img' => '/images/atom.png', 'title' => 'Publish to Atom'],
'blogger' => ['img' => '/images/blogger.png', 'title' => 'Publish to Blogger'],
'gnusocial' => ['img' => '/images/gnusocial.png', 'title' => 'Publish to GNUSocial'],
'google' => ['img' => '/images/google.png', 'title' => 'Publish to Google+'],
'libertree' => ['img' => '/images/libertree.png', 'title' => 'Publish to Libertree'],
'linkedin' => ['img' => '/images/linkedin.png', 'title' => 'Publish to LinkedIn'],
'livejournal' => ['img' => '/images/livejournal.png', 'title' => 'Publish to Live Journal'],
'pinterest' => ['img' => '/images/pinterest.png', 'title' => 'Publish to Pinterest'],
'pumpio' => ['img' => '/images/pumpio.png', 'title' => 'Publish to Pump.io'],
];
echo '';
foreach ($services as $service) {
// Make sure we have this service in the list.
if (!isset($services_list[$service])) {
continue;
}
printf(
'',
$services_list[$service]['img'],
$services_list[$service]['title']
);
}
echo ' | ';
echo '' . (in_array('facebook', $services, true) ? 'Yes' : 'No') . ' | ';
echo '' . (in_array('twitter', $services, true) ? 'Yes' : 'No') . ' | ';
echo '' . (in_array('tumblr', $services, true) ? 'Yes' : 'No') . ' | ';
echo '' . (in_array('wordpress', $services, true) ? 'Yes' : 'No') . ' | ';
echo '' . (in_array('xmpp', $services, true) ? 'Yes' : 'No') . ' | ';
$podmin_statement = htmlentities($pod['podmin_statement'] ?? '', ENT_QUOTES);
echo '' . ($podmin_statement ? '💬' : ' ') . ' |
';
}