Skip to content

Commit

Permalink
add row about youtube singularity
Browse files Browse the repository at this point in the history
  • Loading branch information
Gargaj committed Jan 30, 2022
1 parent dac9137 commit 413528b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include_pouet_index/box-index-stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -46,6 +47,10 @@ function Render() {
echo " <td class='r".(($n++&1)+1)."'>".$this->data["usersSeen24h"]." users seen in the last 24h</td>\n";
echo " <td class='r".(($n++&1)+1)." stat'>&nbsp;</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo " <td class='r".(($n++&1)+1)."'>progress to the youtube singularity: ".sprintf("%.2f",$this->data["youtube"] / $this->data["prods_all"] * 100.0)."%</td>\n";
echo " <td class='r".(($n++&1)+1)." stat'>&nbsp;</td>\n";
echo "</tr>\n";
echo "</table>\n";
}

Expand Down

0 comments on commit 413528b

Please sign in to comment.