added feature medio to rss
just thought it would be a nice touch to pull in the featured media into the descption for some extra pretty in the feed
This commit is contained in:
parent
a21cc74241
commit
0213c7b180
1 changed files with 18 additions and 1 deletions
|
@ -43,13 +43,30 @@ class RSSController extends Controller
|
|||
if ($global['dynamicRender'] != "true") {
|
||||
$link = $link . ".html";
|
||||
}
|
||||
//grabs feature image or vid and tosses it in the description
|
||||
$media = explode(",", $item['feature']);
|
||||
$file = '';
|
||||
if ($media[0] == null || $media[0] == '') {
|
||||
$file = $global['background'];
|
||||
} else {
|
||||
$file = $media[0];
|
||||
}
|
||||
$ext = pathinfo($file, PATHINFO_EXTENSION);
|
||||
$url = $global['base_url'] . $file;
|
||||
|
||||
if ($ext != 'mp4') {
|
||||
$top = "<img src='{$url}'/>";
|
||||
} else {
|
||||
$top = " <video><source src='{$url}' /></video>";
|
||||
}
|
||||
|
||||
$feedContent .= "
|
||||
<item>
|
||||
<title>{$title}</title>
|
||||
<link>{$link}</link>
|
||||
<guid>{$global['base_url']}/rss/feed/item/{$item['uuid']}</guid>
|
||||
<pubDate>{$date}</pubDate>
|
||||
<description><![CDATA[{$html}]]></description>
|
||||
<description><![CDATA[{$top}]]<br/>><![CDATA[{$html}]]></description>
|
||||
</item>";
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue