--- H:/packs/drupal/modules 5/xspf_playlist/xspf_playlist.module Wed Mar 05 18:27:50 2008 +++ D:/xampp/htdocs/drupal-p3-sam/sites/all/modules/xspf_playlist/xspf_playlist.module Thu Nov 06 15:22:52 2008 @@ -227,6 +227,9 @@ if (module_exists('content')) { $types['xspf_playlist--2'] = t('Use a CCK field\'s data'); } + if (module_exists('audio')) { // not ideal, as this shows on all types + $types['xspf_playlist--3'] = t('Use the file from an audio node'); + } return $types; break; @@ -250,6 +253,8 @@ case 2: $items = xspf_playlist_get_files_from_cck($node); break; + case 3: + $items = xspf_playlist_get_file_from_audio_node($node); } if ($items) { return $items; @@ -418,6 +423,19 @@ } } +#joachim +/** + * retrieves the file from an audio node and places it in item + * format for playlist + * @param $node is a drupal node object + * @return array of items + */ +function xspf_playlist_get_file_from_audio_node($node) { + if ($item = xspf_playlist_create_file_item($node, xspf_playlist_url($node->audio_file->filepath))) { + $items[] = $item; + return $items; + } +} /** * get the thumbnail for this content type, return first