summaryrefslogtreecommitdiff
path: root/backend.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-12-20 09:00:11 +0100
committerAndrew Dolgov <[email protected]>2005-12-20 09:00:11 +0100
commit15da5cc18d8ccbca3f82d2120ace5ca8e0133019 (patch)
tree438cb6993eb06a1cc9883ae316a184a94e79eda8 /backend.php
parent72932a754fe41ae8f0ab8550e650c387a56aeeb7 (diff)
quick add feed now has category dropbox, quick feed delete resets headlines view on delete
Diffstat (limited to 'backend.php')
-rw-r--r--backend.php37
1 files changed, 33 insertions, 4 deletions
diff --git a/backend.php b/backend.php
index 40a59afcb..ea5b6a0bb 100644
--- a/backend.php
+++ b/backend.php
@@ -1642,6 +1642,13 @@
if (!WEB_DEMO_MODE) {
$feed_link = db_escape_string(trim($_GET["link"]));
+ $cat_id = db_escape_string($_GET["cid"]);
+
+ if ($cat_id == "0") {
+ $cat_qpart = "NULL";
+ } else {
+ $cat_qpart = "'$cat_id'";
+ }
$result = db_query($link,
"SELECT id FROM ttrss_feeds
@@ -1650,8 +1657,8 @@
if (db_num_rows($result) == 0) {
$result = db_query($link,
- "INSERT INTO ttrss_feeds (owner_uid,feed_url,title)
- VALUES ('".$_SESSION["uid"]."', '$feed_link', '')");
+ "INSERT INTO ttrss_feeds (owner_uid,feed_url,title,cat_id)
+ VALUES ('".$_SESSION["uid"]."', '$feed_link', '', $cat_qpart)");
$result = db_query($link,
"SELECT id FROM ttrss_feeds WHERE feed_url = '$feed_link'
@@ -2714,8 +2721,30 @@
print "
Feed URL: <input
onblur=\"javascript:enableHotkeys()\" onfocus=\"javascript:disableHotkeys()\"
- id=\"qafInput\">
- <input class=\"button\"
+ id=\"qafInput\">";
+
+ if (get_pref($link, 'ENABLE_FEED_CATS')) {
+ $result = db_query($link, "SELECT title,id FROM ttrss_feed_categories
+ WHERE owner_uid = ".$_SESSION["uid"]."
+ ORDER BY title");
+
+ print " <select id=\"qafCat\">";
+ print "<option id=\"0\">Uncategorized</option>";
+
+ if (db_num_rows($result) != 0) {
+
+ print "<option disabled>--------</option>";
+
+ while ($line = db_fetch_assoc($result)) {
+ printf("<option id='%d'>%s</option>",
+ $line["id"], $line["title"]);
+ }
+ }
+
+ print "</select>";
+ }
+
+ print "&nbsp;<input class=\"button\"
type=\"submit\" onclick=\"javascript:qafAdd()\" value=\"Add feed\">
<input class=\"button\"
type=\"submit\" onclick=\"javascript:closeDlg()\"