mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Added and styled delete button
This commit is contained in:
@@ -103,31 +103,47 @@ 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 == 'neg'){$voteAdd = -1;}
|
if($vote=='del'){
|
||||||
else if($vote == 'pos'){$voteAdd = 1;}
|
$pass=$_GET['pass'];
|
||||||
if(array_key_exists($id, $data["songs"]) && !in_array($guid, $data["songs"][$id]["guids"]))
|
$x = explode("/", htmlspecialchars(strtolower($_SERVER["REQUEST_URI"])));
|
||||||
{
|
$pass=crypt($pass, '$6$rounds=9001$'.$x[1].'Fuck0ffuSn34kyn!ggerzZ$');
|
||||||
$data["songs"][$id]["votes"] = $data["songs"][$id]["votes"] + $voteAdd;
|
$adminpass='$6$rounds=9001$tritoenFuck0ffuS$si2Hi95ghCxSbVAfgeBN0dVzf5DTn1mQoizOuLEzr0N2q6fclGLrapscJQA0PsA2F0TlG5q0YAYrPHy9dZxpj0'; //$data["conf"]["admin"];
|
||||||
if($data["songs"][$id]["votes"] > -1)
|
|
||||||
{
|
if($adminpass == $pass){
|
||||||
$data["songs"][$id]["added"] = time();
|
unset($data["songs"][$id]);
|
||||||
array_push($data["songs"][$id]["guids"], $guid);
|
|
||||||
foreach($data["songs"] as $k=>$v) {
|
|
||||||
$sort['votes'][$k] = $v['votes'];
|
|
||||||
$sort['added'][$k] = $v['added'];
|
|
||||||
}
|
|
||||||
array_multisort($sort['votes'], SORT_DESC, $sort['added'], SORT_ASC, $data["songs"]);
|
|
||||||
file_put_contents($list, json_encode($data));
|
file_put_contents($list, json_encode($data));
|
||||||
echo "Vote registrated. I hope";
|
echo "removed song with ID: ".$id." from list: ".$list;
|
||||||
}
|
}
|
||||||
|
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
echo array_key_exists($id, $data["songs"]);
|
if($vote == 'neg'){$voteAdd = -1;}
|
||||||
|
else if($vote == 'pos'){$voteAdd = 1;}
|
||||||
|
if(array_key_exists($id, $data["songs"]) && !in_array($guid, $data["songs"][$id]["guids"]))
|
||||||
|
{
|
||||||
|
$data["songs"][$id]["votes"] = $data["songs"][$id]["votes"] + $voteAdd;
|
||||||
|
if($data["songs"][$id]["votes"] > -1)
|
||||||
|
{
|
||||||
|
$data["songs"][$id]["added"] = time();
|
||||||
|
array_push($data["songs"][$id]["guids"], $guid);
|
||||||
|
foreach($data["songs"] as $k=>$v) {
|
||||||
|
$sort['votes'][$k] = $v['votes'];
|
||||||
|
$sort['added'][$k] = $v['added'];
|
||||||
|
}
|
||||||
|
array_multisort($sort['votes'], SORT_DESC, $sort['added'], SORT_ASC, $data["songs"]);
|
||||||
|
file_put_contents($list, json_encode($data));
|
||||||
|
echo "Vote registrated. I hope";
|
||||||
|
}
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
echo array_key_exists($id, $data["songs"]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(isset($_GET['skip'])){ //skip song request
|
else if(isset($_GET['skip'])){ //skip song request
|
||||||
|
|||||||
@@ -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;}
|
||||||
|
|||||||
Reference in New Issue
Block a user