]> git.wh0rd.org Git - tt-rss.git/commitdiff
allow generated feeds to use view_mode
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 3 Nov 2010 21:24:18 +0000 (00:24 +0300)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 3 Nov 2010 21:24:18 +0000 (00:24 +0300)
backend.php
functions.php
tt-rss.php

index 06c1ecbd96b20080c6581be1dbfddb41b0c349ed..252548167e31aaafdd5e3166f1833e9cbca90c4a 100644 (file)
                        $search = db_escape_string($_REQUEST["q"]);
                        $match_on = db_escape_string($_REQUEST["m"]);
                        $search_mode = db_escape_string($_REQUEST["smode"]);
+                       $view_mode = db_escape_string($_REQUEST["view_mode"]);
 
                        if (SINGLE_USER_MODE) {
                                authenticate_user($link, "admin", null);
                                authenticate_user($link, $user, $pass);
                        }
 
-                       if ($_SESSION["uid"] ||
-                               http_authenticate_user($link)) {
-
-                                       generate_syndicated_feed($link, 0, $feed, $is_cat, $limit,
-                                               $search, $search_mode, $match_on);
+                       if ($_SESSION["uid"] || http_authenticate_user($link)) {
+                               generate_syndicated_feed($link, 0, $feed, $is_cat, $limit,
+                                       $search, $search_mode, $match_on, $view_mode);
                        }
                break; // rss
 
index 0712a8a91e27b2a6b04edfb469a37a736dc67072..171173e5875b6773ed90756bc7a446d51e837ff8 100644 (file)
                        if ($view_mode == "marked") {
                                $view_query_part = " marked = true AND ";
                        }
-       
+
+                       if ($view_mode == "published") {
+                               $view_query_part = " published = true AND ";
+                       }
+
                        if ($view_mode == "unread") {
                                $view_query_part = " unread = true AND ";
                        }
        }
 
        function generate_syndicated_feed($link, $owner_uid, $feed, $is_cat,
-               $limit, $search, $search_mode, $match_on) {
+               $limit, $search, $search_mode, $match_on, $view_mode = false) {
 
                $note_style =   "float : right; background-color : #fff7d5; border-width : 1px; ".
                        "padding : 5px; border-style : dashed; border-color : #e7d796;".
                if (!$limit) $limit = 30;
 
                $qfh_ret = queryFeedHeadlines($link, $feed, 
-                       $limit, false, $is_cat, $search, $search_mode, $match_on, "date_entered DESC", 0,
-                       $owner_uid);
+                       $limit, $view_mode, $is_cat, $search, $search_mode, 
+                       $match_on, "date_entered DESC", 0, $owner_uid);
 
                $result = $qfh_ret[0];
                $feed_title = htmlspecialchars($qfh_ret[1]);
 
        function print_headline_subtoolbar($link, $feed_site_url, $feed_title, 
                        $feed_id, $is_cat, $search, $match_on,
-                       $search_mode) {
+                       $search_mode, $view_mode) {
 
                        print "<div class=\"headlinesSubToolbar\">";
 
                        }
 
                        print "
-                               <a target=\"_blank\" 
-                                       href=\"backend.php?op=rss&id=$feed_id&is_cat=$is_cat$search_q\">
-                                       <img class=\"noborder\" 
-                                               alt=\"".__('Generated feed')."\" src=\"images/feed-icon-12x12.png\">
-                                               </a>";
+                               <a target=\"_blank\"
+                                       title=\"".__("RSS feed for this buffer")."\"
+                                       href=\"backend.php?op=rss&id=$feed_id&is_cat=$is_cat&view-mode=$view_mode$search_q\">
+                                       <img class=\"noborder\" src=\"images/feed-icon-12x12.png\"></a>";
 
                        print "</div>";
 
                        }
 
                        print_headline_subtoolbar($link, $feed_site_url, $feed_title,
-                               $feed, $cat_view, $search, $match_on, $search_mode);
+                               $feed, $cat_view, $search, $match_on, $search_mode, $view_mode);
 
                        print "<div id=\"headlinesInnerContainer\" onscroll=\"headlines_scroll_handler()\">";
                }
index 0d98c987110b6c6eec8f78a0194f4f8963bd9349..b9b6cbe006d4c31f3e8dd69ae1f6466e4e528fd7 100644 (file)
                        <option selected="selected" value="adaptive"><?php echo __('Adaptive') ?></option>
                        <option value="all_articles"><?php echo __('All Articles') ?></option>
                        <option value="marked"><?php echo __('Starred') ?></option>
+                       <option value="published"><?php echo __('Published') ?></option>
                        <option value="unread"><?php echo __('Unread') ?></option>
                        <!-- <option value="noscores"><?php echo __('Ignore Scoring') ?></option> -->
                        <option value="updated"><?php echo __('Updated') ?></option>