format(); $np_user = new User($r['user']); $results[] = array('song'=>$song,'user'=>$np_user,'agent'=>$r['agent']); } // end while return $results; } // get_now_playing /** * check_lock_songs * This checks to see if the song is already playing, if it is then it prevents the user * from streaming it */ function check_lock_songs($song_id) { $sql = "SELECT `song_id` FROM `now_playing` " . "WHERE `song_id` = '$song_id'"; $db_results = Dba::query($sql); if (Dba::num_rows($db_results)) { debug_event('lock_songs','Song Already Playing, skipping...','5'); return false; } return true; } // check_lock_songs ?>