NEW #21399
This commit is contained in:
Laurent Destailleur 2022-07-06 15:50:16 +02:00 committed by GitHub
commit 96ad521d5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -301,7 +301,7 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile)
* @param string $format "rss"
* @param string $title Title of export
* @param string $desc Description of export
* @param array $events_array Array of events ("uid","startdate","summary","url","desc","author","category") or Array of WebsitePage
* @param array $events_array Array of events ("uid","startdate","summary","url","desc","author","category","image") or Array of WebsitePage
* @param string $outputfile Output file
* @param string $filter (optional) Filter
* @param string $url Url (If empty, forge URL for agenda RSS export)
@ -377,7 +377,7 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt
$tmpevent['author'] = $event->author_alias ? $event->author_alias : 'unknown';
//$tmpevent['category'] = '';
$tmpevent['desc'] = $event->description;
$tmpevent['image'] = $GLOBALS['website']->virtualhost.'/medias/'.$event->image;
$event = $tmpevent;
}
@ -387,7 +387,9 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt
$url = $event["url"];
$author = $event["author"];
$category = $event["category"];
if (!empty($event["image"])) {
$image = $event["image"];
}
/* No place inside a RSS
$priority = $event["priority"];
$fulldayevent = $event["fulldayevent"];
@ -404,6 +406,10 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt
fwrite($fichier, "<category><![CDATA[".$category."]]></category>\n");
fwrite($fichier, "<description><![CDATA[");
if (!empty($image)) {
fwrite($fichier, '<p><img class="center" src="'.$image.'"/></p>');
}
if ($description) {
fwrite($fichier, $description);
}