I’ve been on this for 8 hours and realize it’s probably something simple but… LOL
[php]
$cdate = date(‘D, d M Y’, time());
$url= $params->get(‘feed’);
// $url=(‘http://www.dallascowboys.com/feeds/podcasts/2531/audio’);
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url); // get the url contents
$data = curl_exec($ch); // execute curl request
curl_close($ch);
$xml = simplexml_load_string($data);
foreach ($xml->channel->item as $item) {
$namespaces = $item->getNamespaces(true);
$thumbnail = $item->children($namespaces[‘media’])->thumbnail;
$attr = $thumbnail->attributes();
$title= ($item->title);
$link= ($item->link);
$description= ($item->description);
$image = ($item->image);
$total= ($dc->content);
$time = $params->get(‘time’);
$isizeh = $params->get(‘isizeh’);
$isizew = $params->get(‘isizew’);
$adate = ($item->pubDate);
$newdate = date(“l, n-j-Y”, strtotime($adate));
if (strtotime($adate) >= strtotime("$time")) {
?>
<div class="box">
<table class="tg">
<tr>
<th class="tg-031e"><?= $img ?></th>
<th class="tg-031e"><?= $newdate ?>
<h3><?= $title ?></h3>
<?= $description ?>
<a href="<?= $link ?>" class="hvr-shutter-in-vertical" target= "_blank">Listen Here</a>!
</th>
</tr>
</table>
</div>
'; echo "URL = {$attr['url']}, width = {$attr['width']}, height = {$attr['height']}\n"; echo print_r($attr, true); echo ''; } } [/php] Here is the entire script and below is the xml I'm trying to get the info from: [code] <?xml version="1.0" encoding="utf-8" ?> Video
Recent videos
http://www.dallascowboys.com/ en Tue, 24 Feb 2015 15:10:07 -0600 Tue, 24 Feb 2015 15:16:25 -0600 Talkin' Cowboys: Contract Talk & Priorities In The Draft http://www.dallascowboys.com/video/2015/02/24/talkin-cowboys-contract-talk-priorities-draft Join Kelsey, Bryan, and David for their thoughts on the Combine and the continuing thoughts on free agency. 30ce5361-6a98-4e6b-b376-a15ee7d33719 Tue, 24 Feb 2015 15:10:07 -0600 Video Tue, 24 Feb 2015 15:10:07 -0600 416x234 640x360 640x360 [/code]I can’t seem to catch the media:thumbnail object… this is what [from what I have above] it’s returning:
URL = , width = , height = SimpleXMLElement Object ( )
Which is pretty much blank… I’m trying to get the image from the xml but haven’t been able to quite capture it… is there something in the code that I’m doing wrong… well obviously yes but what am I doing wrong is a better question.
Thanks in advance!
John