From 253799eb1edbbec1ae65a90da9c0e52e3dcf70a3 Mon Sep 17 00:00:00 2001 From: bagtaib Date: Wed, 29 Jun 2022 05:07:32 +0200 Subject: [PATCH 1/2] NEW #21399 --- htdocs/core/lib/xcal.lib.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/xcal.lib.php b/htdocs/core/lib/xcal.lib.php index 97ada3e3d4f..cd300546e46 100644 --- a/htdocs/core/lib/xcal.lib.php +++ b/htdocs/core/lib/xcal.lib.php @@ -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,6 +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'] = $event->image; $event = $tmpevent; } @@ -387,7 +388,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 +407,10 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt fwrite($fichier, "\n"); fwrite($fichier, "

'); + } + if ($description) { fwrite($fichier, $description); } From b5c0f1ac29cdd66bb20ab92ff96e5e9192d70a6e Mon Sep 17 00:00:00 2001 From: bagtaib Date: Mon, 4 Jul 2022 14:32:40 +0200 Subject: [PATCH 2/2] corrected the url of the image --- htdocs/core/lib/xcal.lib.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/lib/xcal.lib.php b/htdocs/core/lib/xcal.lib.php index cd300546e46..6b5c92881c5 100644 --- a/htdocs/core/lib/xcal.lib.php +++ b/htdocs/core/lib/xcal.lib.php @@ -377,8 +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'] = $event->image; - + $tmpevent['image'] = $GLOBALS['website']->virtualhost.'/medias/'.$event->image; $event = $tmpevent; }