MESSAGE LIBRARY

podaudio iTunes podcast available click here

// DOMElement->getElementsByTagName() — Gets elements by tagname
// nodeValue : The value of this node, depending on its type.
// Load XML File. You can use loadXML if you wish to load XML data from a string

$objDOM = new DOMDocument();
$objDOM->load(“media/podcasts/audio/audio_feed.xml”); //make sure path is correct

$items = $objDOM->getElementsByTagName(“item”);
// for each note tag, parse the document and get values for
// tasks and details tag.

foreach( $items as $value )
{

//Title of podcast
$titles = $value->getElementsByTagName(“title”);
$title = $titles->item(0)->nodeValue;
//Title of podcast
$subtitles = $value->getElementsByTagName(“subtitle”);
$subtitle = $subtitles->item(0)->nodeValue;
//Description of podcast
$descrips = $value->getElementsByTagName(“description”);
$descrip = $descrips->item(0)->nodeValue;
//Author of podcast
$authors = $value->getElementsByTagName(“author”);
$author = $authors->item(0)->nodeValue;
//Full path to podcast file
$guids = $value->getElementsByTagName(“guid”);
$guid = $guids->item(0)->nodeValue;
//Using this because of the force download script. Trimming the first 29 characters of the download location
$dlstring = substr($guid, 29);
//Link to PDF
$links = $value->getElementsByTagName(“link”);
$link = $links->item(0)->nodeValue;
$linkstring = substr($link, 29);
//Time length of podcast
$durations = $value->getElementsByTagName(“duration”);
$duration = $durations->item(0)->nodeValue;
//Trimming hours & seconds from podcast time
$time = substr($duration, 3, 2);
//Date podcast was published
$dates = $value->getElementsByTagName(“pubDate”);
$date = $dates->item(0)->nodeValue;
//Trimmin last 15 characters of the date stamp
$pubdate = substr($date, 0, 16);
//Podcast keywords
$keywords = $value->getElementsByTagName(“keywords”);
$keyword = $keywords->item(0)->nodeValue;

echo ”

“;
}

?>

$title
$author
$pubdate / ($time Minutes)

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

Download MP3 Here
“;
if (empty($linkstring)){ echo “No Sermon Notes Available”;}
else
{ echo “Download Sermon Notes Here“; }
echo “