get_row('SELECT * FROM songs WHERE song_id="'.$id.'"'); if (!$song) Mini_Page('Song not found', 'No song matches that #id'); if ($song->show_id) $show=$crdb->get_row('SELECT * FROM shows WHERE show_id="'.$song->show_id.'"'); /* $recordings = $crdb->get_results("SELECT recording_id, recording_title, show_id, YEAR(year) AS year, source, IF(show_id='$song->show_id','1','0') AS show_first, cover_cheat, recordings.soundclips FROM ((SELECT recording_id FROM songs_on_recording WHERE song_id='$id') UNION DISTINCT (SELECT recording_id FROM songs_to_release WHERE song_id='$id')) AS recs LEFT JOIN recordings USING (recording_id) LEFT JOIN releases_to_recording USING (recording_id) LEFT JOIN releases USING (release_id) WHERE recording_title IS NOT NULL GROUP BY recording_id "); */ $links = $crdb->get_results("SELECT * FROM links WHERE (related_id='$id' AND related_type='song')"); //$threads = $crdb->get_results("SELECT thread_id, subject, num_replies, user_name, last_user_id, DATE_FORMAT(last_date,'%a, %c/%e/%y, %l:%i %p') as last_date // FROM comment_threads LEFT JOIN comment_taxonomy USING (thread_id) // LEFT JOIN users ON (user_id=last_user_id) // WHERE related_type='Songs' AND related_id='$id' ORDER BY comment_id"); $threads = $crdb->get_results('SELECT * FROM forum_taxonomy LEFT JOIN forum_threads USING (thread_id) LEFT JOIN forums ON (forum_threads.forum_id=forums.forum_id) WHERE related_type="song" AND related_id="'.$id.'" ORDER BY main DESC, thread_last_reply_date DESC'); $blog_posts = R_Blog_Posts($id, 'Song'); $history = $crdb->get_results('SELECT * FROM history LEFT JOIN users ON (user_id_credit=user_id) WHERE id_type="song" AND id="'.$id.'" ORDER BY submitted DESC'); $cr_page->breadcrumbs[] = R_Link('Database', '/database/'); $cr_page->breadcrumbs[] = R_Link('Songs', '/songs/'); if ($song->show_id) $cr_page->breadcrumbs[] = R_Link_to_Show($song->show_id); $cr_page->breadcrumbs[] = FlipTitle($song->song_title); $cr_page->shortlink = 'sn'.$id; $cr_page->title = FlipTitle($song->song_title); if ($include=='history') $cr_page->title = 'Editing History: '.$cr_page->title.''; $cr_page->tabs[] = array(URL_to_Song($song).'#recordings', 'Recordings ('.$song->song_num_recordings.')', ((!$include)?1:0)); //$cr_page->tabs[] = array(URL_to_Song($song).'#forum', 'Discussion ('.count($threads).')'); //$cr_page->tabs[] = array('URL_to_Song($song).#links', 'Links ('.count($links).')'); //if ($logged_in_id) $cr_page->tabs[] = array('/contribute/song.php?id='.$id, 'Edit Song'); $cr_page->tabs[] = array('/contribute/song.php?id='.$id, 'Edit Song'); if ($history) $cr_page->tabs[] = array(URL_to_Song($song).'/history/', 'History ('.count($history).')', (($include=='history')?1:0)); if ($include=='history') require_once($_SERVER['DOCUMENT_ROOT'].'/songs/single_history.php'); else require_once($_SERVER['DOCUMENT_ROOT'].'/songs/single_recordings.php'); $cr_page->End(); ?>