Added and styled delete button

This commit is contained in:
Nicolas A. Tonne
2014-10-21 14:47:25 +02:00
parent 15c6846fb6
commit d0c5f92ac7
2 changed files with 33 additions and 17 deletions

View File

@@ -103,11 +103,26 @@ else if(isset($_GET['v'])){ //add
} }
} }
else if(isset($_GET['vote'])){ //add vote else if(isset($_GET['vote'])){ //add vote
$vote=$_GET['vote']; $vote=$_GET['vote'];
$id=$_GET['id']; $id=$_GET['id'];
//$i = array_search($id, $data["songs"]); //$i = array_search($id, $data["songs"]);
//$i = array_search($id, array_keys($data["songs"])) //$i = array_search($id, array_keys($data["songs"]))
if($vote=='del'){
$pass=$_GET['pass'];
$x = explode("/", htmlspecialchars(strtolower($_SERVER["REQUEST_URI"])));
$pass=crypt($pass, '$6$rounds=9001$'.$x[1].'Fuck0ffuSn34kyn!ggerzZ$');
$adminpass='$6$rounds=9001$tritoenFuck0ffuS$si2Hi95ghCxSbVAfgeBN0dVzf5DTn1mQoizOuLEzr0N2q6fclGLrapscJQA0PsA2F0TlG5q0YAYrPHy9dZxpj0'; //$data["conf"]["admin"];
if($adminpass == $pass){
unset($data["songs"][$id]);
file_put_contents($list, json_encode($data));
echo "removed song with ID: ".$id." from list: ".$list;
}
}else
{
if($vote == 'neg'){$voteAdd = -1;} if($vote == 'neg'){$voteAdd = -1;}
else if($vote == 'pos'){$voteAdd = 1;} else if($vote == 'pos'){$voteAdd = 1;}
if(array_key_exists($id, $data["songs"]) && !in_array($guid, $data["songs"][$id]["guids"])) if(array_key_exists($id, $data["songs"]) && !in_array($guid, $data["songs"][$id]["guids"]))
@@ -130,6 +145,7 @@ else if(isset($_GET['vote'])){ //add vote
echo array_key_exists($id, $data["songs"]); echo array_key_exists($id, $data["songs"]);
} }
} }
}
else if(isset($_GET['skip'])){ //skip song request else if(isset($_GET['skip'])){ //skip song request
$viewers=$data["conf"]["views"]; $viewers=$data["conf"]["views"];
$skips=count($data["conf"]["skips"]); $skips=count($data["conf"]["skips"]);

View File

@@ -72,7 +72,7 @@ body{background:#000; margin:0; }
.votes{position: relative; margin-top: -0-5em; font-size: 18px; color:#fff;} .votes{position: relative; margin-top: -0-5em; font-size: 18px; color:#fff;}
#plus, #minus {text-decoration: none; color:#eee; margin-left: 2px; padding-left: 3px; padding-right: 3px; } #plus, #minus {text-decoration: none; color:#eee; margin-left: 2px; padding-left: 3px; padding-right: 3px; }
#plus:hover,#minus:hover{color:#000;} #plus:hover,#minus:hover{color:#000;}
#del{float: right; font-weight: bold; margin-right: 20px; margin-top:0px; border-radius: 2px;} #del{float: right; font-weight: bold; margin-right: 20px; margin-top:0px; border-radius: 2px; display:none;}
#del:hover{color:red;} #del:hover{color:red;}
#player{height: 68%; height: calc(87% - 183px); width: 60%; border-radius: 3px; box-shadow: 0 8px 11px -4px black;} #player{height: 68%; height: calc(87% - 183px); width: 60%; border-radius: 3px; box-shadow: 0 8px 11px -4px black;}