aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche/Poche.class.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-12-06 14:37:42 +0100
committerNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-12-06 14:37:42 +0100
commitf778e47283c9691d2992045e0fbcdfc6685f157f (patch)
tree00671a8b3bae635e795cbd971267da37afcbf13b /inc/poche/Poche.class.php
parent4886ed6d3637df0b3e16e672d58d4ef8f17dc432 (diff)
downloadwallabag-f778e47283c9691d2992045e0fbcdfc6685f157f.tar.gz
wallabag-f778e47283c9691d2992045e0fbcdfc6685f157f.tar.zst
wallabag-f778e47283c9691d2992045e0fbcdfc6685f157f.zip
[add] rss for tag
Diffstat (limited to 'inc/poche/Poche.class.php')
-rw-r--r--inc/poche/Poche.class.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php
index fefbb02d..68f56d62 100644
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -446,8 +446,11 @@ class Poche
446 ); 446 );
447 break; 447 break;
448 case 'tags': 448 case 'tags':
449 $token = $this->user->getConfigValue('token');
449 $tags = $this->store->retrieveAllTags(); 450 $tags = $this->store->retrieveAllTags();
450 $tpl_vars = array( 451 $tpl_vars = array(
452 'token' => $token,
453 'user_id' => $this->user->getId(),
451 'tags' => $tags, 454 'tags' => $tags,
452 ); 455 );
453 break; 456 break;
@@ -884,9 +887,9 @@ class Poche
884 $_SESSION['poche_user']->setConfig($currentConfig); 887 $_SESSION['poche_user']->setConfig($currentConfig);
885 } 888 }
886 889
887 public function generateFeeds($token, $user_id, $type = 'home') 890 public function generateFeeds($token, $user_id, $tag_id, $type = 'home')
888 { 891 {
889 $allowed_types = array('home', 'fav', 'archive'); 892 $allowed_types = array('home', 'fav', 'archive', 'tag');
890 $config = $this->store->getConfigUser($user_id); 893 $config = $this->store->getConfigUser($user_id);
891 894
892 if (!in_array($type, $allowed_types) || 895 if (!in_array($type, $allowed_types) ||
@@ -901,7 +904,13 @@ class Poche
901 $feed->setChannelElement('updated', date(DATE_RSS , time())); 904 $feed->setChannelElement('updated', date(DATE_RSS , time()));
902 $feed->setChannelElement('author', 'poche'); 905 $feed->setChannelElement('author', 'poche');
903 906
904 $entries = $this->store->getEntriesByView($type, $user_id); 907 if ($type == 'tag') {
908 $entries = $this->store->retrieveEntriesByTag($tag_id);
909 }
910 else {
911 $entries = $this->store->getEntriesByView($type, $user_id);
912 }
913
905 if (count($entries) > 0) { 914 if (count($entries) > 0) {
906 foreach ($entries as $entry) { 915 foreach ($entries as $entry) {
907 $newItem = $feed->createNewItem(); 916 $newItem = $feed->createNewItem();