mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
fixed empty files array?
This commit is contained in:
@@ -12,9 +12,9 @@ $list = explode("/", htmlspecialchars(strtolower($_SERVER["REQUEST_URI"])));
|
||||
if($list[1]==""||!isset($list[1])||count($list)<=1)$list="videos";
|
||||
else $list=$list[1];
|
||||
$list="lists/".$list.".json";
|
||||
|
||||
$array = array("nowPlaying" => array(), "songs" => array(), "conf" => array("startTime" => time(), "views" => 0, "skips" => array()));
|
||||
$f = @fopen($list,"x");
|
||||
if($f){ fwrite($f,"[[],[".time()."],[],[],[],[]]"); fclose($f); }
|
||||
if($f){ fwrite($f,$array); fclose($f); }
|
||||
$file = file_get_contents($list);
|
||||
$data = json_decode($file, TRUE);
|
||||
$songs = $data["songs"];
|
||||
|
||||
Reference in New Issue
Block a user