Make christmas songs impossible to queue when it isn't December
This commit is contained in:
parent
e3d2333dde
commit
0f2f22b280
|
@ -5,13 +5,14 @@ require 'header.php';
|
|||
if ( !isset($_REQUEST['songid']) ) {
|
||||
exit();
|
||||
}
|
||||
$songid = intval($_REQUEST['songid']);
|
||||
$song = new Song($_REQUEST['songid']);
|
||||
if ( (substr($song->getPath(), 0, 10) == "Christmas/") && (intval(date("n")) != 12) ) exit();
|
||||
|
||||
if ( $_SESSION['queuetarget'] == 0 ) {
|
||||
$query = "INSERT INTO " . INSTANTQTABLE . " (songid) VALUES(:songid)";
|
||||
$sth = $globaldbh->prepare($query);
|
||||
$fields = array();
|
||||
$fields[':songid'] = $songid;
|
||||
$fields[':songid'] = $song->getID();
|
||||
$sth->execute($fields);
|
||||
} else {
|
||||
if ( RESTRICTQUEUES && (substr($_SERVER['REMOTE_ADDR'], 0, strlen(LOCALNETWORK)) != LOCALNETWORK) ) exit();
|
||||
|
@ -19,7 +20,7 @@ if ( $_SESSION['queuetarget'] == 0 ) {
|
|||
$sth = $globaldbh->prepare($query);
|
||||
$fields = array();
|
||||
$fields[':qid'] = $_SESSION['queuetarget'];
|
||||
$fields[':songid'] = $songid;
|
||||
$fields[':songid'] = $song->getID();
|
||||
$sth->execute($fields);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user