diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-04-23 18:59:35 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-04-23 18:59:35 +0000 |
commit | 0557ea37ad1396c605198d4ed072b77971ec9ad7 (patch) | |
tree | 8381db050b60bfe98b535431a5411720c5c855ac | |
parent | 45250f50194cac99fde9569d8e8fd54ad89db179 (diff) | |
download | ampache-0557ea37ad1396c605198d4ed072b77971ec9ad7.tar.gz ampache-0557ea37ad1396c605198d4ed072b77971ec9ad7.tar.bz2 ampache-0557ea37ad1396c605198d4ed072b77971ec9ad7.zip |
fixed now playing
-rw-r--r-- | lib/stream.lib.php | 14 | ||||
-rw-r--r-- | lib/ui.lib.php | 2 | ||||
-rw-r--r-- | templates/show_now_playing.inc.php (renamed from templates/show_now_playing.inc) | 4 | ||||
-rw-r--r-- | templates/show_now_playing_row.inc.php | 4 |
4 files changed, 12 insertions, 12 deletions
diff --git a/lib/stream.lib.php b/lib/stream.lib.php index 39901d31..ec404077 100644 --- a/lib/stream.lib.php +++ b/lib/stream.lib.php @@ -39,8 +39,8 @@ function delete_now_playing($insert_id) { } // Remove the song from the now_playing table - $sql = "DELETE FROM now_playing WHERE id = '$insert_id'"; - $db_result = mysql_query($sql, dbh()); + $sql = "DELETE FROM `now_playing` WHERE `id` = '$insert_id'"; + $db_result = Dba::query($sql); } // delete_now_playing @@ -92,7 +92,7 @@ function insert_now_playing($song_id,$uid,$song_length) { // If they are using Windows media player if (strstr($user_agent,"NSPlayer") || $_REQUEST['flash_hack'] == 1) { // WMP does keep the session open so we need to cheat a little here - $session_id = sql_escape($_REQUEST['sid']); + $session_id = Dba::escape($_REQUEST['sid']); } /* Set expire time for worst case clean up */ @@ -118,11 +118,11 @@ function insert_now_playing($song_id,$uid,$song_length) { */ function check_lock_songs($song_id) { - $sql = "SELECT song_id FROM now_playing " . - "WHERE song_id = '$song_id'"; - $db_results = mysql_query($sql, dbh()); + $sql = "SELECT `song_id` FROM `now_playing` " . + "WHERE `song_id` = '$song_id'"; + $db_results = Dba::query($sql); - if (mysql_num_rows($db_results)) { + if (Dba::num_rows($db_results)) { debug_event('lock_songs','Song Already Playing, skipping...','5'); return false; } diff --git a/lib/ui.lib.php b/lib/ui.lib.php index a4668bc4..9c7fd148 100644 --- a/lib/ui.lib.php +++ b/lib/ui.lib.php @@ -257,7 +257,7 @@ function show_now_playing() { $web_path = Config::get('web_path'); $results = get_now_playing(); - require Config::get('prefix') . '/templates/show_now_playing.inc'; + require Config::get('prefix') . '/templates/show_now_playing.inc.php'; } // show_now_playing diff --git a/templates/show_now_playing.inc b/templates/show_now_playing.inc.php index f56a8fee..0bdba057 100644 --- a/templates/show_now_playing.inc +++ b/templates/show_now_playing.inc.php @@ -1,7 +1,7 @@ <?php /* -Copyright (c) 2001 - 2006 Ampache.org +Copyright (c) 2001 - 2007 Ampache.org All rights reserved. This program is free software; you can redistribute it and/or @@ -41,7 +41,7 @@ foreach ($results as $item) { if (!$np_user->fullname) { $np_user->fullname = "Ampache User"; } echo '<tr class="np_row">'; - require(conf('prefix') . '/templates/show_now_playing_row.inc.php'); + require Config::get('prefix') . '/templates/show_now_playing_row.inc.php'; echo '</tr>'; } // end foreach diff --git a/templates/show_now_playing_row.inc.php b/templates/show_now_playing_row.inc.php index 9f38e456..46594411 100644 --- a/templates/show_now_playing_row.inc.php +++ b/templates/show_now_playing_row.inc.php @@ -1,7 +1,7 @@ <?php /* -Copyright (c) 2001 - 2006 Ampache.org +Copyright (c) 2001 - 2007 Ampache.org All rights reserved. This program is free software; you can redistribute it and/or @@ -38,7 +38,7 @@ $artist = scrub_out(truncate_with_ellipse($song->f_artist_full,'25')); <?php echo $artist; ?> </a> </td> - <?php if (conf('show_album_art')) { ?> + <?php if (Config::get('show_album_art')) { ?> <td class="np_cell"> <a target="_blank" href="<?php echo $web_path; ?>/image.php?id=<?php echo $song->album; ?>&type=popup&sid=<?php echo session_id(); ?>" onclick="popup_art('<?php echo $web_path; ?>/image.php?id=<?php echo $song->album; ?>&type=popup&sid=<?php echo session_id(); ?>'); return false;"> <img align="middle" border="0" src="<?php echo $web_path; ?>/image.php?id=<?php echo $song->album; ?>&thumb=1&sid=<?php echo session_id(); ?>" alt="Album Art" height="75" width="75" /></a> |