From a0476535ef78964322f28dc6643e97923f0688f1 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 29 Dec 2005 19:25:07 +0100 Subject: feed browser now works --- backend.php | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'backend.php') diff --git a/backend.php b/backend.php index 626df1d06..14e911449 100644 --- a/backend.php +++ b/backend.php @@ -1501,6 +1501,27 @@ $subop = $_REQUEST["subop"]; $quiet = $_REQUEST["quiet"]; + if ($subop == "massSubscribe") { + $ids = split(",", db_escape_string($_GET["ids"])); + + foreach ($ids as $id) { + $result = db_query($link, "SELECT feed_url,title FROM ttrss_feeds + WHERE id = '$id'"); + + $feed_url = db_fetch_result($result, 0, "feed_url"); + $title = db_fetch_result($result, 0, "title"); + + $result = db_query($link, "SELECT id FROM ttrss_feeds WHERE + feed_url = '$feed_url' AND owner_uid = " . $_SESSION["uid"]); + + if (db_num_rows($result) == 0) { + $result = db_query($link, + "INSERT INTO ttrss_feeds (owner_uid,feed_url,title,cat_id) + VALUES ('".$_SESSION["uid"]."', '$feed_url', '$title', NULL)"); + } + } + } + if ($subop == "browse") { print "
"; @@ -1533,9 +1554,11 @@ $feed_icon = ""; } - $check_box = ""; + $check_box = ""; - print "
  • $check_box $feed_icon" . $details["title"] . + print "
  • $check_box $feed_icon" . + $details["title"] . " ($subscribers)
  • "; } -- cgit v1.2.3