diff --git a/db/config.php.example b/db/config.inc.php.example similarity index 100% rename from db/config.php.example rename to db/config.inc.php.example diff --git a/db/db.class.php b/db/db.class.php index 29bec386eefdff750bfc3f057f3de56403f29f64..2af98ffd14d3a0e0fb33360a101eaacb589f6867 100644 --- a/db/db.class.php +++ b/db/db.class.php @@ -6,7 +6,7 @@ * See the COPYRIGHT file. */ -require "config.inc.php"; +require_once "config.inc.php"; /** * Connects to database and returns the PDO Object or false @@ -16,19 +16,11 @@ require "config.inc.php"; */ class DB { - /** - * Constuctor. - * @return Ambigous - */ - function __construct() { - return DB::connectDB(); - } - /** * Connects to the DB * @return PDO|boolean */ - private static function connectDB() { + public static function connectDB() { $dsn = DB_DRIVER.":dbname=".DB_NAME.";host=".DB_HOST; if (DB_DRIVER == 'mysql') { diff --git a/index.php b/index.php index 17fa2341d07b0ff854b035f628c5399aa8833b61..58ae0939276e962935df697ef1ee08e9721788b6 100644 --- a/index.php +++ b/index.php @@ -1,25 +1,42 @@ -Diaspora Pod uptime - Find your new social home - - - - - - + + + + + +Diaspora Pod uptime - Find your new social home + + + + + + - - + + - + -isMobile()) {echo '';} +isMobile ()) { + echo ''; +} ?> + + -
- - -
-
- +
+ + +
+ +
+ +
+ NOTICE: These pods are Hidden and have problems, click here to go to working pods"; + } + include("show.php"); + ?>
- -
-
- -
- NOTICE: These pods are Hidden and have problems, click here to go to working pods";} include("show.php"); ?> -
-
- Pod Host? Click here to add your listing.
-
-
+
+ Pod Host? Click here + to add your listing.
+
+
Data last refreshed at: Pacific Time
- Poduptime is run by David Morley and is open source on GitHub Feel free to contribute with pull requests or bug reports!
- Some pods are Hidden since they have too many issues, see the Wiki for more.

-
- - - - - - + + + - - -
-
+
+ diff --git a/show.php b/show.php index 8bdc49b9e1f2786b3436a99302a11d38048ec315..779d8c6fb904dadb35a1e9665aad729d307cc013 100644 --- a/show.php +++ b/show.php @@ -1,94 +1,134 @@ - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + 'no' ORDER BY Hgitdate DESC, uptimelast7 DESC"; - } else { - $sql = "SELECT * FROM pods WHERE adminrating <> -1 AND hidden <> 'yes' ORDER BY Hgitdate DESC, uptimelast7 DESC"; - } - $result = pg_query($dbh, $sql); - if (!$result) { - die("Error in SQL query: " . pg_last_error()); - } - $numrows = pg_num_rows($result); - 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.";} +require_once 'db/config.inc.php'; +require_once 'db/db.class.php'; -else { -$method = "http://"; -$class="red"; -$tip="This pod does not offer SSL"; -} -$verdiff = str_replace(".", "", $row["masterversion"]) - str_replace('.', '', $row["shortversion"]); +if (!$dbConnection = DB::connectDB()) { + // Database connection failed. Do nothing + echo "Could not connect to Database."; +} else { + $hidden = isset ( $_GET ['hidden'] ) ? $_GET ['hidden'] : null; + if ($hidden) { + $sql = "SELECT * FROM pods WHERE hidden <> 'no' ORDER BY Hgitdate DESC, uptimelast7 DESC"; + } else { + $sql = "SELECT * FROM pods WHERE hidden <> 'yes' ORDER BY Hgitdate DESC, uptimelast7 DESC"; + } + + if (!$result = $dbConnection->query($sql)) { + if (DEBUG) { + echo "Error in SQl Syntax. Error: ".$dbConnection->errorInfo[2]; + } + } else { + foreach ($result->fetchAll() as $row) { + echo "\n"; + 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"; + } + + $versionDiff = str_replace ( ".", "", $row ["masterversion"] ) - str_replace ( '.', '', $row ["shortversion"] ); + $tip .= "This pod {$row["name"]} has been watched for {$row["monthsmonitored"]} months and its average ping time is {$row["responsetimelast7"]} with uptime of {$row["uptimelast7"]}% this month and was last checked on {$row["dateupdated"]}.
"; + $tip .= "Code base is {$row["shortversion"]} and the current github base is {$row["masterversion"]}.
"; + $tip .= "This pod is {$versionDiff} versions behind the current code. This pods IP {$row["ip"]} " . ($row ["ipv6"] == "yes" ? "has" : "does not have") . " IPv6 and is located in {$row["country"]}. On a score of -20 to +20 this pod is a {$row["score"]} right now, all data is checked every hour. Pod " . ($row ["signup"] == "1" ? "does" : "does not") . " allow new users.
"; + echo " \n"; + if (stristr ( $row ["shortversion"], 'head' )) { + $version = ".dev code"; + $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 " \n"; + echo " \n"; -$tip.="\n This pod {$row["name"]} has been watched for {$row["monthsmonitored"]} months and its average ping time is {$row["responsetimelast7"]} with uptime of {$row["uptimelast7"]}% this month and was last checked on {$row["dateupdated"]}. "; -$tip.="Code base is {$row["shortversion"]} and the current github base is {$row["masterversion"]}. "; -$tip.="This pod is {$verdiff} versions behind the current code. This pods IP {$row["ip"]} ". ($row["ipv6"] == "yes" ? "has" : "does not have") ." IPv6 and is located in {$row["country"]}. On a score of -20 to +20 this pod is a {$row["score"]} right now, all data is checked every hour. Pod " . ($row["signup"] == "1" ? "does" : "does not") . " allow new users."; + $signup = $row["signup"]==1 ? "Open":"Closed"; + echo " \n"; - echo ""; -""; + echo " \n"; + echo " \n"; -if (stristr($row["shortversion"],'head')) -{$version=".dev code";$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 ""; - echo ""; -if ($row["signup"] == 1) {$signup="Open";} else {$signup="Closed";} - echo ""; - echo ""; - echo ""; -if (strpos($row["pingdomurl"], "pingdom.com")) {$moreurl = $row["pingdomurl"];} else {$moreurl = "http://api.uptimerobot.com/getMonitors?format=json&customUptimeRatio=7-30-60-90&apiKey=".$row["pingdomurl"];} - echo ""; -if ($row["userrating"] >6) {$userratingclass="green";} elseif ($row["userrating"] <7) {$userratingclass="yellow";} elseif ($row["userrating"] <3) {$userratingclass="red";} - echo "\n"; + + if ($row ["userrating"] > 6) { + $userratingclass = "green"; + } elseif ($row ["userrating"] <= 6) { + $userratingclass = "yellow"; + } elseif ($row ["userrating"] < 3) { + $userratingclass = "red"; + } + echo " \n"; + + echo " \n"; + + echo "\n"; + } + } } -if ($row["adminrating"] >6) {$adminratingclass="green";} elseif ($row["adminrating"] <7) {$adminratingclass="yellow";} elseif ($row["adminrating"] <3) {$adminratingclass="red";} - echo "
"; -for ($iw = 0; $iw < $row["adminrating"]; $iw++) { -echo "✪"; -} - - echo "
"; - echo "\n"; - - } - pg_free_result($result); - pg_close($dbh); ?>
Diaspora Pod?Version?Uptime.">?Signups?Users?Posts?Months Online?User Rating?Location?
Diaspora Pod?Version?Uptime.">?Signups?Users?Posts?Months Online?User Rating?Location?
{$version}
" . $row ["uptimelast7"] . "%" . $signup . "
" . $row ["total_users"] . "" . $row ["local_posts"] . "
{$version}
" . $row["uptimelast7"] . "%" . $signup . "" . $row["total_users"] . "" . $row["local_posts"] . "
"; -if ($row["userrating"] == 0) {echo "no rating yet";} -for ($i = 0; $i < $row["userrating"]; $i++) { -echo "✪"; + if (strpos($row["pingdomurl"], "pingdom.com")) { + $moreurl = $row ["pingdomurl"]; + } else { + $moreurl = "http://api.uptimerobot.com/getMonitors?format=json&customUptimeRatio=7-30-60-90&apiKey=" . $row["pingdomurl"]; + } + + echo "
"; + 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"] <= 6) { + $adminratingclass = "yellow"; + } elseif ($row ["adminrating"] < 3) { + $adminratingclass = "red"; + } + echo "

"; + for($iw = 0; $iw < $row ["adminrating"]; $iw ++) { + echo "✪"; + } + + echo "
" . $row ["country"] . "
" . $row["country"] . "