From 189aa45b369e229df2e2299afd5de0cf7df17a6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Rynning-T=C3=B8nnesen?= Date: Mon, 9 Feb 2015 19:06:35 +0100 Subject: [PATCH] Trying to add placeholder --- php/change.php | 4 ++-- static/favicon.png | Bin static/highlogo.png | Bin 3 files changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 static/favicon.png mode change 100644 => 100755 static/highlogo.png diff --git a/php/change.php b/php/change.php index e7c67b98..2ab74d09 100755 --- a/php/change.php +++ b/php/change.php @@ -8,7 +8,7 @@ if($list[1]==""||!isset($list[1])||count($list)<=1)$list="videos"; else $list=$list[1]; $list="../lists/".$list.".json"; //actually setting the list for the target. Under is the array for an empty list being created -$array = array("nowPlaying" => array(), "songs" => array(), "conf" => array("startTime" => time(), "views" => array(), "skips" => array())); +$array = array("nowPlaying" => array("XQu8TTBmGhA" => array("id" => "XQu8TTBmGhA", "title" => "Empty Channel, search to add a video")), "songs" => array(), "conf" => array("startTime" => time(), "views" => array(), "skips" => array())); $array = json_encode($array); //encoding the array $f = @fopen($list,"x"); //opening a file, ignoring warnings if($f){ fwrite($f,$array); fclose($f); } //if the file doesn't exist, we create a new one, and adds the newly made array there @@ -70,7 +70,7 @@ if(isset($_REQUEST['thisUrl'])){ array_shift($data["songs"]); //already shifts the array of songs, because we have the first in the queue saved $q = $data["conf"]; $q = array_key_exists("removeplay", $q); - if($data["conf"]["removeplay"] == "false" || $q != 1) //checking if removeplay exists or if its false. If its true, the song we just played won't be added to the queue + if(($data["conf"]["removeplay"] == "false" || $q != 1) && ($np[0]["id"] != "XQu8TTBmGhA" && !is_null($firstToAdd))) //checking if removeplay exists or if its false. If its true, the song we just played won't be added to the queue { //here we just adds the song that was just played into the queue in the songs array, take note here we set added as the current time it was added. This is because of the multisort further down $data["songs"][$np[0]["id"]] = array("id" => $np[0]["id"], "title" => $np[0]["title"], "votes" => $np[0]["votes"], "added" => time(), "guids" => array()); } diff --git a/static/favicon.png b/static/favicon.png old mode 100644 new mode 100755 diff --git a/static/highlogo.png b/static/highlogo.png old mode 100644 new mode 100755