|
|
@ -22,14 +22,16 @@ class Pref_Feeds extends Handler_Protected {
|
|
|
|
return $rv;
|
|
|
|
return $rv;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function renamecat() {
|
|
|
|
function renameCat() {
|
|
|
|
|
|
|
|
$cat = ORM::for_table("ttrss_feed_categories")
|
|
|
|
|
|
|
|
->where("owner_uid", $_SESSION["uid"])
|
|
|
|
|
|
|
|
->find_one($_REQUEST['id']);
|
|
|
|
|
|
|
|
|
|
|
|
$title = clean($_REQUEST['title']);
|
|
|
|
$title = clean($_REQUEST['title']);
|
|
|
|
$id = clean($_REQUEST['id']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($title) {
|
|
|
|
if ($cat && $title) {
|
|
|
|
$sth = $this->pdo->prepare("UPDATE ttrss_feed_categories SET
|
|
|
|
$cat->title = $title;
|
|
|
|
title = ? WHERE id = ? AND owner_uid = ?");
|
|
|
|
$cat->save();
|
|
|
|
$sth->execute([$title, $id, $_SESSION['uid']]);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -513,11 +515,11 @@ class Pref_Feeds extends Handler_Protected {
|
|
|
|
|
|
|
|
|
|
|
|
$feed_id = (int)clean($_REQUEST["id"]);
|
|
|
|
$feed_id = (int)clean($_REQUEST["id"]);
|
|
|
|
|
|
|
|
|
|
|
|
$sth = $this->pdo->prepare("SELECT * FROM ttrss_feeds WHERE id = ? AND
|
|
|
|
$row = ORM::for_table('ttrss_feeds')
|
|
|
|
owner_uid = ?");
|
|
|
|
->where("owner_uid", $_SESSION["uid"])
|
|
|
|
$sth->execute([$feed_id, $_SESSION['uid']]);
|
|
|
|
->find_one($feed_id)->as_array();
|
|
|
|
|
|
|
|
|
|
|
|
if ($row = $sth->fetch(PDO::FETCH_ASSOC)) {
|
|
|
|
if ($row) {
|
|
|
|
|
|
|
|
|
|
|
|
ob_start();
|
|
|
|
ob_start();
|
|
|
|
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_EDIT_FEED, $feed_id);
|
|
|
|
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_EDIT_FEED, $feed_id);
|
|
|
@ -720,48 +722,32 @@ class Pref_Feeds extends Handler_Protected {
|
|
|
|
|
|
|
|
|
|
|
|
$reset_basic_info = $orig_feed_url != $feed_url; */
|
|
|
|
$reset_basic_info = $orig_feed_url != $feed_url; */
|
|
|
|
|
|
|
|
|
|
|
|
$sth = $this->pdo->prepare("UPDATE ttrss_feeds SET
|
|
|
|
$feed = ORM::for_table('ttrss_feeds')
|
|
|
|
cat_id = :cat_id,
|
|
|
|
->where('owner_uid', $_SESSION['uid'])
|
|
|
|
title = :title,
|
|
|
|
->find_one($feed_id);
|
|
|
|
feed_url = :feed_url,
|
|
|
|
|
|
|
|
site_url = :site_url,
|
|
|
|
if ($feed) {
|
|
|
|
update_interval = :upd_intl,
|
|
|
|
|
|
|
|
purge_interval = :purge_intl,
|
|
|
|
$feed->title = $feed_title;
|
|
|
|
auth_login = :auth_login,
|
|
|
|
$feed->cat_id = $cat_id ? $cat_id : null;
|
|
|
|
auth_pass = :auth_pass,
|
|
|
|
$feed->feed_url = $feed_url;
|
|
|
|
auth_pass_encrypted = false,
|
|
|
|
$feed->site_url = $site_url;
|
|
|
|
private = :private,
|
|
|
|
$feed->update_interval = $upd_intl;
|
|
|
|
cache_images = :cache_images,
|
|
|
|
$feed->purge_interval = $purge_intl;
|
|
|
|
hide_images = :hide_images,
|
|
|
|
$feed->auth_login = $auth_login;
|
|
|
|
include_in_digest = :include_in_digest,
|
|
|
|
$feed->auth_pass = $auth_pass;
|
|
|
|
always_display_enclosures = :always_display_enclosures,
|
|
|
|
$feed->private = (int)$private;
|
|
|
|
mark_unread_on_update = :mark_unread_on_update,
|
|
|
|
$feed->cache_images = (int)$cache_images;
|
|
|
|
feed_language = :feed_language
|
|
|
|
$feed->hide_images = (int)$hide_images;
|
|
|
|
WHERE id = :id AND owner_uid = :uid");
|
|
|
|
$feed->feed_language = $feed_language;
|
|
|
|
|
|
|
|
$feed->include_in_digest = (int)$include_in_digest;
|
|
|
|
$sth->execute([":title" => $feed_title,
|
|
|
|
$feed->always_display_enclosures = (int)$always_display_enclosures;
|
|
|
|
":cat_id" => $cat_id ? $cat_id : null,
|
|
|
|
$feed->mark_unread_on_update = (int)$mark_unread_on_update;
|
|
|
|
":feed_url" => $feed_url,
|
|
|
|
|
|
|
|
":site_url" => $site_url,
|
|
|
|
$feed->save();
|
|
|
|
":upd_intl" => $upd_intl,
|
|
|
|
|
|
|
|
":purge_intl" => $purge_intl,
|
|
|
|
|
|
|
|
":auth_login" => $auth_login,
|
|
|
|
|
|
|
|
":auth_pass" => $auth_pass,
|
|
|
|
|
|
|
|
":private" => (int)$private,
|
|
|
|
|
|
|
|
":cache_images" => (int)$cache_images,
|
|
|
|
|
|
|
|
":hide_images" => (int)$hide_images,
|
|
|
|
|
|
|
|
":include_in_digest" => (int)$include_in_digest,
|
|
|
|
|
|
|
|
":always_display_enclosures" => (int)$always_display_enclosures,
|
|
|
|
|
|
|
|
":mark_unread_on_update" => (int)$mark_unread_on_update,
|
|
|
|
|
|
|
|
":feed_language" => $feed_language,
|
|
|
|
|
|
|
|
":id" => $feed_id,
|
|
|
|
|
|
|
|
":uid" => $_SESSION['uid']]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* if ($reset_basic_info) {
|
|
|
|
|
|
|
|
RSSUtils::set_basic_feed_info($feed_id);
|
|
|
|
|
|
|
|
} */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_SAVE_FEED, $feed_id);
|
|
|
|
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_SAVE_FEED, $feed_id);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$feed_data = array();
|
|
|
|
$feed_data = array();
|
|
|
@ -874,7 +860,7 @@ class Pref_Feeds extends Handler_Protected {
|
|
|
|
function removeCat() {
|
|
|
|
function removeCat() {
|
|
|
|
$ids = explode(",", clean($_REQUEST["ids"]));
|
|
|
|
$ids = explode(",", clean($_REQUEST["ids"]));
|
|
|
|
foreach ($ids as $id) {
|
|
|
|
foreach ($ids as $id) {
|
|
|
|
$this->remove_feed_category($id, $_SESSION["uid"]);
|
|
|
|
Feeds::_remove_cat((int)$id, $_SESSION["uid"]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1188,12 +1174,6 @@ class Pref_Feeds extends Handler_Protected {
|
|
|
|
print json_encode($rv);
|
|
|
|
print json_encode($rv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private function remove_feed_category($id, $owner_uid) {
|
|
|
|
|
|
|
|
$sth = $this->pdo->prepare("DELETE FROM ttrss_feed_categories
|
|
|
|
|
|
|
|
WHERE id = ? AND owner_uid = ?");
|
|
|
|
|
|
|
|
$sth->execute([$id, $owner_uid]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static function remove_feed($id, $owner_uid) {
|
|
|
|
static function remove_feed($id, $owner_uid) {
|
|
|
|
|
|
|
|
|
|
|
|
if (PluginHost::getInstance()->run_hooks_until(PluginHost::HOOK_UNSUBSCRIBE_FEED, true, $id, $owner_uid))
|
|
|
|
if (PluginHost::getInstance()->run_hooks_until(PluginHost::HOOK_UNSUBSCRIBE_FEED, true, $id, $owner_uid))
|
|
|
|