Compare commits
No commits in common. "4bfaf9419f52973dca96e1334b80abb93036362f" and "69ba9e1d1470ad5fe799e7be756920c0ef59b955" have entirely different histories.
4bfaf9419f
...
69ba9e1d14
|
@ -9,22 +9,20 @@ $sth = $globaldbh->prepare($query);
|
||||||
$sth->execute($fields);
|
$sth->execute($fields);
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
$data["customq"] = array();
|
$firstsong = true;
|
||||||
while ( $row = $sth->fetch() ) {
|
while ( $row = $sth->fetch() ) {
|
||||||
$songid = $row['songid'];
|
$songid = $row['songid'];
|
||||||
$song = new Song($songid);
|
$song = new Song($songid);
|
||||||
$curdata = array();
|
echo "<div id='customq_{$songid}' class='songlist_song_container' onClick='dropCustomQSong({$songid});'>\n";
|
||||||
$curdata["id"] = $song->getID();
|
echo " <div class='songlist_img_container'><img class='songlist_img' src='{$song->getArtFile(ARTURL)}'></div>\n";
|
||||||
$curdata["arturl"] = $song->getArtFile(ARTURL);
|
echo " <div class='songlist_details_container'>\n";
|
||||||
$curdata["title"] = $song->getTitle(HTMLSAFE);
|
echo " <p class='nomargin'><span class='playing_label'>Song:</span> {$song->getTitle(HTMLSAFE)}</p>\n";
|
||||||
$curdata["artist"] = $song->getArtist(HTMLSAFE);
|
echo " <p class='nomargin'><span class='playing_label'>Artist:</span> {$song->getArtist(HTMLSAFE)}</p>\n";
|
||||||
$curdata["album"] = $song->getAlbum(HTMLSAFE);
|
echo " <p class='nomargin'><span class='playing_label'>Album:</span> {$song->getAlbum(HTMLSAFE)}</p>\n";
|
||||||
$curdata["year"] = $song->getYear(HTMLSAFE);
|
echo " </div>\n";
|
||||||
$data['customq'][] = $curdata;
|
echo "</div>\n";
|
||||||
|
echo "<hr class='songlist'>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
header('Content-Type: application/json');
|
|
||||||
echo json_encode($data);
|
|
||||||
exit();
|
exit();
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ $data = array();
|
||||||
foreach ( $queues as $queue ) {
|
foreach ( $queues as $queue ) {
|
||||||
$newdata = array();
|
$newdata = array();
|
||||||
$newdata['id'] = $queue->getID();
|
$newdata['id'] = $queue->getID();
|
||||||
$newdata['name'] = $queue->getName();
|
$newdata['name'] = $queue->getName(HTMLSAFE);
|
||||||
$newdata['type'] = $queue->getType();
|
$newdata['type'] = $queue->getType();
|
||||||
$newdata['active'] = $queue->getActive();
|
$newdata['active'] = $queue->getActive();
|
||||||
$data['queues'][] = $newdata;
|
$data['queues'][] = $newdata;
|
||||||
|
@ -19,4 +19,4 @@ header('Content-Type: application/json');
|
||||||
echo json_encode($data);
|
echo json_encode($data);
|
||||||
exit();
|
exit();
|
||||||
|
|
||||||
// vim: et ts=3 sw=3 ai:
|
?>
|
||||||
|
|
|
@ -10,22 +10,18 @@ if ( isset($_REQUEST['searchfor']) ) {
|
||||||
|
|
||||||
$songs = Song::getSearchList($searchfor);
|
$songs = Song::getSearchList($searchfor);
|
||||||
|
|
||||||
$data = array();
|
|
||||||
$data["search"] = array();
|
|
||||||
|
|
||||||
foreach ( $songs as $song ) {
|
foreach ( $songs as $song ) {
|
||||||
$curdata = array();
|
echo "<div id='search_{$song->getID()}' class='songlist_song_container' onClick='addSongToQueue({$song->getID()});'>\n";
|
||||||
$curdata["id"] = $song->getID();
|
echo " <div class='songlist_img_container'><img class='songlist_img' src='{$song->getArtFile(ARTURL)}'></div>\n";
|
||||||
$curdata["arturl"] = $song->getArtFile(ARTURL);
|
echo " <div class='songlist_details_container'>\n";
|
||||||
$curdata["title"] = $song->getTitle(HTMLSAFE);
|
echo " <p class='nomargin'><span class='playing_label'>Song:</span> {$song->getTitle(HTMLSAFE)}</p>\n";
|
||||||
$curdata["artist"] = $song->getArtist(HTMLSAFE);
|
echo " <p class='nomargin'><span class='playing_label'>Artist:</span> {$song->getArtist(HTMLSAFE)}</p>\n";
|
||||||
$curdata["album"] = $song->getAlbum(HTMLSAFE);
|
echo " <p class='nomargin'><span class='playing_label'>Album:</span> {$song->getAlbum(HTMLSAFE)}</p>\n";
|
||||||
$curdata["year"] = $song->getYear(HTMLSAFE);
|
echo " </div>\n";
|
||||||
$data['search'][] = $curdata;
|
echo "</div>\n";
|
||||||
|
echo "<hr class='songlist'>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
header('Content-Type: application/json');
|
|
||||||
echo json_encode($data);
|
|
||||||
exit();
|
exit();
|
||||||
|
|
||||||
// vim: sw=3 ts=3 et ai:
|
|
||||||
|
?>
|
||||||
|
|
|
@ -208,9 +208,6 @@ div.lists_contents {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.search_link {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
div.songlist_song_container {
|
div.songlist_song_container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
|
@ -7,7 +7,7 @@ var gettingSongList = false;
|
||||||
var gettingJukeboxList = false;
|
var gettingJukeboxList = false;
|
||||||
var searchTimeout = null;
|
var searchTimeout = null;
|
||||||
var queueTarget = 0;
|
var queueTarget = 0;
|
||||||
var paused = false;
|
var paused = true;
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('#tabs').tabs({
|
$('#tabs').tabs({
|
||||||
|
@ -193,9 +193,8 @@ function togglePause() {
|
||||||
|
|
||||||
function generateSongListHTML(type, songs) {
|
function generateSongListHTML(type, songs) {
|
||||||
var body = "";
|
var body = "";
|
||||||
var search = (type == "search") ? " search_link" : "";
|
|
||||||
songs.forEach(function(item, index, arr) {
|
songs.forEach(function(item, index, arr) {
|
||||||
body += "<div id='" + type + "_" + item.id + "' data-id='" + item.id + "' class='songlist_song_container" + search + "'>";
|
body += "<div id='" + type + "_" + item.id + "' class='songlist_song_container'>";
|
||||||
body += "<div class='songlist_img_container'><img class='songlist_img' src='" + item.arturl + "' /></div>";
|
body += "<div class='songlist_img_container'><img class='songlist_img' src='" + item.arturl + "' /></div>";
|
||||||
body += "<div class='songlist_details_container'>";
|
body += "<div class='songlist_details_container'>";
|
||||||
body += "<p><span>Title:</span> " + item.title + "</p>";
|
body += "<p><span>Title:</span> " + item.title + "</p>";
|
||||||
|
@ -263,9 +262,9 @@ function getJukeboxList() {
|
||||||
function getCustomQueueList() {
|
function getCustomQueueList() {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: 'ajax/ajax_getcustomq.php',
|
url: 'ajax/ajax_getcustomq.php',
|
||||||
dataType: 'json',
|
dataType: 'html',
|
||||||
success: function(data, stat, jqo) {
|
success: function(data, stat, jqo) {
|
||||||
$('#customq_contents').html(generateSongListHTML("customq", data.customq));
|
$('#customq_contents').html(data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -276,13 +275,10 @@ function executeSearch() {
|
||||||
if ( searchfor.length < 4 ) return false;
|
if ( searchfor.length < 4 ) return false;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: 'ajax/ajax_searchsongs.php',
|
url: 'ajax/ajax_searchsongs.php',
|
||||||
dataType: 'json',
|
dataType: 'html',
|
||||||
data: {searchfor: searchfor},
|
data: {searchfor: searchfor},
|
||||||
success: function(data, stat, jqo) {
|
success: function(data, stat, jqo) {
|
||||||
$('#search_contents').html(generateSongListHTML("search", data.search));
|
$('#search_contents').html(data);
|
||||||
$(".search_link").on("click", function(event) {
|
|
||||||
addSongToQueue($(event.currentTarget).data('id'));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
Require all denied
|
order deny,allow
|
||||||
|
deny from all
|
||||||
|
|
Loading…
Reference in New Issue
Block a user