]> git.wh0rd.org Git - tt-rss.git/commitdiff
show originating feed info when viewing archived article
authorAndrew Dolgov <fox@bah.org.ru>
Mon, 28 Dec 2009 17:25:16 +0000 (20:25 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Mon, 28 Dec 2009 17:25:16 +0000 (20:25 +0300)
functions.php
modules/backend-rpc.php

index de35b327420175b0948e8e5d7abc5d91c6aa6d00..11ebf7b8c06c073091be51f6eb6cbc755c0114fa 100644 (file)
                                                _debug("update_rss_feed: initial score: $score");
                                        }
 
-                                       $result = db_query($link,
-                                               "SELECT ref_id, int_id FROM ttrss_user_entries WHERE
+                                       $query = "SELECT ref_id, int_id FROM ttrss_user_entries WHERE
                                                        ref_id = '$ref_id' AND owner_uid = '$owner_uid'
-                                                       $dupcheck_qpart");
+                                                       $dupcheck_qpart";
+
+//                                     if ($_GET["xdebug"]) print "$query\n";
+
+                                       $result = db_query($link, $query);
 
                                        // okay it doesn't exist - create user entry
                                        if (db_num_rows($result) == 0) {
 
                        if ($feed_id != "0") {
                                print "<li class=\"insensitive\">".__('Selection:')."</li>
-                                       <li onclick=\"$archive_sel_link\">&nbsp;&nbsp;".__('Archive')."</li>";
+                                       <li onclick=\"$archive_sel_link\">&nbsp;&nbsp;".__('Archive')."</li>
+                                       <li onclick=\"$delete_sel_link\">&nbsp;&nbsp;".__('Delete')."</li>";
                        } else {
                                print "<li class=\"insensitive\">".__('Selection:')."</li>
                                        <li onclick=\"$archive_sel_link\">&nbsp;&nbsp;".__('Move back')."</li>
                        (SELECT icon_url FROM ttrss_feeds WHERE id = feed_id) as icon_url,
                        num_comments,
                        author,
+                       orig_feed_id,
                        note
                        FROM ttrss_entries,ttrss_user_entries
                        WHERE   id = '$id' AND ref_id = id AND owner_uid = " . $_SESSION["uid"]);
                        print "</div>";
                        print "<div clear='both'>$entry_comments</div>";
 
+                       if ($line["orig_feed_id"]) {
+
+                               $tmp_result = db_query($link, "SELECT * FROM ttrss_archived_feeds
+                                       WHERE id = ".$line["orig_feed_id"]);
+
+                               if (db_num_rows($tmp_result) != 0) {
+
+                                       print "<div clear='both'>";
+                                       print __("Originally from:");
+
+                                       print "&nbsp;";
+
+                                       $tmp_line = db_fetch_assoc($tmp_result);
+
+                                       print "<a target='_blank' 
+                                               href=' " . htmlspecialchars($tmp_line['site_url']) . "'>" .
+                                               $tmp_line['title'] . "</a>";
+
+                                       print "&nbsp;";
+
+                                       print "<a target='_blank' href='" . htmlspecialchars($tmp_line['feed_url']) . "'>";
+                                       print "<img title='".__('Feed URL')."'class='tinyFeedIcon' src='images/pub_set.gif'></a>";
+
+                                       print "</div>";
+                               }
+                       }
+
                        print "</div>";
 
                        print "<div class=\"postIcon\">" . $feed_icon . "</div>";
index 7374241ca7c4cea339239017fb081b0562a55015..2d1a8f90b61a7f094946ab0b560664bc08eeab3a 100644 (file)
                        $ids = db_escape_string($_GET["ids"]);
 
                        $result = db_query($link, "UPDATE ttrss_user_entries 
-                               SET feed_id = orig_feed_id
+                               SET feed_id = orig_feed_id, orig_feed_id = NULL
                                WHERE ref_id IN ($ids) AND owner_uid = " . $_SESSION["uid"]);
 
                        print "<rpc-reply><counters>";