Fix for switching to simplepie
This commit is contained in:
parent
4de42ada6e
commit
e610ce8af7
|
@ -62,7 +62,7 @@ class Podcast extends BasePodcast
|
||||||
$podcastArray["link"] = $rss->get_link();
|
$podcastArray["link"] = $rss->get_link();
|
||||||
$podcastArray["language"] = $rss->get_language();
|
$podcastArray["language"] = $rss->get_language();
|
||||||
$podcastArray["copyright"] = $rss->get_copyright();
|
$podcastArray["copyright"] = $rss->get_copyright();
|
||||||
$podcastArray["author"] = $rss->get_author();
|
$podcastArray["creator"] = $rss->get_author();
|
||||||
$podcastArray["category"] = $rss->get_categories();
|
$podcastArray["category"] = $rss->get_categories();
|
||||||
|
|
||||||
/*$podcastArray["title"] = (string)$rss->title;
|
/*$podcastArray["title"] = (string)$rss->title;
|
||||||
|
@ -89,12 +89,14 @@ class Podcast extends BasePodcast
|
||||||
$podcastArray = $podcast->toArray(BasePeer::TYPE_FIELDNAME);
|
$podcastArray = $podcast->toArray(BasePeer::TYPE_FIELDNAME);
|
||||||
|
|
||||||
$podcastArray["episodes"] = array();
|
$podcastArray["episodes"] = array();
|
||||||
foreach ($rss->item as $item) {
|
foreach ($rss->get_items() as $item) {
|
||||||
// Same as above, we need to explicitly cast the SimpleXMLElement 'array' into an actual array
|
array_push($podcastArray["episodes"], array(
|
||||||
foreach($item as $k => $v) {
|
"title" => $item->get_title(),
|
||||||
$item[$k] = (string)$v;
|
"author" => $item->get_author()->get_name(),
|
||||||
}
|
"description" => $item->get_description(),
|
||||||
array_push($podcastArray["episodes"], $item);
|
"pub_date" => $item->get_date("Y-m-d H:i:s"),
|
||||||
|
"link" => $item->get_enclosure()->get_link()
|
||||||
|
));
|
||||||
}
|
}
|
||||||
return $podcastArray;
|
return $podcastArray;
|
||||||
} catch(Exception $e) {
|
} catch(Exception $e) {
|
||||||
|
@ -129,12 +131,14 @@ class Podcast extends BasePodcast
|
||||||
$podcastArray = $podcast->toArray(BasePeer::TYPE_FIELDNAME);
|
$podcastArray = $podcast->toArray(BasePeer::TYPE_FIELDNAME);
|
||||||
|
|
||||||
$podcastArray["episodes"] = array();
|
$podcastArray["episodes"] = array();
|
||||||
foreach ($rss->item as $item) {
|
foreach ($rss->get_items() as $item) {
|
||||||
// Same as above, we need to explicitly cast the SimpleXMLElement 'array' into an actual array
|
array_push($podcastArray["episodes"], array(
|
||||||
foreach($item as $k => $v) {
|
"title" => $item->get_title(),
|
||||||
$item[$k] = (string)$v;
|
"author" => $item->get_author()->get_name(),
|
||||||
}
|
"description" => $item->get_description(),
|
||||||
array_push($podcastArray["episodes"], $item);
|
"pub_date" => $item->get_date("Y-m-d H:i:s"),
|
||||||
|
"link" => $item->get_enclosure()->get_link()
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $podcastArray;
|
return $podcastArray;
|
||||||
|
|
Loading…
Reference in New Issue