channel->item as $entry) { $namespaces = $entry->getNameSpaces(true); $media = $entry->children($namespaces['media']); $blip = $entry->children($namespaces['blip']); $description = $blip->puredescription; $duration = date("i:s",intval($blip->runtime)); $length = strlen($description); if($length > 20){ $description = substr($description, 0, 20)."..."; } if ($entry->title) { if($odd = $i%2){$class='odd';}else{$class='even';} echo "
"; echo '
'.$entry->title.'
'; echo '
'; echo '
'.$description.'
'; echo $duration.' mins
'; echo '
'; echo "
"; } $i++; //end foreach } } if(isset($doc->channel->item)) { parseRSS($doc); } else { //no videos; exit; } } catch (Exception $e) { echo 'Bad XML file.'; exit; } ?>