From 413528beebf515e0adeb3e41df341799411fd0b8 Mon Sep 17 00:00:00 2001 From: Gargaj Date: Fri, 31 Dec 2021 23:17:50 +0100 Subject: [PATCH] add row about youtube singularity --- include_pouet_index/box-index-stats.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include_pouet_index/box-index-stats.php b/include_pouet_index/box-index-stats.php index 163e9dd..57e51d0 100644 --- a/include_pouet_index/box-index-stats.php +++ b/include_pouet_index/box-index-stats.php @@ -27,6 +27,7 @@ function LoadFromDB() { $this->data[$v."_24h"] = (int)SQLLib::SelectRow("SELECT count(0) as c FROM ".$v." WHERE (UNIX_TIMESTAMP()-UNIX_TIMESTAMP(".$field."))<=3600*24")->c; } $this->data["usersSeen24h"] = (int)SQLLib::SelectRow("SELECT count(0) as c FROM users WHERE (UNIX_TIMESTAMP()-UNIX_TIMESTAMP(lastLogin))<=3600*24")->c; + $this->data["youtube"] = (int)SQLLib::SelectRow("SELECT COUNT(0) AS c FROM prods LEFT JOIN downloadlinks ON downloadlinks.prod = prods.id AND downloadlinks.type LIKE '%youtube%' WHERE downloadlinks.type IS NOT NULL")->c; } function Render() { @@ -46,6 +47,10 @@ function Render() { echo " ".$this->data["usersSeen24h"]." users seen in the last 24h\n"; echo "  \n"; echo "\n"; + echo "\n"; + echo " progress to the youtube singularity: ".sprintf("%.2f",$this->data["youtube"] / $this->data["prods_all"] * 100.0)."%\n"; + echo "  \n"; + echo "\n"; echo "\n"; }