fid) {
$files[] = $file;
continue 2; // Continue with the $fids iteration (That's what the 2 does...)
}
}
}
}
else {
$files = $all_files;
}
if ($files) {
$played_intro = FALSE;
$counter = 0;
foreach ($files as $index => $file) {
// Play the intro video.
$output_dir = flashvideo_variable_get($file->type, 'outputdir', '') .'/'; // The output directory
$output_dir = ($output_dir == '/') ? '' : $output_dir;
$intro_video = flashvideo_variable_get($file->type, 'intro', '');
$outro_video = flashvideo_variable_get($file->type, 'outro', '');
if (!$played_intro && ($intro_video != '')) {
$intro_path = check_url(file_create_url($output_dir . $intro_video));
$contents .= '';
$played_intro = TRUE;
}
// Give other modules a chance to override...
if (!($filepath = module_invoke_all('flashvideo_get_file', $file, $file->type))) {
$filepath = check_url(file_create_url($output_dir . basename($file->filepath)));
}
else {
$filepath = $filepath['file'];
}
$contents .= "\n";
if (($index == (count($files) - 1)) && $outro_video) {
$outro_path = check_url(file_create_url($output_dir . $outro_video));
$contents .= "\n";
}
}
}
if ($contents != '') {
header("Content-Type: application/xml");
$xml = "\n";
$xml .= "\n\n"; // Start off the XML file contents
$xml .= $contents; // Fill in all the rest.
$xml .= "\n"; // Finish off the XML file contents
echo $xml;
}
}
}