-
";
".__("Subscribe to feed...")."
";
+ $rc = Feeds::subscribe_to_feed($feed_url);
+ $feed_urls = false;
- $rc = Feeds::subscribe_to_feed($feed_url);
-
- switch ($rc['code']) {
- case 0:
- print_warning(T_sprintf("Already subscribed to %s.", $feed_url));
- break;
- case 1:
- print_notice(T_sprintf("Subscribed to %s.", $feed_url));
- break;
- case 2:
- print_error(T_sprintf("Could not subscribe to %s.", $feed_url));
- break;
- case 3:
- print_error(T_sprintf("No feeds found in %s.", $feed_url));
- break;
- case 4:
- print_notice(__("Multiple feed URLs found."));
- $feed_urls = $rc["feeds"];
- break;
- case 5:
- print_error(T_sprintf("Could not subscribe to %s.
Can't download the Feed URL.", $feed_url)); - break; - } - - if ($feed_urls) { - - print ""; - } + print ""; + } + + $tp_uri = get_self_url_prefix() . "/prefs.php"; + + if ($rc['code'] <= 2){ + $sth = $this->pdo->prepare("SELECT id FROM ttrss_feeds WHERE feed_url = ? AND owner_uid = ?"); - $sth->execute([$feed_url, $_SESSION['uid']]); - $row = $sth->fetch(); + $sth->execute([$feed_url, $_SESSION['uid']]); + $row = $sth->fetch(); - $feed_id = $row["id"]; - } else { - $feed_id = 0; - } - print "
Can't download the Feed URL.", $feed_url)); - break; - } - - if ($feed_urls) { - - print ""; - } + print ""; + } + + $tp_uri = get_self_url_prefix() . "/prefs.php"; + + if ($rc['code'] <= 2){ + $sth = $this->pdo->prepare("SELECT id FROM ttrss_feeds WHERE feed_url = ? AND owner_uid = ?"); - $sth->execute([$feed_url, $_SESSION['uid']]); - $row = $sth->fetch(); + $sth->execute([$feed_url, $_SESSION['uid']]); + $row = $sth->fetch(); - $feed_id = $row["id"]; - } else { - $feed_id = 0; - } - print "
"; + $feed_id = $row["id"]; + } else { + $feed_id = 0; + } + print "
"; - if ($feed_id) { - print "
"; + } } - print ""; + print ""; print "