mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 15:45:56 +00:00
move batchAddFeeds to pref-feeds
This commit is contained in:
@@ -640,42 +640,6 @@ class RPC extends Handler_Protected {
|
||||
return;
|
||||
}
|
||||
|
||||
function batchAddFeeds() {
|
||||
$cat_id = db_escape_string($this->link, $_REQUEST['cat']);
|
||||
$feeds = explode("\n", db_escape_string($this->link, $_REQUEST['feeds']));
|
||||
$login = db_escape_string($this->link, $_REQUEST['login']);
|
||||
$pass = db_escape_string($this->link, $_REQUEST['pass']);
|
||||
|
||||
foreach ($feeds as $feed) {
|
||||
$feed = trim($feed);
|
||||
|
||||
if (validate_feed_url($feed)) {
|
||||
|
||||
db_query($this->link, "BEGIN");
|
||||
|
||||
if ($cat_id == "0" || !$cat_id) {
|
||||
$cat_qpart = "NULL";
|
||||
} else {
|
||||
$cat_qpart = "'$cat_id'";
|
||||
}
|
||||
|
||||
$result = db_query($this->link,
|
||||
"SELECT id FROM ttrss_feeds
|
||||
WHERE feed_url = '$feed' AND owner_uid = ".$_SESSION["uid"]);
|
||||
|
||||
if (db_num_rows($result) == 0) {
|
||||
$result = db_query($this->link,
|
||||
"INSERT INTO ttrss_feeds
|
||||
(owner_uid,feed_url,title,cat_id,auth_login,auth_pass,update_method)
|
||||
VALUES ('".$_SESSION["uid"]."', '$feed',
|
||||
'[Unknown]', $cat_qpart, '$login', '$pass', 0)");
|
||||
}
|
||||
|
||||
db_query($this->link, "COMMIT");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setScore() {
|
||||
$ids = db_escape_string($this->link, $_REQUEST['id']);
|
||||
$score = (int)db_escape_string($this->link, $_REQUEST['score']);
|
||||
|
||||
Reference in New Issue
Block a user