Compare commits
	
		
			5 Commits
		
	
	
		
			69ba9e1d14
			...
			4bfaf9419f
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 4bfaf9419f | |||
| ad46bc9bd9 | |||
| ba1c7afa65 | |||
| 20d7bc42f5 | |||
| 12debe134b | 
| 
						 | 
					@ -9,20 +9,22 @@ $sth = $globaldbh->prepare($query);
 | 
				
			||||||
$sth->execute($fields);
 | 
					$sth->execute($fields);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$data = array();
 | 
					$data = array();
 | 
				
			||||||
$firstsong = true;
 | 
					$data["customq"] = array();
 | 
				
			||||||
while ( $row = $sth->fetch() ) {
 | 
					while ( $row = $sth->fetch() ) {
 | 
				
			||||||
   $songid = $row['songid'];
 | 
					   $songid = $row['songid'];
 | 
				
			||||||
   $song = new Song($songid);
 | 
					   $song = new Song($songid);
 | 
				
			||||||
   echo "<div id='customq_{$songid}' class='songlist_song_container' onClick='dropCustomQSong({$songid});'>\n";
 | 
					   $curdata = array();
 | 
				
			||||||
   echo "  <div class='songlist_img_container'><img class='songlist_img' src='{$song->getArtFile(ARTURL)}'></div>\n";
 | 
					   $curdata["id"] = $song->getID();
 | 
				
			||||||
   echo "  <div class='songlist_details_container'>\n";
 | 
					   $curdata["arturl"] = $song->getArtFile(ARTURL);
 | 
				
			||||||
   echo "    <p class='nomargin'><span class='playing_label'>Song:</span> {$song->getTitle(HTMLSAFE)}</p>\n";
 | 
					   $curdata["title"] = $song->getTitle(HTMLSAFE);
 | 
				
			||||||
   echo "    <p class='nomargin'><span class='playing_label'>Artist:</span> {$song->getArtist(HTMLSAFE)}</p>\n";
 | 
					   $curdata["artist"] = $song->getArtist(HTMLSAFE);
 | 
				
			||||||
   echo "    <p class='nomargin'><span class='playing_label'>Album:</span> {$song->getAlbum(HTMLSAFE)}</p>\n";
 | 
					   $curdata["album"] = $song->getAlbum(HTMLSAFE);
 | 
				
			||||||
   echo "  </div>\n";
 | 
					   $curdata["year"] = $song->getYear(HTMLSAFE);
 | 
				
			||||||
   echo "</div>\n";
 | 
					   $data['customq'][] = $curdata;
 | 
				
			||||||
   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(HTMLSAFE);
 | 
					   $newdata['name'] = $queue->getName();
 | 
				
			||||||
   $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,18 +10,22 @@ 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 ) {
 | 
				
			||||||
   echo "<div id='search_{$song->getID()}' class='songlist_song_container' onClick='addSongToQueue({$song->getID()});'>\n";
 | 
					   $curdata = array();
 | 
				
			||||||
   echo "  <div class='songlist_img_container'><img class='songlist_img' src='{$song->getArtFile(ARTURL)}'></div>\n";
 | 
					   $curdata["id"] = $song->getID();
 | 
				
			||||||
   echo "  <div class='songlist_details_container'>\n";
 | 
					   $curdata["arturl"] = $song->getArtFile(ARTURL);
 | 
				
			||||||
   echo "    <p class='nomargin'><span class='playing_label'>Song:</span> {$song->getTitle(HTMLSAFE)}</p>\n";
 | 
					   $curdata["title"] = $song->getTitle(HTMLSAFE);
 | 
				
			||||||
   echo "    <p class='nomargin'><span class='playing_label'>Artist:</span> {$song->getArtist(HTMLSAFE)}</p>\n";
 | 
					   $curdata["artist"] = $song->getArtist(HTMLSAFE);
 | 
				
			||||||
   echo "    <p class='nomargin'><span class='playing_label'>Album:</span> {$song->getAlbum(HTMLSAFE)}</p>\n";
 | 
					   $curdata["album"] = $song->getAlbum(HTMLSAFE);
 | 
				
			||||||
   echo "  </div>\n";
 | 
					   $curdata["year"] = $song->getYear(HTMLSAFE);
 | 
				
			||||||
   echo "</div>\n";
 | 
					   $data['search'][] = $curdata;
 | 
				
			||||||
   echo "<hr class='songlist'>\n";
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					header('Content-Type: application/json');
 | 
				
			||||||
 | 
					echo json_encode($data);
 | 
				
			||||||
exit();
 | 
					exit();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// vim: sw=3 ts=3 et ai:
 | 
				
			||||||
?>
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -208,6 +208,9 @@ 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 = true;
 | 
					var paused = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$(document).ready(function() {
 | 
					$(document).ready(function() {
 | 
				
			||||||
   $('#tabs').tabs({
 | 
					   $('#tabs').tabs({
 | 
				
			||||||
| 
						 | 
					@ -193,8 +193,9 @@ 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 + "' class='songlist_song_container'>";
 | 
					      body += "<div id='" + type + "_" + item.id + "' data-id='" + item.id + "' class='songlist_song_container" + search + "'>";
 | 
				
			||||||
      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>";
 | 
				
			||||||
| 
						 | 
					@ -262,9 +263,9 @@ function getJukeboxList() {
 | 
				
			||||||
function getCustomQueueList() {
 | 
					function getCustomQueueList() {
 | 
				
			||||||
   $.ajax({
 | 
					   $.ajax({
 | 
				
			||||||
      url: 'ajax/ajax_getcustomq.php',
 | 
					      url: 'ajax/ajax_getcustomq.php',
 | 
				
			||||||
      dataType: 'html',
 | 
					      dataType: 'json',
 | 
				
			||||||
      success: function(data, stat, jqo) {
 | 
					      success: function(data, stat, jqo) {
 | 
				
			||||||
         $('#customq_contents').html(data);
 | 
					         $('#customq_contents').html(generateSongListHTML("customq", data.customq));
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
   });
 | 
					   });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -275,10 +276,13 @@ 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: 'html',
 | 
					      dataType: 'json',
 | 
				
			||||||
      data: {searchfor: searchfor},
 | 
					      data: {searchfor: searchfor},
 | 
				
			||||||
      success: function(data, stat, jqo) {
 | 
					      success: function(data, stat, jqo) {
 | 
				
			||||||
         $('#search_contents').html(data);
 | 
					         $('#search_contents').html(generateSongListHTML("search", data.search));
 | 
				
			||||||
 | 
					         $(".search_link").on("click", function(event) {
 | 
				
			||||||
 | 
					            addSongToQueue($(event.currentTarget).data('id'));
 | 
				
			||||||
 | 
					         });
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
   });
 | 
					   });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,2 +1 @@
 | 
				
			||||||
order deny,allow
 | 
					Require all denied
 | 
				
			||||||
deny from all
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user