summaryrefslogtreecommitdiffstats
path: root/lib/class
diff options
context:
space:
mode:
Diffstat (limited to 'lib/class')
-rw-r--r--lib/class/browse.class.php19
-rw-r--r--lib/class/playlist.class.php6
2 files changed, 22 insertions, 3 deletions
diff --git a/lib/class/browse.class.php b/lib/class/browse.class.php
index a652dd71..7be9db02 100644
--- a/lib/class/browse.class.php
+++ b/lib/class/browse.class.php
@@ -88,6 +88,7 @@ class Browse {
switch($type) {
case 'user':
+ case 'playlist':
case 'song':
case 'album':
case 'artist':
@@ -200,6 +201,9 @@ class Browse {
case 'live_stream':
$sql = "SELECT `live_stream`.`id` FROM `live_stream` ";
break;
+ case 'playlist':
+ $sql = "SELECT `playlist`.`id` FROM `playlist` ";
+ break;
case 'song':
default:
$sql = "SELECT `song`.`id` FROM `song` ";
@@ -296,6 +300,16 @@ class Browse {
break;
} // end filter
} // end live_stream
+ elseif ($_SESSION['browse']['type'] == 'playlist') {
+ switch ($filter) {
+ case 'alpha_match':
+ $filter_sql = " `playlist`.`name` LIKE '" . Dba::escape($value) . "%' AND ";
+ break;
+ default;
+ // Rien a faire
+ break;
+ } // end filter
+ } // end playlist
return $filter_sql;
@@ -409,6 +423,11 @@ class Browse {
require_once Config::get('prefix') . '/templates/show_live_streams.inc.php';
show_box_bottom();
break;
+ case 'playlist':
+ show_box_top(_('Playlists'));
+ require_once Config::get('prefix') . '/templates/show_playlists.inc.php';
+ show_box_bottom();
+ break;
default:
// Rien a faire
break;
diff --git a/lib/class/playlist.class.php b/lib/class/playlist.class.php
index f5f570ec..863a28a5 100644
--- a/lib/class/playlist.class.php
+++ b/lib/class/playlist.class.php
@@ -223,10 +223,10 @@ class Playlist {
*/
function get_song_count() {
- $sql = "SELECT COUNT(id) FROM playlist_data WHERE playlist='" . sql_escape($this->id) . "'";
- $db_results = mysql_query($sql, dbh());
+ $sql = "SELECT COUNT(`id`) FROM `playlist_data` WHERE `playlist`='" . Dba::escape($this->id) . "'";
+ $db_results = Dba::query($sql);
- $results = mysql_fetch_row($db_results);
+ $results = Dba::fetch_row($db_results);
return $results['0'];