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:
RXP 2025-05-20 18:21:16 -06:00
parent a21cc74241
commit 0213c7b180
Signed by: ro
GPG key ID: 976711B5057688B7

View file

@ -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>";
}