From e2bed47415d1300c62d84bac229a733e3b6007c6 Mon Sep 17 00:00:00 2001 From: kasperrt Date: Tue, 16 Dec 2014 17:08:44 +0100 Subject: [PATCH] Added listremoval to nochan.php --- php/nochan.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/php/nochan.php b/php/nochan.php index 7f0825fa..e0425315 100755 --- a/php/nochan.php +++ b/php/nochan.php @@ -9,9 +9,20 @@ $dir = scandir('./lists'); $channels = array(); $all_channels = array(); $time = 60*60*24*4; //4 dager +$to = 0; foreach($dir as $files){ if(strpos($files, '.json') !== FALSE){ - if(time() - filemtime('./lists/'.$files) < $time){ + $time_lasted = time() - filemtime('./lists/'.$files); + if($time_lasted > $time) + { + clearstatcache(); + $size = filesize('./lists/'.$files); + if($size < 100){ + unlink("./lists/".$files); + $size; + } + } + if($time_lasted < $time){ array_push($channels, ucfirst(str_replace(".json", "", $files))); } array_push($all_channels, ucfirst(str_replace(".json", "", $files)));