From 31e76dc9999fdc2d36a52395ad9aa14005eb8c00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Rynning-T=C3=B8nnesen?= Date: Mon, 9 Feb 2015 20:18:03 +0100 Subject: [PATCH] Added new videoplaceholder from own channel --- js/youtube.js | 5 ++++- php/change.php | 6 +++--- php/nochan.php | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/js/youtube.js b/js/youtube.js index 510fd4eb..1164dee7 100755 --- a/js/youtube.js +++ b/js/youtube.js @@ -362,7 +362,10 @@ function readyLooks() } function setBGimage(id){ - if(window.mozInnerScreenX == null && !window.mobilecheck()){ + if(id == "30H2Z8Lr-4c") + { + $("#bgimage").css("background-image", "url(bg4.jpg);"); + }else if(window.mozInnerScreenX == null && !window.mobilecheck()){ $("#bgimage").css("background-image", "url(http://img.youtube.com/vi/"+id+"/0.jpg)"); }else if(window.mobilecheck()){ $("#mobile-banner").css("background-image", "url(http://img.youtube.com/vi/"+id+"/hqdefault.jpg)"); diff --git a/php/change.php b/php/change.php index 6cb47784..0268e087 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("XQu8TTBmGhA" => array("id" => "XQu8TTBmGhA", "title" => "Empty Channel, search to add a video")), "songs" => array(), "conf" => array("startTime" => time(), "views" => array(), "skips" => array())); +$array = array("nowPlaying" => array("30H2Z8Lr-4c" => array("id" => "30H2Z8Lr-4c", "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) && ($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 + if(($data["conf"]["removeplay"] == "false" || $q != 1) && ($np[0]["id"] != "30H2Z8Lr-4c" && !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()); } @@ -117,7 +117,7 @@ else if(isset($_GET['v'])){ //if it { $video = htmlspecialchars($_GET['v']); //id of the video $name = htmlspecialchars($_GET['n']); //name of the video - if($np[0]["id"] == "XQu8TTBmGhA") + if($np[0]["id"] == "30H2Z8Lr-4c") { $q = array("nowPlaying" => array($video => array("id" => $video, "title" => $name, "votes" => 0, "added" => time(), "guids" => array())), "songs" => array(), "conf" => array("startTime" => time(), "views" => array(), "skips" => array())); $q["nowPlaying"][$video]["votes"] = 1; //Upping the votes, so it comes further up than the ones already played diff --git a/php/nochan.php b/php/nochan.php index bdefbe74..96888e4c 100755 --- a/php/nochan.php +++ b/php/nochan.php @@ -18,7 +18,7 @@ foreach($dir as $files){ $file = file_get_contents('./lists/'.$files); //Checking if the channel has the setting for showing on the frontpage set to true. $data = json_decode($file, TRUE); $q = array_values($data["nowPlaying"]); - if($q[0]["id"] == "XQu8TTBmGhA"); + if($q[0]["id"] == "30H2Z8Lr-4c"); { unlink("./lists/".$files); }