From ef83538d2ea4de3994a726c1748eb34d6e4647e1 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 28 Dec 2009 20:25:16 +0300 Subject: [PATCH] show originating feed info when viewing archived article --- functions.php | 40 ++++++++++++++++++++++++++++++++++++---- modules/backend-rpc.php | 2 +- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/functions.php b/functions.php index de35b327..11ebf7b8 100644 --- a/functions.php +++ b/functions.php @@ -1164,10 +1164,13 @@ _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) { @@ -4154,7 +4157,8 @@ if ($feed_id != "0") { print "
  • ".__('Selection:')."
  • -
  •   ".__('Archive')."
  • "; +
  •   ".__('Archive')."
  • +
  •   ".__('Delete')."
  • "; } else { print "
  • ".__('Selection:')."
  •   ".__('Move back')."
  • @@ -4702,6 +4706,7 @@ (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"]); @@ -4811,6 +4816,33 @@ print ""; print "
    $entry_comments
    "; + 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 "
    "; + print __("Originally from:"); + + print " "; + + $tmp_line = db_fetch_assoc($tmp_result); + + print "" . + $tmp_line['title'] . ""; + + print " "; + + print ""; + print ""; + + print "
    "; + } + } + print ""; print "
    " . $feed_icon . "
    "; diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php index 7374241c..2d1a8f90 100644 --- a/modules/backend-rpc.php +++ b/modules/backend-rpc.php @@ -106,7 +106,7 @@ $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 ""; -- 2.39.5