From 0557ea37ad1396c605198d4ed072b77971ec9ad7 Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Mon, 23 Apr 2007 18:59:35 +0000 Subject: fixed now playing --- lib/stream.lib.php | 14 +++++++------- lib/ui.lib.php | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'lib') 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 -- cgit