From ebdc36d4f7ad18e3316b2ad5522c55612c0df761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Rynning-T=C3=B8nnesen?= Date: Fri, 13 Feb 2015 12:32:16 +0100 Subject: [PATCH] added viewers on hover for the channels --- php/nochan.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/php/nochan.php b/php/nochan.php index e2602328..2e5d7e8f 100755 --- a/php/nochan.php +++ b/php/nochan.php @@ -11,11 +11,13 @@ $all_channels = array(); $time = 60*60*24*4; //4 dager $to = 60*60*24*2; $i = 0; +$v = 0; $tooMany = false; $dir = "./lists"; chdir($dir); array_multisort(array_map('filemtime', ($fil = glob("*.json"))), SORT_DESC, $fil); +$viewers = array(); foreach($fil as $files){ if(strpos($files, '.json') !== FALSE){ @@ -33,6 +35,7 @@ foreach($fil as $files){ $data = json_decode($file, TRUE); if(!array_key_exists("frontpage", $data['conf']) || $data['conf']['frontpage'] == "true" && $i <= 8){ //If it is true, the channelname will be shown on the frontpage array_push($channels, ucfirst(str_replace(".json", "", $files))); + array_push($viewers, sizeof($data["conf"]["views"])); } } $i++; @@ -41,6 +44,8 @@ foreach($fil as $files){ } } +print_r($viewers[$v]); + ?>
Active Channels
- ".htmlspecialchars($channel)."";} ?> + ".htmlspecialchars($channel).""; $v++;} ?>