diff options
author | Minteck <contact@minteck.org> | 2022-01-01 10:37:28 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-01-01 10:37:28 +0100 |
commit | ef055e79855cf3be1ad5e1aa5f9ebad480062384 (patch) | |
tree | ff074b29a7a87c3ccfc3b10741bbe30cb28e103e /admin/panes/telemetry.php | |
parent | e3a79df6428799024eac64e9cffbb062317aeb95 (diff) | |
download | main-trunk.tar.gz main-trunk.tar.bz2 main-trunk.zip |
Diffstat (limited to 'admin/panes/telemetry.php')
-rw-r--r-- | admin/panes/telemetry.php | 946 |
1 files changed, 0 insertions, 946 deletions
diff --git a/admin/panes/telemetry.php b/admin/panes/telemetry.php deleted file mode 100644 index 74064c9..0000000 --- a/admin/panes/telemetry.php +++ /dev/null @@ -1,946 +0,0 @@ -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/header.php";/** @var array $_DATA */
-
-function urlize($scheme) {
- $p = explode(":", $scheme);
-
- if ($p[0] === "space") {
- return "https://minteck.ro.lt" . $p[1];
- }
-
- if ($p[0] === "unchained") {
- return "https://unchainedtech.minteck.ro.lt" . $p[1];
- }
-
- if ($p[0] === "kartik") {
- return "https://kartik.hopto.org" . $p[1];
- }
-
- return "about:blank";
-}
-
-?>
-
-<style>
- ::-webkit-scrollbar {
- width: 5px;
- }
-
- ::-webkit-scrollbar-track {
- border-radius: 9999px;
- background: transparent;
- }
-
- ::-webkit-scrollbar-thumb {
- border-radius: 9999px;
- background-color: rgba(136, 136, 136, 0.5);
- transition: background 200ms;
- }
-
- ::-webkit-scrollbar-thumb:hover {
- background-color: rgba(85, 85, 85, 0.75);
- }
-
- ::-webkit-scrollbar-thumb:active {
- background-color: #222;
- }
-
- .list-group-item {
- background: #34373c;
- }
-</style>
-
-<div class="container" style="color:white;padding-top:15vh;padding-bottom:15vh;">
- <h2 style="text-align:center;"><?= l("Telemetry Information", "Informations de télémétrie") ?></h2>
-
- <?php $db = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/telemetry.json")); ?>
-
- <ul class="list-group" style="margin-top:20px;">
- <li class="list-group-item"><?= l("Lifetime Visitors", "Visiteurs depuis toujours") ?> <span style="float:right;"><?php
-
- $uniques = [];
-
- foreach ($db as $months) {
- foreach ($months as $days) {
- foreach ($days as $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
-
- echo (count($uniques));
-
- ?></span></li>
- <li class="list-group-item"><?= l("Most Viewed Page", "Page la plus vue") ?> <span style="float:right;"><?php
-
- $record = 0;
- $recname = "-";
-
- foreach ($db as $months) {
- foreach ($months as $days) {
- foreach ($days as $pages) {
- foreach ($pages as $page => $visitors) {
- $thispage = 0;
-
- foreach ($visitors as $visitor) {
- $thispage++;
- }
-
- if ($thispage > $record) {
- $recname = "<a href='" . urlize($page) . "' target='_blank'><code>" . $page . "</code></a>";
- $record = $thispage;
- }
- }
- }
- }
- }
-
- echo ($recname);
-
- ?></span></li>
- <li class="list-group-item"><?= l("Least Viewed Page", "Page la moins vue") ?> <span style="float:right;"><?php
-
- $record = 2;
- $recname = "-";
-
- foreach ($db as $months) {
- foreach ($months as $days) {
- foreach ($days as $pages) {
- foreach ($pages as $page => $visitors) {
- $thispage = 0;
-
- foreach ($visitors as $visitor) {
- $thispage++;
- }
-
- if ($thispage < $record) {
- $recname = "<a href='" . urlize($page) . "' target='_blank'><code>" . $page . "</code></a>";
- $record = $thispage;
- }
- }
- }
- }
- }
-
- echo ($recname);
-
- ?></span></li>
- </ul>
-
- <ul class="list-group" style="margin-top:20px;">
- <li class="list-group-item text-muted"><?= l("Tomorrow", "Demain") ?> <span style="float:right;"><?php
-
- $uniques = [];
- $totalDays = 0;
-
- foreach ($db as $months) {
- foreach ($months as $days) {
- foreach ($days as $pages) {
- $totalDays++;
- $dayUniques = [];
-
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $dayUniques)) {
- array_push($dayUniques, $visitor);
- }
- }
- }
-
- $uniques = array_merge($uniques, $dayUniques);
- }
- }
- }
-
- $expect = round(count($uniques) / $totalDays);
- echo ($expect);
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m')) {
- foreach ($days as $day => $pages) {
- if ($day === date('d')) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
- }
-
- if (substr((string)($expect - count($uniques)), 0, 1) !== "-") {
- if ((int)($expect - count($uniques)) === 0) {
- echo("<span style='color:orange;opacity:.5;'> (±" . ($expect - count($uniques)) . ")</span>");
- } else {
- echo("<span style='color:limegreen;opacity:.5;'> (+" . ($expect - count($uniques)) . ")</span>");
- }
- } else {
- echo("<span style='color:red;opacity:.5;'> (" . ($expect - count($uniques)) . ")</span>");
- }
-
- ?></span></li>
- <li class="list-group-item"><?= l("Today", "Aujourd'hui") ?> <span style="float:right;"><?php
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m')) {
- foreach ($days as $day => $pages) {
- if ($day === date('d')) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
- }
-
- $today = count($uniques);
- echo ($today);
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m')) {
- foreach ($days as $day => $pages) {
- if ($day === date('d', strtotime("-1 day"))) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
- }
-
- if (substr((string)($today - count($uniques)), 0, 1) !== "-") {
- if ((int)($today - count($uniques)) === 0) {
- echo("<span style='color:orange;'> (±" . ($today - count($uniques)) . ")</span>");
- } else {
- echo("<span style='color:limegreen;'> (+" . ($today - count($uniques)) . ")</span>");
- }
- } else {
- echo("<span style='color:red;'> (" . ($today - count($uniques)) . ")</span>");
- }
-
- ?></span></li>
- <li class="list-group-item"><?= l("Yesterday", "Hier") ?> <span style="float:right;"><?php
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m')) {
- foreach ($days as $day => $pages) {
- if ($day === date('d', strtotime("-1 day"))) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
- }
-
- $yesterday = count($uniques);
- echo ($yesterday);
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m')) {
- foreach ($days as $day => $pages) {
- if ($day === date('d', strtotime("-2 day"))) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
- }
-
- if (substr((string)($yesterday - count($uniques)), 0, 1) !== "-") {
- if ((int)($yesterday - count($uniques)) === 0) {
- echo("<span style='color:orange;'> (±" . ($yesterday - count($uniques)) . ")</span>");
- } else {
- echo("<span style='color:limegreen;'> (+" . ($yesterday - count($uniques)) . ")</span>");
- }
- } else {
- echo("<span style='color:red;'> (" . ($yesterday - count($uniques)) . ")</span>");
- }
-
- ?></span></li>
- </ul>
-
- <ul class="list-group" style="margin-top:20px;">
- <li class="list-group-item text-muted"><?= date("F Y", strtotime("+1 month")) ?> <span style="float:right;"><?php
-
- $uniques = [];
- $totalDays = 0;
-
- foreach ($db as $months) {
- foreach ($months as $days) {
- $totalDays++;
- $dayUniques = [];
-
- foreach ($days as $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $dayUniques)) {
- array_push($dayUniques, $visitor);
- }
- }
- }
- }
-
- $uniques = array_merge($uniques, $dayUniques);
- }
- }
-
- $expect = round(count($uniques) / $totalDays);
- echo ($expect);
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m')) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
-
- if (substr((string)($expect - count($uniques)), 0, 1) !== "-") {
- if ((int)($expect - count($uniques)) === 0) {
- echo("<span style='color:orange;opacity:.5;'> (±" . ($expect - count($uniques)) . ")</span>");
- } else {
- echo("<span style='color:limegreen;opacity:.5;'> (+" . ($expect - count($uniques)) . ")</span>");
- }
- } else {
- echo("<span style='color:red;opacity:.5;'> (" . ($expect - count($uniques)) . ")</span>");
- }
-
- ?></span></li>
- <li class="list-group-item"><?= date("F Y") ?> <span style="float:right;"><?php
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m')) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
-
- $today = count($uniques);
- echo ($today);
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m', strtotime("-1 month"))) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
-
- if (substr((string)($today - count($uniques)), 0, 1) !== "-") {
- if ((int)($today - count($uniques)) === 0) {
- echo("<span style='color:orange;'> (±" . ($today - count($uniques)) . ")</span>");
- } else {
- echo("<span style='color:limegreen;'> (+" . ($today - count($uniques)) . ")</span>");
- }
- } else {
- echo("<span style='color:red;'> (" . ($today - count($uniques)) . ")</span>");
- }
-
- ?></span></li>
- <li class="list-group-item"><?= date("F Y", strtotime("-1 month")) ?> <span style="float:right;"><?php
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m', strtotime("-1 month"))) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
-
- $today = count($uniques);
- echo ($today);
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m', strtotime("-2 month"))) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
-
- if (substr((string)($today - count($uniques)), 0, 1) !== "-") {
- if ((int)($today - count($uniques)) === 0) {
- echo("<span style='color:orange;'> (±" . ($today - count($uniques)) . ")</span>");
- } else {
- echo("<span style='color:limegreen;'> (+" . ($today - count($uniques)) . ")</span>");
- }
- } else {
- echo("<span style='color:red;'> (" . ($today - count($uniques)) . ")</span>");
- }
-
- ?></span></li>
- <li class="list-group-item"><?= date("F Y", strtotime("-2 month")) ?> <span style="float:right;"><?php
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m', strtotime("-2 month"))) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
-
- $today = count($uniques);
- echo ($today);
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m', strtotime("-3 month"))) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
-
- if (substr((string)($today - count($uniques)), 0, 1) !== "-") {
- if ((int)($today - count($uniques)) === 0) {
- echo("<span style='color:orange;'> (±" . ($today - count($uniques)) . ")</span>");
- } else {
- echo("<span style='color:limegreen;'> (+" . ($today - count($uniques)) . ")</span>");
- }
- } else {
- echo("<span style='color:red;'> (" . ($today - count($uniques)) . ")</span>");
- }
-
- ?></span></li><li class="list-group-item"><?= date("F Y", strtotime("-3 month")) ?> <span style="float:right;"><?php
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m', strtotime("-3 month"))) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
-
- $today = count($uniques);
- echo ($today);
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m', strtotime("-4 month"))) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
-
- if (substr((string)($today - count($uniques)), 0, 1) !== "-") {
- if ((int)($today - count($uniques)) === 0) {
- echo("<span style='color:orange;'> (±" . ($today - count($uniques)) . ")</span>");
- } else {
- echo("<span style='color:limegreen;'> (+" . ($today - count($uniques)) . ")</span>");
- }
- } else {
- echo("<span style='color:red;'> (" . ($today - count($uniques)) . ")</span>");
- }
-
- ?></span></li><li class="list-group-item"><?= date("F Y", strtotime("-4 month")) ?> <span style="float:right;"><?php
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m', strtotime("-4 month"))) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
-
- $today = count($uniques);
- echo ($today);
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m', strtotime("-5 month"))) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
-
- if (substr((string)($today - count($uniques)), 0, 1) !== "-") {
- if ((int)($today - count($uniques)) === 0) {
- echo("<span style='color:orange;'> (±" . ($today - count($uniques)) . ")</span>");
- } else {
- echo("<span style='color:limegreen;'> (+" . ($today - count($uniques)) . ")</span>");
- }
- } else {
- echo("<span style='color:red;'> (" . ($today - count($uniques)) . ")</span>");
- }
-
- ?></span></li><li class="list-group-item"><?= date("F Y", strtotime("-5 month")) ?> <span style="float:right;"><?php
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m', strtotime("-5 month"))) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
-
- $today = count($uniques);
- echo ($today);
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m', strtotime("-6 month"))) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
-
- if (substr((string)($today - count($uniques)), 0, 1) !== "-") {
- if ((int)($today - count($uniques)) === 0) {
- echo("<span style='color:orange;'> (±" . ($today - count($uniques)) . ")</span>");
- } else {
- echo("<span style='color:limegreen;'> (+" . ($today - count($uniques)) . ")</span>");
- }
- } else {
- echo("<span style='color:red;'> (" . ($today - count($uniques)) . ")</span>");
- }
-
- ?></span></li>
- </ul>
-
- <ul class="list-group" style="margin-top:20px;">
- <li class="list-group-item"><?= date("Y") ?> <span style="float:right;"><?php
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
-
- $today = count($uniques);
- echo ($today);
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y', strtotime("-1 year"))) {
- foreach ($months as $month => $days) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
-
- if (substr((string)($today - count($uniques)), 0, 1) !== "-") {
- if ((int)($today - count($uniques)) === 0) {
- echo("<span style='color:orange;'> (±" . ($today - count($uniques)) . ")</span>");
- } else {
- echo("<span style='color:limegreen;'> (+" . ($today - count($uniques)) . ")</span>");
- }
- } else {
- echo("<span style='color:red;'> (" . ($today - count($uniques)) . ")</span>");
- }
-
- ?></span></li>
- <li class="list-group-item"><?= date("Y", strtotime("-1 year")) ?> <span style="float:right;"><?php
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y', strtotime("-1 year"))) {
- foreach ($months as $month => $days) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
-
- $today = count($uniques);
- echo ($today);
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y', strtotime("-2 year"))) {
- foreach ($months as $month => $days) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
-
- if (substr((string)($today - count($uniques)), 0, 1) !== "-") {
- if ((int)($today - count($uniques)) === 0) {
- echo("<span style='color:orange;'> (±" . ($today - count($uniques)) . ")</span>");
- } else {
- echo("<span style='color:limegreen;'> (+" . ($today - count($uniques)) . ")</span>");
- }
- } else {
- echo("<span style='color:red;'> (" . ($today - count($uniques)) . ")</span>");
- }
-
- ?></span></li>
- <li class="list-group-item"><?= date("Y", strtotime("-2 year")) ?> <span style="float:right;"><?php
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y', strtotime("-2 year"))) {
- foreach ($months as $month => $days) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
-
- $today = count($uniques);
- echo ($today);
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y', strtotime("-3 year"))) {
- foreach ($months as $month => $days) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
-
- if (substr((string)($today - count($uniques)), 0, 1) !== "-") {
- if ((int)($today - count($uniques)) === 0) {
- echo("<span style='color:orange;'> (±" . ($today - count($uniques)) . ")</span>");
- } else {
- echo("<span style='color:limegreen;'> (+" . ($today - count($uniques)) . ")</span>");
- }
- } else {
- echo("<span style='color:red;'> (" . ($today - count($uniques)) . ")</span>");
- }
-
- ?></span></li>
- </ul>
-
- <br>
-
- <ul class="list-group">
- <li class="list-group-item">
- <details>
- <summary><?= l("Kartik downloads", "Téléchargements de Kartik") ?></summary>
- <ul class="list-group">
- <li class="list-group-item"><b><?= l("All update channels", "Tous les canaux de mise à jour") ?> <span style="float:right;"><?= (int)trim(file_get_contents("/mnt/kartik-cdn/stats/stable")) + (int)trim(file_get_contents("/mnt/kartik-cdn/stats/eap")) + (int)trim(file_get_contents("/mnt/kartik-cdn/stats/beta")) + (int)trim(file_get_contents("/mnt/kartik-cdn/stats/nightly")) ?> downloads</span></b></li>
- <li class="list-group-item"><img alt="" src="https://github.com/Minteck-Projects/Kartik-Core/raw/testing/logo/logo.png" width="24px"> Kartik Stable <span style="float:right;"><?= trim(file_get_contents("/mnt/kartik-cdn/stats/stable")) ?> downloads</span></li>
- <li class="list-group-item"><img alt="" src="https://github.com/Minteck-Projects/Kartik-Core/raw/testing/logo/logo-eap.png" width="24px"> Kartik EAP <span style="float:right;"><?= trim(file_get_contents("/mnt/kartik-cdn/stats/eap")) ?> <?= l("downloads", "téléchargements") ?></span></li>
- <li class="list-group-item"><img alt="" src="https://github.com/Minteck-Projects/Kartik-Core/raw/testing/logo/logo-beta.png" width="24px"> Kartik Beta <span style="float:right;"><?= trim(file_get_contents("/mnt/kartik-cdn/stats/beta")) ?> <?= l("downloads", "téléchargements") ?></span></li>
- <li class="list-group-item"><img alt="" src="https://github.com/Minteck-Projects/Kartik-Core/raw/testing/logo/logo-nightly.png" width="24px"> Kartik Nightly <span style="float:right;"><?= trim(file_get_contents("/mnt/kartik-cdn/stats/nightly")) ?> <?= l("downloads", "téléchargements") ?></span></li>
- </ul>
- </details>
- </li>
- <li class="list-group-item">
- <details>
- <summary><?= l("Page-specific statistics", "Statistiques par page") ?></summary>
- <p>
- <?php
-
- $assocs = [];
- $spages = [];
-
- foreach ($db as $year => $months) {
- foreach ($months as $month => $days) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- if (substr($page, 0, 7) !== "/admin/") {
- if (!isset($spages[$page])) {
- $spages[$page] = 0;
- }
- foreach ($visitors as $visitor) {
- if (!in_array($page . "|" . $visitor, $assocs)) {
- $spages[$page]++;
- array_push($assocs, $page . "|" . $visitor);
- }
- }
- }
- }
- }
- }
- }
-
- $max = 0;
- foreach ($spages as $visitors) {
- if ($visitors > $max) {
- $max = $visitors;
- }
- }
-
- arsort($spages);
-
- foreach ($spages as $page => $visitors): ?>
- <div class="progress" style="height:25px;background:#222;margin-bottom:2px;">
- <div class="progress-bar" style="background:#444;width:<?= ($visitors/$max)*100 ?>%;"></div>
- <span class="progress-bar-text"><a class="text-white" href="<?= urlize($page) ?>" target="_blank"><?= $page ?></a> <span class="text-muted">(<?= $visitors ?>)</span></span>
- </div>
- <?php endforeach; ?>
- </p>
-
- <style>
- .progress-bar-text {
- position: absolute;
- padding-top: 14px;
- font-size: 14px;
- text-align:left;
- padding-left:10px;
- }
- </style>
- </details>
- </li>
- </ul>
-</div>
-
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/footer.php"; ?>
\ No newline at end of file |