]> 91.132.146.200 Git - insipid.git/commitdiff
rss feed uses the rss limit option
authorBanana <banana@starscream.de>
Thu, 16 Feb 2012 12:49:40 +0000 (13:49 +0100)
committerBanana <banana@starscream.de>
Thu, 16 Feb 2012 12:49:40 +0000 (13:49 +0100)
lib/Insipid/RSS.pm

index db5a1ec2fe581a079adfb53e372490e8834ca907..3aeb98a99b8ef7e9869379888bc4ad6affd1c68a 100755 (executable)
@@ -42,27 +42,28 @@ sub send_rss {
        my $ew = "";\r
        my $joins = "";\r
        my $title = get_option("feed_name");\r
-       \r
+       my $limit = get_option("feed_num");\r
+\r
        if(url_param('tag')) {\r
-                if(url_param('tag') =~ / /) {\r
-                        my @tags = split(/ /, url_param('tag'));\r
-                        my $rcount = 1;\r
-\r
-                        foreach(@tags) {\r
-                                push(@parms, $_);\r
-                                $joins = "$joins inner join $tbl_bookmark_tags \r
-                                       as bt$rcount on\r
-                                          ($tbl_bookmarks.id = bt$rcount.bookmark_id)\r
-                                        inner join $tbl_tags as t$rcount on\r
-                                           (t$rcount.id = bt$rcount.tag_id and t$rcount.name = ?) ";\r
-                                $rcount++;\r
-                        }\r
+               if(url_param('tag') =~ / /) {\r
+                       my @tags = split(/ /, url_param('tag'));\r
+                       my $rcount = 1;\r
+\r
+                       foreach(@tags) {\r
+                               push(@parms, $_);\r
+                               $joins = "$joins inner join $tbl_bookmark_tags\r
+                                               as bt$rcount on\r
+                                               ($tbl_bookmarks.id = bt$rcount.bookmark_id)\r
+                                               inner join $tbl_tags as t$rcount on\r
+                                               (t$rcount.id = bt$rcount.tag_id and t$rcount.name = ?) ";\r
+                               $rcount++;\r
+                       }\r
                } else {\r
 \r
                        push(@parms, url_param('tag'));\r
                        $joins = "\r
-                               inner join $tbl_bookmark_tags on \r
-                                       ($tbl_bookmarks.id = \r
+                               inner join $tbl_bookmark_tags on\r
+                                       ($tbl_bookmarks.id =\r
                                                $tbl_bookmark_tags.bookmark_id)\r
                                inner join $tbl_tags on\r
                                        ($tbl_bookmark_tags.tag_id = $tbl_tags.id)";\r
@@ -78,7 +79,7 @@ sub send_rss {
        my $sql = "\r
                select $tbl_bookmarks.id, $tbl_bookmarks.title, $tbl_bookmarks.url\r
                        from $tbl_bookmarks $joins $access_where $ew\r
-               order by $tbl_bookmarks.date desc limit 30";\r
+               order by $tbl_bookmarks.date desc limit $limit";\r
 \r
        my $sth = $dbh->prepare($sql);\r
        $sth->execute(@parms);\r
@@ -91,14 +92,13 @@ sub send_rss {
     xmlns:admin="http://webns.net/mvcb/"\r
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\r
     xmlns:content="http://purl.org/rss/1.0/modules/content/">\r
-    \r
+\r
 <channel>\r
   <title>$title</title>\r
   <link>$full_url</link>\r
-  <description>Aggregated links</description>\r
+  <description>Personal collection</description>\r
   <dc:language>en-us</dc:language>\r
   <dc:creator>Insipid</dc:creator>\r
-  <dc:rights>Copyright 2006</dc:rights>\r
 RDFHEADER\r
 \r
        while(my @hr = $sth->fetchrow_array) {\r