]> git.mxchange.org Git - friendica.git/blobdiff - mod/admin.php
Small cleanup
[friendica.git] / mod / admin.php
index ecd08bbe00743b546f869a75d64f355cc2725f69..a98f464f813d30b36b446ddffae0fc1cca47501c 100644 (file)
@@ -270,6 +270,12 @@ function admin_page_federation(&$a) {
        // Add more platforms if you like, when one returns 0 known nodes it is not
        // displayed on the stats page.
        $platforms = array('Friendica', 'Diaspora', '%%red%%', 'Hubzilla', 'GNU Social', 'StatusNet');
+       $colors    = array('Friendica' => '#ffc018',     // orange from the logo
+                          'Diaspora'  => '#a1a1a1',     // logo is black and white, makes a gray
+                          '%%red%%'   => '#c50001',     // fire red from the logo
+                          'Hubzilla'  => '#43488a',     // blue from the logo
+                          'GNU Social'=> '#a22430',     // dark red from the logo
+                          'StatusNet' => '#789240');    // the green from the logo (red and blue have already others
        $counts = array();
        $total = 0;
 
@@ -277,14 +283,14 @@ function admin_page_federation(&$a) {
                // get a total count for the platform, the name and version of the
                // highest version and the protocol tpe
                $c = q('SELECT count(*) AS total, platform, network, version FROM gserver
-                       WHERE platform LIKE "%s" AND last_contact > last_failure
+                       WHERE platform LIKE "%s" AND last_contact > last_failure AND `version` != ""
                        ORDER BY version ASC;', $p);
                $total = $total + $c[0]['total'];
 
                // what versions for that platform do we know at all?
                // again only the active nodes
                $v = q('SELECT count(*) AS total, version FROM gserver
-                       WHERE last_contact > last_failure AND platform LIKE "%s" 
+                       WHERE last_contact > last_failure AND platform LIKE "%s"  AND `version` != ""
                        GROUP BY version
                        ORDER BY version;', $p);
 
@@ -338,9 +344,12 @@ function admin_page_federation(&$a) {
                        $v = $newVv;
                }
 
+               foreach ($v as $key => $vv)
+                       $v[$key]["version"] = trim(strip_tags($vv["version"]));
+
                // the 3rd array item is needed for the JavaScript graphs as JS does
                // not like some characters in the names of variables...
-               $counts[$p]=array($c[0], $v, str_replace(array(' ','%'),'',$p));
+               $counts[$p]=array($c[0], $v, str_replace(array(' ','%'),'',$p), $colors[$p]);
        }
 
        // some helpful text