I am hosting my podcasts on Amazon S3, and prior to version 2.0 I modified the download link url to point to a download.php file I created and passed the podcast url as a parameter. The download.php file modified the host headers so that IE downloaded the file instead of trying to play it in the browser. The code was as follows:
<?php
$url=$_GET['url'];
header('Content-disposition: attachment; filename='.$url);
header('Content-type: application/octet-stream');
readfile($url);
?>
The code that previously populated the url of the DOWNLOAD_LINK looked like this:
if( $GeneralSettings['podcast_link'] == 1 )
{
if( $player_links )
$player_links .= ' '. POWERPRESS_LINK_SEPARATOR .' ';
$player_links .= "<a href=\"download.php?url={$EpisodeData['url']}\" class=\"powerpress_link_d\" title=\"". POWERPRESS_DOWNLOAD_TEXT ."\">". POWERPRESS_DOWNLOAD_TEXT ."</a>".PHP_EOL;
}
else if( $GeneralSettings['podcast_link'] == 2 )
{
if( $player_links )
$player_links .= ' '. POWERPRESS_LINK_SEPARATOR .' ';
$player_links .= "<a href=\"download.php?url={$EpisodeData['url']}\" class=\"powerpress_link_d\" title=\"". POWERPRESS_DOWNLOAD_TEXT ."\">". POWERPRESS_DOWNLOAD_TEXT ."</a> (".powerpress_byte_size($EpisodeData['size']).") ".PHP_EOL;
}
else if( $GeneralSettings['podcast_link'] == 3 )
{
if( $player_links )
$player_links .= ' '. POWERPRESS_LINK_SEPARATOR .' ';
if( $EpisodeData['duration'] && ltrim($EpisodeData['duration'], '0:') != '' )
$player_links .= "<a href=\"download.php?url={$EpisodeData['url']}\" class=\"powerpress_link_d\" title=\"". POWERPRESS_DOWNLOAD_TEXT ."\">". POWERPRESS_DOWNLOAD_TEXT ."</a> (". htmlspecialchars(POWERPRESS_DURATION_TEXT) .": " . powerpress_readable_duration($EpisodeData['duration']) ." — ".powerpress_byte_size($EpisodeData['size']).")".PHP_EOL;
else
$player_links .= "<a href=\"download.php?url={$EpisodeData['url']}\" class=\"powerpress_link_d\" title=\"". POWERPRESS_DOWNLOAD_TEXT ."\">". POWERPRESS_DOWNLOAD_TEXT ."</a> (".powerpress_byte_size($EpisodeData['size']).")".PHP_EOL;
}
I have been unable to determine how to perform the same tasks in version 2.0 because the content generation for the download link doesn't look the same. Does anyone know how to to perform these tasks in version 2.0?