t('Audio: Playlist'), 'theme' => 'views_bonus_audio_playlist', 'summary_theme' => 'views_summary', ); } return $items; } function theme_views_bonus_audio_playlist($view, $nodes, $type) { if (isset($_GET['playlist'])) { return views_bonus_audio_playlist($view, $nodes, $type); } else { return views_bonus_audio_view($view, $nodes, $type); } } function views_bonus_audio_view($view, $nodes, $type) { global $base_url; $flash_mp3_player = $base_url .'/'. drupal_get_path('module', 'audio') .'/flash_mp3_player/'; $options = array_merge((array) $options, array( 'file' => url($view->real_url, 'playlist', NULL, true), )); $url = url($flash_mp3_player . 'mp3player.swf'); if ($options) { $flashvars = drupal_query_string_encode($options); } $output = << EOF; return $output; } function views_bonus_audio_playlist($view, $nodes, $type) { $output = "\n"; $output .= "\n"; $output .= " " . views_get_title($view, $type) . "\n"; $output .= " \n"; foreach ($nodes as $n) { $node = node_load($n->nid); $output .= theme('views_bonus_audio_track_xml', $node); } $output .= " \n"; $output .= "\n"; drupal_set_header('Content-Type: text/xml; charset=utf-8'); print $output; exit; } function theme_views_bonus_audio_track_xml($node) { $output .= " \n"; $output .= " " . check_plain($node->title) . "\n"; $output .= " " . check_plain($node->audio_tags['title']) . "\n"; $output .= " " . check_plain($node->audio_tags['track']) . "\n"; $output .= " " . check_url($node->url_play) . "?" . $node->audio_fileinfo['fileformat'] . "\n"; $output .= " " . url("node/$node->nid", NULL, NULL, TRUE) . "\n"; $output .= " " . $node->nid . "\n"; $output .= " \n"; return $output; }