diff options
| author | 2013-03-17 17:22:19 +0100 | |
|---|---|---|
| committer | 2013-03-17 17:22:19 +0100 | |
| commit | dbb0de4e368b814f8cab9e7e1a1462a2839471dc (patch) | |
| tree | 9e51f1773bb47a6934b9eed22089c8771e0365ba /app/models/Feed.php | |
| parent | d4c0fc28ec8b6fcc2afa0e9a187dfb910aed9d17 (diff) | |
Les catégories d'un article sont désormais ajoutées à ses tags
Diffstat (limited to 'app/models/Feed.php')
| -rw-r--r-- | app/models/Feed.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/models/Feed.php b/app/models/Feed.php index 2f471f0a4..8e3168e3b 100644 --- a/app/models/Feed.php +++ b/app/models/Feed.php @@ -117,6 +117,10 @@ class Feed extends Model { $feed->set_cache_location (CACHE_PATH); $feed->init (); + $subscribe_url = $feed->subscribe_url (); + if (!is_null ($subscribe_url) && $subscribe_url != $this->url) { + $this->_url ($subscribe_url); + } $title = $feed->get_title (); $this->_name (!is_null ($title) ? $title : $this->url); $this->_website ($feed->get_link ()); @@ -134,6 +138,15 @@ class Feed extends Model { $link = $item->get_permalink (); $date = strtotime ($item->get_date ()); + // gestion des tags (catégorie == tag) + $tags_tmp = $item->get_categories (); + $tags = array (); + if (!is_null ($tags_tmp)) { + foreach ($tags_tmp as $tag) { + $tags[] = $tag->get_label (); + } + } + // Gestion du contenu // On cherche à récupérer les articles en entier... même si le flux ne le propose pas $path = $this->pathEntries (); @@ -156,6 +169,7 @@ class Feed extends Model { !is_null ($link) ? $link : '', $date ? $date : time () ); + $entry->_tags ($tags); $entries[$entry->id ()] = $entry; } |
