From 1b83f93670fd190893f5c39845c444b443dbded8 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 19 Oct 2013 21:22:04 +0200 Subject: Ajoute au contenu les images déclarées en tant que 'enclosure' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Corrige https://github.com/marienfressinaud/FreshRSS/issues/205. Uniquement pour les images. Pourrait par exemple faire des miniatures pour les vidéos http://simplepie.org/wiki/tutorial/how_do_i_get_a_thumbnail_from_a_youtube_feed --- app/models/Feed.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'app/models/Feed.php') diff --git a/app/models/Feed.php b/app/models/Feed.php index 02a4e6be7..19c3d8053 100644 --- a/app/models/Feed.php +++ b/app/models/Feed.php @@ -250,6 +250,16 @@ class Feed extends Model { } $content = $item->get_content (); + $links = array(); + foreach ($item->get_enclosures() as $enclosure) { + $link = $enclosure->get_link(); + if (array_key_exists($link, $links)) continue; + $links[$link] = '1'; + $mime = strtolower($enclosure->get_type()); + if (strpos($mime, 'image/') === 0) { + $content .= '
'; + } + } $entry = new Entry ( $this->id (), -- cgit v1.2.3