Added listremoval to nochan.php

This commit is contained in:
kasperrt
2014-12-16 17:08:44 +01:00
parent 4d3b38948d
commit e2bed47415

View File

@@ -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)));