showfull.php 7.56 KB
Newer Older
dmorley's avatar
dmorley committed
1
<?php
2

noplanman's avatar
noplanman committed
3
use RedBeanPHP\R;
4

noplanman's avatar
noplanman committed
5
defined('PODUPTIME') || die();
6

noplanman's avatar
noplanman committed
7 8
try {
  $pods = R::getAll('
9
    SELECT domain, dnssec, podmin_statement, sslexpire, masterversion, shortversion, softwarename, monthsmonitored, score, signup, name, country, city, state, lat, long, uptime_alltime, active_users_halfyear, active_users_monthly, service_facebook, service_twitter, service_tumblr, service_wordpress, service_xmpp, latency, date_updated, ipv6, total_users, local_posts, comment_counts, userrating, status
noplanman's avatar
noplanman committed
10
    FROM pods
dmorley's avatar
dmorley committed
11
    WHERE status < ?
noplanman's avatar
noplanman committed
12
    ORDER BY weightedscore DESC
dmorley's avatar
dmorley committed
13
  ', [PodStatus::System_Deleted]);
noplanman's avatar
noplanman committed
14 15 16
} catch (\RedBeanPHP\RedException $e) {
  die('Error in SQL query: ' . $e->getMessage());
}
dmorley's avatar
dmorley committed
17
?>
18

noplanman's avatar
noplanman committed
19
<meta property="og:title" content="<?php echo count($pods); ?> Federated Pods listed, Come see the privacy aware social networks."/>
dmorley's avatar
dmorley committed
20
<!-- /* Copyright (c) 2011, David Morley. This file is licensed under the Affero General Public License version 3 or later. See the COPYRIGHT file. */ -->
21
<div class="table-responsive">
22
<table class="table table-striped table-bordered table-sm tablesorter-bootstrap table-hover tfont">
23 24 25 26
  <thead class="thead-inverse">
  <tr>
    <th><a data-toggle="tooltip" data-placement="bottom" title="A pod is a site for you to set up your account.">Pod</a></th>
    <th><a data-toggle="tooltip" data-placement="bottom" title="Version of software this pod runs">Version</a></th>
27
    <th><a data-toggle="tooltip" data-placement="bottom" title="Type of software this pod runs">Software</a></th>
28
    <th><a data-toggle="tooltip" data-placement="bottom" title="Percent of the time the pod is online.">Uptime</a></th>
noplanman's avatar
noplanman committed
29
    <th><a data-toggle="tooltip" data-placement="bottom" title="Does this pod offer ipv6 connection.">IPv6</a></th>
30
    <th><a data-toggle="tooltip" data-placement="bottom" title="Average connection latency time in ms from Los Angeles.">Latency</a></th>
dmorley's avatar
dmorley committed
31 32
    <th><a data-toggle="tooltip" data-placement="bottom" title="Does this pod allow new users.">Signups</a></th>
    <th><a data-toggle="tooltip" data-placement="bottom" title="Number of total users on this pod.">Users</a></th>
33 34
    <th><a data-toggle="tooltip" data-placement="bottom" title="Number of users active last 6 months on this pod.">6m</a></th>
    <th><a data-toggle="tooltip" data-placement="bottom" title="Number of users active last 1 month on this pod.">1m</a></th>
dmorley's avatar
dmorley committed
35 36 37
    <th><a data-toggle="tooltip" data-placement="bottom" title="Number of total posts on this pod.">Posts</a></th>
    <th><a data-toggle="tooltip" data-placement="bottom" title="Number of total comments on this pod.">Comments</a></th>
    <th><a data-toggle="tooltip" data-placement="bottom" title="How many months have we been watching this pod.">Months</a></th>
38
    <th><a data-toggle="tooltip" data-placement="bottom" title="User rating for this pod.">Rating</a></th>
dmorley's avatar
dmorley committed
39
    <th><a data-toggle="tooltip" data-placement="bottom" title="System Score on a 100 point scale.">Score</a></th>
40
    <th><a data-toggle="tooltip" data-placement="bottom" title="Does this domain use DNSSEC.">DNSSEC</a></th>
dmorley's avatar
dmorley committed
41
    <th><a data-toggle="tooltip" data-placement="bottom" title="Pod location, based on IP Geolocation.">Country</a></th>
dmorley's avatar
dmorley committed
42
    <th><a data-toggle="tooltip" data-placement="bottom" title="External Social Networks this pod can post to.">Services</a></th>
David Morley's avatar
David Morley committed
43
    <th><a data-toggle="tooltip" data-placement="bottom" title="Click for more information about this pod from the pod host (podmin).">Info</a></th>
44 45 46 47
  </tr>
  </thead>
  <tbody>
  <?php
noplanman's avatar
noplanman committed
48 49
  foreach ($pods as $pod) {
    $pod_name = htmlentities($pod['name'], ENT_QUOTES);
dmorley's avatar
dmorley committed
50
    $tip = "\n Over {$pod['monthsmonitored']} months uptime is {$pod['uptime_alltime']}% and response time is {$pod['latency']}ms, last check on {$pod['date_updated']}. This site is SSL/TLS encrypted with a cert that expires: " . $pod['sslexpire'];
dmorley's avatar
dmorley committed
51

52
    echo '<tr><td><a title="' . $tip . '" class="text-success url" data-toggle="tooltip" data-placement="bottom" target="_self" href="/go.php?domain=' . $pod['domain'] . '">' . $pod['domain'] . '</a></td>';
dmorley's avatar
dmorley committed
53

noplanman's avatar
noplanman committed
54 55 56 57
    if ($pod['shortversion'] > $pod['masterversion']) {
      $version = $pod['shortversion'];
      $pre = 'This pod runs pre release development code';
    } elseif (!$pod['shortversion']) {
David Morley's avatar
David Morley committed
58
      $version = '';
noplanman's avatar
noplanman committed
59
      $pre = 'This pod runs unknown code';
60
    } else {
noplanman's avatar
noplanman committed
61 62
      $version = $pod['shortversion'];
      $pre = 'This pod runs production code';
63
    }
noplanman's avatar
noplanman committed
64
    if (version_compare($pod['shortversion'], $pod['masterversion'], '=')) {
65
      $classver = 'text-success';
noplanman's avatar
noplanman committed
66
    } elseif (version_compare($pod['shortversion'], $pod['masterversion'], '<')) {
67
      $classver = 'text-warning';
68 69 70
    } else {
      $classver = 'black';
    }
71
    echo '<td class="' . $classver . '"><div title="' . $pre . ' version: ' . $pod['shortversion'] . ' master version is: ' . ($pod['masterversion'] ? $pod['masterversion'] : 'unknown') . '" data-toggle="tooltip" data-placement="bottom">' . $version . '</div></td>';
noplanman's avatar
noplanman committed
72 73 74 75 76 77 78 79 80 81 82 83
    echo '<td>' . $pod['softwarename'] . '</td>';
    echo '<td><a rel="facebox" href="podstat.php?domain=' . $pod['domain'] . '">' . ($pod['uptime_alltime'] > 0 ? $pod['uptime_alltime'] . '%' : '') . '</a></td>';
    echo '<td>' . ($pod['ipv6'] ? '&#10003;' : '') . '</td>';
    echo '<td>' . ($pod['latency'] > 0 ? $pod['latency'] : '') . '</td>';
    echo '<td>' . ($pod['signup'] ? '&#10003;' : '') . '</td>';
    echo '<td>' . ($pod['total_users'] > 0 ? $pod['total_users'] : '') . '</td>';
    echo '<td>' . ($pod['active_users_halfyear'] > 0 ? $pod['active_users_halfyear'] : '') . '</td>';
    echo '<td>' . ($pod['active_users_monthly'] > 0 ? $pod['active_users_monthly'] : '') . '</td>';
    echo '<td>' . ($pod['local_posts'] > 0 ? $pod['local_posts'] : '') . '</td>';
    echo '<td>' . ($pod['comment_counts'] > 0 ? $pod['comment_counts'] : '') . '</td>';
    echo '<td><div title="Last Check ' . $pod['date_updated'] . '" data-toggle="tooltip" data-placement="bottom">' . $pod['monthsmonitored'] . '</div></td>';
    echo '<td><a rel="facebox" href="rate.php?domain=' . $pod['domain'] . '">' . $pod['userrating'] . '</a></td>';
dmorley's avatar
dmorley committed
84
    echo '<td><div title="Pod Status is: ' . PodStatus::getKey((int)$pod['status']) . '" data-toggle="tooltip" data-placement="bottom">' . $pod['score'] . '</div></td>';
noplanman's avatar
noplanman committed
85 86 87
    echo '<td>' . ($pod['dnssec'] ? '&#10003;' : '') . '</td>';
    if ($country_code === $pod['country']) {
      echo '<td class="text-success" data-toggle="tooltip" data-placement="bottom" title="City: ' . ($pod['city'] ?? 'n/a') . ' State: ' . ($pod['state'] ?? 'n/a') . '"><b>' . $pod['country'] . '</b></td>';
88
    } else {
noplanman's avatar
noplanman committed
89
      echo '<td data-toggle="tooltip" data-placement="bottom" title="City: ' . ($pod['city'] ?? 'n/a') . ' State: ' . ($pod['state'] ?? 'n/a') . '">' . $pod['country'] . '</td>';
90
    }
91
    echo '<td>';
noplanman's avatar
noplanman committed
92 93 94 95 96
    $pod['service_facebook'] && print '<div class="smlogo smlogo-facebook" title="Publish to Facebook"></div>';
    $pod['service_twitter'] && print '<div class="smlogo smlogo-twitter" title="Publish to Twitter"></div>';
    $pod['service_tumblr'] && print '<div class="smlogo smlogo-tumblr" title="Publish to Tumblr"></div>';
    $pod['service_wordpress'] && print '<div class="smlogo smlogo-wordpress" title="Publish to WordPress"></div>';
    $pod['service_xmpp'] && 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>';
97
    echo '</td>';
noplanman's avatar
noplanman committed
98 99

    echo '<td>' . ($pod['podmin_statement'] ? '<a tabindex="0" data-toggle="popover" data-trigger="focus" data-placement="left" title="Podmin Statement" data-html="true" data-content="' . htmlentities($pod['podmin_statement'], ENT_QUOTES) . '">&#128172;</a>' : '&nbsp;') . '</td></tr>';
100 101 102
  }
  ?>
  </tbody>
dmorley's avatar
dmorley committed
103
</table>
104
</div>