showfull.php 5.89 KB
Newer Older
dmorley's avatar
dmorley committed
1 2
<?php
$tt=0;
dmorley's avatar
cleanup  
dmorley committed
3 4 5 6 7 8 9
include('db/config.php');
$dbh = pg_connect("dbname=$pgdb user=$pguser password=$pgpass");
if (!$dbh) {
  die("Error in connection: " . pg_last_error());
}  
$hidden = isset($_GET['hidden'])?$_GET['hidden']:null;
if ($hidden == "true") {
David Morley's avatar
David Morley committed
10
  $sql = "SELECT * FROM pods WHERE hidden <> 'no' ORDER BY uptimelast7 DESC";
dmorley's avatar
cleanup  
dmorley committed
11
} else {
David Morley's avatar
David Morley committed
12
  $sql = "SELECT * FROM pods ORDER BY uptimelast7 DESC";
dmorley's avatar
cleanup  
dmorley committed
13 14 15 16 17 18
}
$result = pg_query($dbh, $sql);
if (!$result) {
  die("Error in SQL query: " . pg_last_error());
}   
$numrows = pg_num_rows($result);
dmorley's avatar
dmorley committed
19 20
echo "<meta property='og:title' content='"; 
echo $numrows;
21
echo " federated Pods listed, Come see the privacy aware social networks.' />";
dmorley's avatar
dmorley committed
22 23 24
?>
<meta charset="utf-8">
<!-- /* Copyright (c) 2011, David Morley. This file is licensed under the Affero General Public License version 3 or later. See the COPYRIGHT file. */ -->
David Morley's avatar
David Morley committed
25 26
<table id="myTable" class="table table-striped table-sm tablesorter table-hover tfont">
<thead class="thead-inverse">
dmorley's avatar
dmorley committed
27
<tr>
David Morley's avatar
David Morley committed
28 29 30
<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>
<th><a data-toggle='tooltip' data-placement='bottom' title="Percent of the time the pod is online for <?php echo date("F") ?>.">Uptime</a></th>
31
<th>IPv6</th>
32
<th>Response Time</th>
dmorley's avatar
dmorley committed
33
<th>Signups</th>
David Morley's avatar
David Morley committed
34 35 36 37 38 39 40 41 42 43
<th><a data-toggle='tooltip' data-placement='bottom' title="Number of total users on this pod.">Users</a></th>
<th><a data-toggle='tooltip' data-placement='bottom' title="Number of users active last 6 months on this pod.">Active Users 6</a></th>
<th><a data-toggle='tooltip' data-placement='bottom' title="Number of users active last 1 month on this pod.">Active Users 1</a></th>
<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 has this pod been online? Click number for more history.">Months</a></th>
<th><a data-toggle='tooltip' data-placement='bottom' title="User rating for this pod.">Rating</a></th>
<th><a data-toggle='tooltip' data-placement='bottom' title="System Score on a 100 point scale">Score</a></th>
<th><a data-toggle='tooltip' data-placement='bottom' title="Pod location, based on IP Geolocation">Country</a></th>
<th><a data-toggle='tooltip' data-placement='bottom' title="External Social Networks this pod can post to">Services</a></th>
dmorley's avatar
dmorley committed
44 45 46 47 48 49 50
</tr>
</thead>
<tbody>
<?php
 while ($row = pg_fetch_array($result)) {
$tt=$tt+1;
if ($row["secure"] == "true") {
dmorley's avatar
cleanup  
dmorley committed
51 52 53
  $method = "https://";
  $class="green";
  $tip="This pod uses SSL encryption for traffic.";} 
dmorley's avatar
dmorley committed
54
else {
dmorley's avatar
cleanup  
dmorley committed
55 56 57
  $method = "http://";
  $class="red";
  $tip="This pod does not offer SSL";
dmorley's avatar
dmorley committed
58 59
} 
$verdiff =  str_replace(".", "", $row["masterversion"]) - str_replace('.', '', $row["shortversion"]);
60 61
$pod_name = htmlentities($row["name"], ENT_QUOTES);
$tip.="\n This {$row["softwarename"]} pod {$pod_name} has been watched for {$row["monthsmonitored"]} months with an uptime of {$row["uptimelast7"]}% this month and a response time average today of {$row["responsetimelast7"]}ms was last checked on {$row["dateupdated"]}. ";
62
$tip.="On a scale of 100 this pod is a {$row["score"]} right now";
dmorley's avatar
dmorley committed
63

David Morley's avatar
David Morley committed
64
     echo "<tr><td><a title='$tip' data-toggle='tooltip' data-placement='bottom' class='$class' target='new' href='". $method . $row["domain"] ."'>" . $row["domain"] . "</a></td>";
dmorley's avatar
dmorley committed
65 66 67 68 69 70 71 72 73 74
"</div></td>";

if (stristr($row["shortversion"],'head')) 
{$version=".dev";$pre = "This pod runs pre release 
development code";} elseif (!$row["shortversion"]) 
{$version="0";$pre = "This pod runs 
unknown code";} 
else 
{$version=$row["shortversion"];$pre="This pod runs production code";}
if ($row["shortversion"] == $row["masterversion"] && $row["shortversion"] != "") {$classver = "green";} elseif ($verdiff > 6) {$classver = "red";} else {$classver = "black";}
David Morley's avatar
David Morley committed
75
     echo "<td class='$classver'><div title='{$pre} codename: {$row["longversion"]} master version is: {$row["masterversion"]}' data-toggle='tooltip' data-placement='bottom'>{$version}</div></td>";
dmorley's avatar
dmorley committed
76
     echo "<td>" . $row["uptimelast7"] . "%</td>";
77
     echo "<td>" . $row["ipv6"] . "</td>";
78
     echo "<td>" . $row["responsetimelast7"] . "</td>";
dmorley's avatar
dmorley committed
79 80 81
if ($row["signup"] == 1) {$signup="Open";} else {$signup="Closed";}
     echo "<td>" . $signup . "</td>";
     echo "<td>" . $row["total_users"] . "</td>";
dmorley's avatar
dmorley committed
82 83
     echo "<td>" . $row["active_users_halfyear"] . "</td>";
     echo "<td>" . $row["active_users_monthly"] . "</td>";
dmorley's avatar
dmorley committed
84 85
     echo "<td>" . $row["local_posts"] . "</td>";
     echo "<td>" . $row["comment_counts"] . "</td>";
86
if (strpos($row["pingdomurl"], "pingdom.com")) {$moreurl = $row["pingdomurl"];} else {$moreurl = "/db/showuptimerobot.php?domain=".$row["domain"];}
David Morley's avatar
David Morley committed
87 88 89
     echo "<td><div title='Last Check ".$row["dateupdated"]."' 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";
dmorley's avatar
dmorley committed
90

David Morley's avatar
David Morley committed
91
     echo "</a></td>";
92
     echo "<td>" . $row["score"] . "/100</td>\n";
dmorley's avatar
dmorley committed
93
     echo "<td>" . $row["country"] . "</td>\n";
dmorley's avatar
dmorley committed
94 95 96 97 98
     echo "<td class='' title=''>";
     if ($row["service_facebook"] == "t") {echo "<div id='facebook' class='smlogo'></div>";}
     if ($row["service_twitter"] == "t") {echo "<div id='twitter' class='smlogo'></div>";}
     if ($row["service_tumblr"] == "t") {echo "<div id='tumblr' class='smlogo'></div>";}
     if ($row["service_wordpress"] == "t") {echo "<div id='wordpress' class='smlogo'></div>";}
99
     if ($row["xmpp"] == "t") {echo "<div id='xmpp'><img src='/images/icon-xmpp.png' width='16px' height='16px' title='XMPP chat server' alt='XMPP chat server'></div>";}
dmorley's avatar
dmorley committed
100
     echo "</td></tr>\n";
dmorley's avatar
cleanup  
dmorley committed
101 102 103
}
pg_free_result($result);       
pg_close($dbh);
dmorley's avatar
dmorley committed
104 105 106
?>
</tbody>
</table>