showfull.php 6.96 KB
Newer Older
dmorley's avatar
dmorley committed
1 2 3 4 5 6 7 8 9
<?php
$tt=0;
 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") {
10
 $sql = "SELECT * FROM pods WHERE hidden <> 'no' ORDER BY weightedscore DESC";
dmorley's avatar
dmorley committed
11
 } else {
dmorley's avatar
dmorley committed
12
 $sql = "SELECT * FROM pods ORDER BY weightedscore DESC";
dmorley's avatar
dmorley committed
13 14 15 16 17 18 19 20
 }
 $result = pg_query($dbh, $sql);
 if (!$result) {
     die("Error in SQL query: " . pg_last_error());
 }   
 $numrows = pg_num_rows($result);
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
echo $numrows;
?>
dmorley's avatar
dmorley committed
24 25 26 27 28
<style>
.content {
    width: 99%;
}
</style>
dmorley's avatar
dmorley committed
29 30
 pods that are open for signup now.
Click column names to sort and find a pod.
dmorley's avatar
dmorley committed
31
Show as: <a href="?mapview=true">Map</a> | <a href="/">Simple Table</a> | <a href="?advancedview=true">Advanced Table</a>
dmorley's avatar
dmorley committed
32 33 34 35 36
<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. */ -->
<table id="myTable" class="tablesorter zebra-striped" width="98%">
<thead>
<tr>
37 38
<th width="220px">Federated Pod<a class="tipsy" title="A pod is a site for you to set up your account.">?</a></th>
<th>Version<a class="tipsy" title="Version of software this pod runs">?</a></th>
dmorley's avatar
dmorley committed
39
<th>Uptime<a class="tipsy" title="Percent of the time the pod is online for <?php echo date("F") ?>.">?</a></th>
40
<th>IPv6</th>
41
<th>Response Time</th>
dmorley's avatar
dmorley committed
42 43
<th>Signups</th>
<th>Total Users<a class="tipsy" title="Number of total users on this pod.">?</a></th>
dmorley's avatar
dmorley committed
44 45
<th>Active Last 6<a class="tipsy" title="Number of users active last 6 months on this pod.">?</a></th>
<th>Active Last 1<a class="tipsy" title="Number of users active last 1 month on this pod.">?</a></th>
dmorley's avatar
dmorley committed
46 47 48 49
<th>Posts<a class="tipsy" title="Number of total posts on this pod.">?</a></th>
<th>Comments<a class="tipsy" title="Number of total comments on this pod.">?</a></th>
<th>Months<a class="tipsy" title="How many months has this pod been online? Click number for more history.">?</a></th>
<th>Rating<a class="tipsy" title="User and Admin rating for this pod.">?</a></th>
dmorley's avatar
dmorley committed
50 51
<th>Score<a class="tipsy" title="System Score on a -20 to +20 scale">?</a></th>
<th>Country<a class="tipsy" title="Pod location, based on IP Geolocation">?</a></th>
dmorley's avatar
dmorley committed
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
<th>Services<a class="tipsy" title="External Social Networks this pod can post to">?</a></th>
</tr>
</thead>
<tbody>
<?php
 while ($row = pg_fetch_array($result)) {
$tt=$tt+1;
if ($row["secure"] == "true") {
$method = "https://";
$class="green";
$tip="This pod uses SSL encryption for traffic.";} 

else {
$method = "http://";
$class="red";
$tip="This pod does not offer SSL";
} 
$verdiff =  str_replace(".", "", $row["masterversion"]) - str_replace('.', '', $row["shortversion"]);


72 73
$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"]}. ";
74
$tip.="On a scale of -20 to +20 this pod is a {$row["score"]} right now";
dmorley's avatar
dmorley committed
75 76 77 78 79 80 81 82 83 84 85 86 87 88

     echo "<tr><td><a class='$class' target='new' href='". $method . $row["domain"] ."'>" . $row["domain"] . " <div title='$tip' class='tipsy' style='display: inline-block'>?</div></a></td>";
"</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";}
     echo "<td class='$classver'><div title='{$pre} codename: {$row["longversion"]} master version is: {$row["masterversion"]}' class='tipsy'>{$version}</div></td>";
     echo "<td>" . $row["uptimelast7"] . "%</td>";
89
     echo "<td>" . $row["ipv6"] . "</td>";
90
     echo "<td>" . $row["responsetimelast7"] . "</td>";
dmorley's avatar
dmorley committed
91 92 93
if ($row["signup"] == 1) {$signup="Open";} else {$signup="Closed";}
     echo "<td>" . $signup . "</td>";
     echo "<td>" . $row["total_users"] . "</td>";
dmorley's avatar
dmorley committed
94 95
     echo "<td>" . $row["active_users_halfyear"] . "</td>";
     echo "<td>" . $row["active_users_monthly"] . "</td>";
dmorley's avatar
dmorley committed
96 97
     echo "<td>" . $row["local_posts"] . "</td>";
     echo "<td>" . $row["comment_counts"] . "</td>";
98
if (strpos($row["pingdomurl"], "pingdom.com")) {$moreurl = $row["pingdomurl"];} else {$moreurl = "/db/showuptimerobot.php?domain=".$row["domain"];}
dmorley's avatar
dmorley committed
99 100 101 102 103 104 105 106 107 108 109 110 111 112
     echo "<td><div title='Last Check ".$row["dateupdated"]."' class='tipsy'><a target='new' href='".$moreurl."'>" . $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"]."/10 Auto Score is: " .$row["score"]. "/20'>";
if ($row["userrating"] == 0) {echo "no rating yet";}
for ($i = 0; $i < $row["userrating"]; $i++) { 
echo "✪";
}
if ($row["adminrating"] >6) {$adminratingclass="green";} elseif ($row["adminrating"] <7) {$adminratingclass="yellow";} elseif ($row["adminrating"] <3) {$adminratingclass="red";}
     echo "</div><br><div class='tipsy rating ".$adminratingclass."' backendscore='".$row["score"]."' title='Poduptime Approved rating is ".$row["adminrating"]."'>";
for ($iw = 0; $iw < $row["adminrating"]; $iw++) {
echo "✪";
}

     echo "</div></a></td>";
dmorley's avatar
dmorley committed
113 114
     echo "<td>" . $row["score"] . "</td>\n";
     echo "<td>" . $row["country"] . "</td>\n";
dmorley's avatar
dmorley committed
115 116 117 118 119
     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>";}
120
     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
121 122 123
     echo "</td></tr>\n";
if ($tt == 5) {
echo <<<EOF
dmorley's avatar
dmorley committed
124
<td colspan='12'>
dmorley's avatar
dmorley committed
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- podup2015 -->
<ins class="adsbygoogle"
     style="display:inline-block;width:728px;height:90px"
     data-ad-client="ca-pub-3662181805557062"
     data-ad-slot="2218925437"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</td>
EOF;
}
 }
 pg_free_result($result);       
 pg_close($dbh);
$country_code = $_SERVER["HTTP_CF_IPCOUNTRY"];
//echo $country_code;
?>
</tbody>
</table>