Added new videoplaceholder from own channel

This commit is contained in:
Kasper Rynning-Tønnesen
2015-02-09 20:18:03 +01:00
parent 99b1815146
commit 31e76dc999
3 changed files with 8 additions and 5 deletions

View File

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

View File

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

View File

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