diff options
author | Andrew Dolgov <[email protected]> | 2010-11-07 23:30:05 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2010-11-07 23:30:05 +0300 |
commit | 5c7c7da9e12134ae2c4be1f60823e5440015f0ca (patch) | |
tree | 6480604220624b1b5633024115ee266e1ea00b3e /modules/pref-feeds.php | |
parent | 8b640f50e0bf933e95e315d3015f36cebb460a30 (diff) |
allow adding cats from feed editor
Diffstat (limited to 'modules/pref-feeds.php')
-rw-r--r-- | modules/pref-feeds.php | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/modules/pref-feeds.php b/modules/pref-feeds.php index 376980ce3..7a436cfd2 100644 --- a/modules/pref-feeds.php +++ b/modules/pref-feeds.php @@ -1031,24 +1031,10 @@ if ($action == "add") { - $feed_cat = db_escape_string(trim($_REQUEST["cat"])); - $result = db_query($link, - "SELECT id FROM ttrss_feed_categories - WHERE title = '$feed_cat' AND owner_uid = ".$_SESSION["uid"]); - - if (db_num_rows($result) == 0) { - - $result = db_query($link, - "INSERT INTO ttrss_feed_categories (owner_uid,title) - VALUES ('".$_SESSION["uid"]."', '$feed_cat')"); - - } else { - - print_warning(T_sprintf("Category <b>$%s</b> already exists in the database.", - $feed_cat)); - } + if (!add_feed_category($link, $feed_cat)) + print_warning(T_sprintf("Category <b>$%s</b> already exists in the database.", $feed_cat)); } |