]> git.wh0rd.org - tt-rss.git/commitdiff
added DEFAULT_ARTICLE_LIMIT functionality, patch from adjuster
authorAndrew Dolgov <fox@bah.spb.su>
Fri, 28 Oct 2005 01:26:50 +0000 (02:26 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Fri, 28 Oct 2005 01:26:50 +0000 (02:26 +0100)
config.php-dist
tt-rss.php

index 6fc6af7fd86e596bea9aadc7d2a9562a5c1cfe4f..f7848430a1fcd9b0219dc60da6a03490a2ddf7cc 100644 (file)
        // crafted SQL queries. This feature is highly experimental and
        // at this point not user friendly. Use with caution.
 
+       define(DEFAULT_ARTICLE_LIMIT, 0);
+       // default limit for articles to display. Set to 0 for no limit. Not
+       // limited to the default 15, 30, 60 article limits - you may use
+       // any number you want and it will be added to the list. Negative
+       // numbers will be ignored. Anything that evaluates numerically to
+       // zero will be interpreted as 0.
+
        define(DEFAULT_UPDATE_INTERVAL, 30);
        // default interval between feed updates, minutes
 
index 9d8160df757f158fa6ed95bd4ac45795456a4b78..018ab865947c5f5225f56a6818570f9bff251d6c 100644 (file)
                &nbsp;Limit:
 
                <select id="limitbox" onchange="javascript:viewCurrentFeed(0, '')">
-                       <option>15</option>
-                       <option selected>30</option>
-                       <option>60</option>
-                       <option>All</option>
+               
+               <?
+                       $limits = array(15 => 15, 30 => 30, 60 => 60);
+                       
+                       if (DEFAULT_ARTILE_LIMIT >= 0) {
+                               $limits[DEFAULT_ARTICLE_LIMIT] = DEFAULT_ARTICLE_LIMIT; 
+                       }
+                       
+                       asort($limits);
+
+                       array_push($limits, 0);
+
+                       foreach ($limits as $key) {
+                               print "<option";
+                               if ($key == DEFAULT_ARTICLE_LIMIT) { print " selected"; }
+                               print ">";
+                               
+                               if ($limits[$key] == 0) { print "All"; } else { print $limits[$key]; }
+                               
+                               print "</option>";
+                       } ?>
+                       
                </select>
 
                &nbsp;Feed: <input class="button" type="submit"