From 44727c79ad0593982b817554412fc5313e36e2fb Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 25 Jun 2013 23:07:09 +0400 Subject: batch feed editor: remove title and feed url because batch editing those makes no sense whatsoever --- classes/pref/feeds.php | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'classes/pref/feeds.php') diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php index d2dc6f7c3..870c4fed4 100644 --- a/classes/pref/feeds.php +++ b/classes/pref/feeds.php @@ -792,31 +792,10 @@ class Pref_Feeds extends Handler_Protected { print "
".__("Feed")."
"; print "
"; - /* Title */ - - print ""; - - $this->batch_edit_cbox("title"); - - /* Feed URL */ - - print "
"; - - print __('URL:') . " "; - print ""; - - $this->batch_edit_cbox("feed_url"); - /* Category */ if (get_pref('ENABLE_FEED_CATS')) { - print "
"; - print __('Place in category:') . " "; print_feed_cat_select("cat_id", false, @@ -862,7 +841,7 @@ class Pref_Feeds extends Handler_Protected { $this->batch_edit_cbox("auth_login"); - print "
"; -- cgit v1.2.3-54-g00ecf From 41a7a066eff0c4914720685c38fa282e99d79041 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 11 Jul 2013 14:11:41 +0400 Subject: share: move unsharing all articles into the plugin --- classes/pref/feeds.php | 9 --------- classes/rpc.php | 8 -------- js/prefs.js | 19 ------------------- plugins/share/init.php | 30 ++++++++++++++++++++++++++++++ plugins/share/share_prefs.js | 21 +++++++++++++++++++++ 5 files changed, 51 insertions(+), 36 deletions(-) create mode 100644 plugins/share/share_prefs.js (limited to 'classes/pref/feeds.php') diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php index 870c4fed4..1f8c5e4a0 100644 --- a/classes/pref/feeds.php +++ b/classes/pref/feeds.php @@ -1471,15 +1471,6 @@ class Pref_Feeds extends Handler_Protected { print "

"; - print_warning(__("You can disable all articles shared by unique URLs here.")); - - print "

"; - - print " "; - - print "

"; - PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB_SECTION, "hook_prefs_tab_section", "prefFeedsPublishedGenerated"); diff --git a/classes/rpc.php b/classes/rpc.php index 46583feb5..9cc8e7046 100644 --- a/classes/rpc.php +++ b/classes/rpc.php @@ -467,14 +467,6 @@ class RPC extends Handler_Protected { print_feed_cat_select("cat_id", $id, ''); } - // Silent - function clearArticleKeys() { - $this->dbh->query("UPDATE ttrss_user_entries SET uuid = '' WHERE - owner_uid = " . $_SESSION["uid"]); - - return; - } - function setpanelmode() { $wide = (int) $_REQUEST["wide"]; diff --git a/js/prefs.js b/js/prefs.js index 287804c6f..67a4a378c 100644 --- a/js/prefs.js +++ b/js/prefs.js @@ -1529,25 +1529,6 @@ function clearFeedAccessKeys() { return false; } -function clearArticleAccessKeys() { - - var ok = confirm(__("This will invalidate all previously shared article URLs. Continue?")); - - if (ok) { - notify_progress("Clearing URLs..."); - - var query = "?op=rpc&method=clearArticleKeys"; - - new Ajax.Request("backend.php", { - parameters: query, - onComplete: function(transport) { - notify_info("Shared URLs cleared."); - } }); - } - - return false; -} - function resetFilterOrder() { try { notify_progress("Loading, please wait..."); diff --git a/plugins/share/init.php b/plugins/share/init.php index a1b0146a1..552aa0a31 100644 --- a/plugins/share/init.php +++ b/plugins/share/init.php @@ -12,12 +12,18 @@ class Share extends Plugin { $this->host = $host; $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this); + $host->add_hook($host::HOOK_PREFS_TAB_SECTION, $this); } function get_js() { return file_get_contents(dirname(__FILE__) . "/share.js"); } + function get_prefs_js() { + return file_get_contents(dirname(__FILE__) . "/share_prefs.js"); + } + + function unshare() { $id = db_escape_string($_REQUEST['id']); @@ -27,6 +33,30 @@ class Share extends Plugin { print "OK"; } + function hook_prefs_tab_section($id) { + if ($id == "prefFeedsPublishedGenerated") { + + print_warning(__("You can disable all articles shared by unique URLs here.")); + + print "

"; + + print " "; + + print "

"; + + } + } + + // Silent + function clearArticleKeys() { + db_query("UPDATE ttrss_user_entries SET uuid = '' WHERE + owner_uid = " . $_SESSION["uid"]); + + return; + } + + function newkey() { $id = db_escape_string($_REQUEST['id']); diff --git a/plugins/share/share_prefs.js b/plugins/share/share_prefs.js new file mode 100644 index 000000000..9efe291f9 --- /dev/null +++ b/plugins/share/share_prefs.js @@ -0,0 +1,21 @@ +function clearArticleAccessKeys() { + + var ok = confirm(__("This will invalidate all previously shared article URLs. Continue?")); + + if (ok) { + notify_progress("Clearing URLs..."); + + var query = "?op=pluginhandler&plugin=share&method=clearArticleKeys"; + + new Ajax.Request("backend.php", { + parameters: query, + onComplete: function(transport) { + notify_info("Shared URLs cleared."); + } }); + } + + return false; +} + + + -- cgit v1.2.3-54-g00ecf From 1a545dcb44e492494b2f7c473d7534f72b7c5c1b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 12 Jul 2013 12:38:50 +0400 Subject: mark feed with error in headlines toolbar, use error icon in feed editor --- classes/feeds.php | 4 +++- classes/pref/feeds.php | 5 +++-- css/tt-rss.css | 8 ++------ 3 files changed, 8 insertions(+), 9 deletions(-) (limited to 'classes/pref/feeds.php') diff --git a/classes/feeds.php b/classes/feeds.php index e71be4e55..5649da7ce 100644 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -48,9 +48,11 @@ class Feeds extends Handler_Protected { // right part + $error_class = $error ? "error" : ""; + $reply .= ""; $reply .= ""; - $reply .= ""; + $reply .= ""; if ($feed_site_url) { $last_updated = T_sprintf("Last updated: %s", diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php index 1f8c5e4a0..122d4b116 100644 --- a/classes/pref/feeds.php +++ b/classes/pref/feeds.php @@ -572,8 +572,9 @@ class Pref_Feeds extends Handler_Protected { $last_error = $this->dbh->fetch_result($result, 0, "last_error"); if ($last_error) { - print " (error)"; + print " \"(error)\""; } diff --git a/css/tt-rss.css b/css/tt-rss.css index 6b3b310c8..de2a92d59 100644 --- a/css/tt-rss.css +++ b/css/tt-rss.css @@ -320,10 +320,6 @@ div.prefHelp { padding : 5px; } -span.feed_error { - color : red; -} - .insensitive { color : #555; } @@ -356,9 +352,9 @@ div#headlines-toolbar span.r { text-align : right; } -div#headlines-toolbar span.r span.error { +#headlines-toolbar span.r .error a { color : red; -} +} div#headlines-toolbar span.r a { color : #555; -- cgit v1.2.3-54-g00ecf From 76d78eb2e75adee00024d3beedaf437c2d91d1c6 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 24 Dec 2013 13:27:57 +0400 Subject: remove unnecessary wrapping from share uniqid() keys --- classes/pref/feeds.php | 2 +- include/functions.php | 8 ++++---- plugins/instances/init.php | 4 ++-- plugins/share/init.php | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'classes/pref/feeds.php') diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php index 122d4b116..05c2b229e 100644 --- a/classes/pref/feeds.php +++ b/classes/pref/feeds.php @@ -1891,7 +1891,7 @@ class Pref_Feeds extends Handler_Protected { AND owner_uid = " . $owner_uid); if ($this->dbh->num_rows($result) == 1) { - $key = $this->dbh->escape_string(sha1(uniqid(rand(), true))); + $key = $this->dbh->escape_string(uniqid()); $this->dbh->query("UPDATE ttrss_access_keys SET access_key = '$key' WHERE feed_id = '$feed_id' AND is_cat = $sql_is_cat diff --git a/include/functions.php b/include/functions.php index cf9b0510f..a64f0978a 100644 --- a/include/functions.php +++ b/include/functions.php @@ -80,7 +80,7 @@ "pt_BR" => "Portuguese/Brazil", "zh_CN" => "Simplified Chinese", "sv_SE" => "Svenska", - "fi_FI" => "Suomi", + "fi_FI" => "Suomi", "tr_TR" => "Türkçe"); return $tr; @@ -721,7 +721,7 @@ $_SESSION["name"] = db_fetch_result($result, 0, "login"); $_SESSION["access_level"] = db_fetch_result($result, 0, "access_level"); - $_SESSION["csrf_token"] = sha1(uniqid(rand(), true)); + $_SESSION["csrf_token"] = uniqid(rand(), true); db_query("UPDATE ttrss_users SET last_login = NOW() WHERE id = " . $_SESSION["uid"]); @@ -751,7 +751,7 @@ $_SESSION["auth_module"] = false; if (!$_SESSION["csrf_token"]) { - $_SESSION["csrf_token"] = sha1(uniqid(rand(), true)); + $_SESSION["csrf_token"] = uniqid(rand(), true); } $_SESSION["ip_address"] = $_SERVER["REMOTE_ADDR"]; @@ -3747,7 +3747,7 @@ if (db_num_rows($result) == 1) { return db_fetch_result($result, 0, "access_key"); } else { - $key = db_escape_string(sha1(uniqid(rand(), true))); + $key = db_escape_string(uniqid()); $result = db_query("INSERT INTO ttrss_access_keys (access_key, feed_id, is_cat, owner_uid) diff --git a/plugins/instances/init.php b/plugins/instances/init.php index aac28196f..069186ad1 100644 --- a/plugins/instances/init.php +++ b/plugins/instances/init.php @@ -407,7 +407,7 @@ class Instances extends Plugin implements IHandler { print "
"; - $access_key = sha1(uniqid(rand(), true)); + $access_key = uniqid(); /* Access key */ @@ -439,7 +439,7 @@ class Instances extends Plugin implements IHandler { } function genHash() { - $hash = sha1(uniqid(rand(), true)); + $hash = uniqid(); print json_encode(array("hash" => $hash)); } diff --git a/plugins/share/init.php b/plugins/share/init.php index a000b8ebe..5fa998757 100644 --- a/plugins/share/init.php +++ b/plugins/share/init.php @@ -60,7 +60,7 @@ class Share extends Plugin { function newkey() { $id = db_escape_string($_REQUEST['id']); - $uuid = db_escape_string(sha1(uniqid(rand(), true))); + $uuid = db_escape_string(uniqid()); db_query("UPDATE ttrss_user_entries SET uuid = '$uuid' WHERE int_id = '$id' AND owner_uid = " . $_SESSION['uid']); @@ -91,7 +91,7 @@ class Share extends Plugin { $ref_id = db_fetch_result($result, 0, "ref_id"); if (!$uuid) { - $uuid = db_escape_string(sha1(uniqid(rand(), true))); + $uuid = db_escape_string(uniqid()); db_query("UPDATE ttrss_user_entries SET uuid = '$uuid' WHERE int_id = '$param' AND owner_uid = " . $_SESSION['uid']); } -- cgit v1.2.3-54-g00ecf From 4c63934bacb628789897dc2e599e5aa30e76ccd5 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 17 Jan 2014 13:41:27 +0400 Subject: increase randomness of shared url keys a bit --- classes/pref/feeds.php | 2 +- include/functions.php | 2 +- plugins/instances/init.php | 4 ++-- plugins/share/init.php | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'classes/pref/feeds.php') diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php index 05c2b229e..4c51d220c 100644 --- a/classes/pref/feeds.php +++ b/classes/pref/feeds.php @@ -1891,7 +1891,7 @@ class Pref_Feeds extends Handler_Protected { AND owner_uid = " . $owner_uid); if ($this->dbh->num_rows($result) == 1) { - $key = $this->dbh->escape_string(uniqid()); + $key = $this->dbh->escape_string(uniqid(base_convert(rand(), 10, 36))); $this->dbh->query("UPDATE ttrss_access_keys SET access_key = '$key' WHERE feed_id = '$feed_id' AND is_cat = $sql_is_cat diff --git a/include/functions.php b/include/functions.php index fce15b535..28b7a7c89 100644 --- a/include/functions.php +++ b/include/functions.php @@ -3753,7 +3753,7 @@ if (db_num_rows($result) == 1) { return db_fetch_result($result, 0, "access_key"); } else { - $key = db_escape_string(uniqid()); + $key = db_escape_string(uniqid(base_convert(rand(), 10, 36))); $result = db_query("INSERT INTO ttrss_access_keys (access_key, feed_id, is_cat, owner_uid) diff --git a/plugins/instances/init.php b/plugins/instances/init.php index 069186ad1..2de0e5fd2 100644 --- a/plugins/instances/init.php +++ b/plugins/instances/init.php @@ -407,7 +407,7 @@ class Instances extends Plugin implements IHandler { print "
"; - $access_key = uniqid(); + $access_key = uniqid(rand(), true); /* Access key */ @@ -439,7 +439,7 @@ class Instances extends Plugin implements IHandler { } function genHash() { - $hash = uniqid(); + $hash = uniqid(base_convert(rand(), 10, 36)); print json_encode(array("hash" => $hash)); } diff --git a/plugins/share/init.php b/plugins/share/init.php index 5fa998757..899677c32 100644 --- a/plugins/share/init.php +++ b/plugins/share/init.php @@ -60,7 +60,7 @@ class Share extends Plugin { function newkey() { $id = db_escape_string($_REQUEST['id']); - $uuid = db_escape_string(uniqid()); + $uuid = db_escape_string(uniqid(base_convert(rand(), 10, 36))); db_query("UPDATE ttrss_user_entries SET uuid = '$uuid' WHERE int_id = '$id' AND owner_uid = " . $_SESSION['uid']); @@ -91,7 +91,7 @@ class Share extends Plugin { $ref_id = db_fetch_result($result, 0, "ref_id"); if (!$uuid) { - $uuid = db_escape_string(uniqid()); + $uuid = db_escape_string(uniqid(base_convert(rand(), 10, 36))); db_query("UPDATE ttrss_user_entries SET uuid = '$uuid' WHERE int_id = '$param' AND owner_uid = " . $_SESSION['uid']); } -- cgit v1.2.3-54-g00ecf From 4a80c57c50a474c57ba76eb75c1f01daf6e7f121 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 19 Feb 2014 15:42:52 +0400 Subject: remove some unused code reported by phpmd --- classes/article.php | 1 - classes/dlg.php | 1 - classes/feeds.php | 22 +++++----------------- classes/handler/public.php | 10 +++++----- classes/pref/feeds.php | 8 ++------ classes/pref/filters.php | 19 +------------------ classes/pref/prefs.php | 1 - classes/rpc.php | 13 ++++++------- include/digest.php | 2 -- include/feedbrowser.php | 5 ++--- include/functions.php | 15 ++++----------- include/labels.php | 2 +- 12 files changed, 26 insertions(+), 73 deletions(-) (limited to 'classes/pref/feeds.php') diff --git a/classes/article.php b/classes/article.php index 398132d12..f796bf630 100644 --- a/classes/article.php +++ b/classes/article.php @@ -30,7 +30,6 @@ class Article extends Handler_Protected { $id = $this->dbh->escape_string($_REQUEST["id"]); $cids = explode(",", $this->dbh->escape_string($_REQUEST["cids"])); $mode = $this->dbh->escape_string($_REQUEST["mode"]); - $omode = $this->dbh->escape_string($_REQUEST["omode"]); // in prefetch mode we only output requested cids, main article // just gets marked as read (it already exists in client cache) diff --git a/classes/dlg.php b/classes/dlg.php index d1b5745e7..25a194bed 100644 --- a/classes/dlg.php +++ b/classes/dlg.php @@ -16,7 +16,6 @@ class Dlg extends Handler_Protected { print __("If you have imported labels and/or filters, you might need to reload preferences to see your new data.") . "

"; print "
"; - $owner_uid = $_SESSION["uid"]; $this->dbh->query("BEGIN"); diff --git a/classes/feeds.php b/classes/feeds.php index 8d4c052dc..ea3967911 100644 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -13,12 +13,6 @@ class Feeds extends Handler_Protected { $feed_id, $is_cat, $search, $search_mode, $view_mode, $error, $feed_last_updated) { - $page_prev_link = "viewFeedGoPage(-1)"; - $page_next_link = "viewFeedGoPage(1)"; - $page_first_link = "viewFeedGoPage(0)"; - - $catchup_page_link = "catchupPage()"; - $catchup_feed_link = "catchupCurrentFeed()"; $catchup_sel_link = "catchupSelection()"; $archive_sel_link = "archiveSelection()"; @@ -292,8 +286,6 @@ class Feeds extends Handler_Protected { $num_unread = 0; $cur_feed_title = ''; - $fresh_intl = get_pref("FRESH_ARTICLE_MAX_AGE") * 60 * 60; - if ($_REQUEST["debug"]) $timing_info = print_checkpoint("PS", $timing_info); $expand_cdm = get_pref('CDM_EXPANDED'); @@ -557,7 +549,7 @@ class Feeds extends Handler_Protected { $reply['content'] .= "
"; - $reply['content'] .= "
"; + $reply['content'] .= "
"; $reply['content'] .= "
"; $reply['content'] .= "dbh->escape_string($_REQUEST["omode"]); - $feed = $this->dbh->escape_string($_REQUEST["feed"]); $method = $this->dbh->escape_string($_REQUEST["m"]); $view_mode = $this->dbh->escape_string($_REQUEST["view_mode"]); @@ -905,7 +895,7 @@ class Feeds extends Handler_Protected { //$topmost_article_ids = $ret[0]; $headlines_count = $ret[1]; - $returned_feed = $ret[2]; + /* $returned_feed = $ret[2]; */ $disable_cache = $ret[3]; $vgroup_last_feed = $ret[4]; @@ -1085,20 +1075,18 @@ class Feeds extends Handler_Protected { print " "; print "
"; - $owner_uid = $_SESSION["uid"]; - require_once "feedbrowser.php"; print "
    "; - print make_feed_browser($search, 25); + print make_feed_browser("", 25); print "
"; print "
diff --git a/classes/handler/public.php b/classes/handler/public.php index 32c25b511..383654df3 100644 --- a/classes/handler/public.php +++ b/classes/handler/public.php @@ -67,7 +67,7 @@ class Handler_Public extends Handler { $result = $qfh_ret[0]; $feed_title = htmlspecialchars($qfh_ret[1]); $feed_site_url = $qfh_ret[2]; - $last_error = $qfh_ret[3]; + /* $last_error = $qfh_ret[3]; */ $feed_self_url = get_self_url_prefix() . "/public.php?op=rss&id=$feed&key=" . @@ -404,17 +404,17 @@ class Handler_Public extends Handler { } function updateTask() { - PluginHost::getInstance()->run_hooks(PluginHost::HOOK_UPDATE_TASK, "hook_update_task", $op); + PluginHost::getInstance()->run_hooks(PluginHost::HOOK_UPDATE_TASK, "hook_update_task", false); } function housekeepingTask() { - PluginHost::getInstance()->run_hooks(PluginHost::HOOK_HOUSE_KEEPING, "hook_house_keeping", $op); + PluginHost::getInstance()->run_hooks(PluginHost::HOOK_HOUSE_KEEPING, "hook_house_keeping", false); } function globalUpdateFeeds() { RPC::updaterandomfeed_real($this->dbh); - PluginHost::getInstance()->run_hooks(PluginHost::HOOK_UPDATE_TASK, "hook_update_task", $op); + PluginHost::getInstance()->run_hooks(PluginHost::HOOK_UPDATE_TASK, "hook_update_task", false); } function sharepopup() { @@ -692,7 +692,7 @@ class Handler_Public extends Handler { function subscribe2() { $feed_url = $this->dbh->escape_string(trim($_REQUEST["feed_url"])); $cat_id = $this->dbh->escape_string($_REQUEST["cat_id"]); - $from = $this->dbh->escape_string($_REQUEST["from"]); + /* $from = $this->dbh->escape_string($_REQUEST["from"]); */ $feed_urls = array(); /* only read authentication information from POST */ diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php index 4c51d220c..7d541ded1 100644 --- a/classes/pref/feeds.php +++ b/classes/pref/feeds.php @@ -395,7 +395,7 @@ class Pref_Feeds extends Handler_Protected { # print_r($data['items']); if (is_array($data) && is_array($data['items'])) { - $cat_order_id = 0; +# $cat_order_id = 0; $data_map = array(); $root_item = false; @@ -962,7 +962,7 @@ class Pref_Feeds extends Handler_Protected { if (!$batch) { - $result = $this->dbh->query("UPDATE ttrss_feeds SET + $this->dbh->query("UPDATE ttrss_feeds SET $category_qpart title = '$feed_title', feed_url = '$feed_link', update_interval = '$upd_intl', @@ -1573,8 +1573,6 @@ class Pref_Feeds extends Handler_Protected { # class needed for selectTableRows() print ""; - $edit_title = htmlspecialchars($line["title"]); - # id needed for selectTableRows() print ""; - $edit_title = htmlspecialchars($line["title"]); - # id needed for selectTableRows() print "hook_query_headlines($line, 100); } - $entry_timestamp = strtotime($line["updated"]); - $entry_tags = get_article_tags($line["id"], $_SESSION["uid"]); - $content_preview = $line["content_preview"]; if ($line["feed_title"]) @@ -174,24 +170,11 @@ class Pref_Filters extends Handler_Protected { owner_uid = ".$_SESSION["uid"]." ORDER BY order_id, title"); - $action_id = -1; $folder = array(); $folder['items'] = array(); while ($line = $this->dbh->fetch_assoc($result)) { - /* if ($action_id != $line["action_id"]) { - if (count($folder['items']) > 0) { - array_push($root['items'], $folder); - } - - $folder = array(); - $folder['id'] = $line["action_id"]; - $folder['name'] = __($line["action_name"]); - $folder['items'] = array(); - $action_id = $line["action_id"]; - } */ - $name = $this->getFilterName($line["id"]); $match_ok = false; @@ -471,7 +454,7 @@ class Pref_Filters extends Handler_Protected { $inverse = checkbox_to_sql_bool($this->dbh->escape_string($_REQUEST["inverse"])); $title = $this->dbh->escape_string($_REQUEST["title"]); - $result = $this->dbh->query("UPDATE ttrss_filters2 SET enabled = $enabled, + $this->dbh->query("UPDATE ttrss_filters2 SET enabled = $enabled, match_any_rule = $match_any_rule, inverse = $inverse, title = '$title' diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php index 3e7d467fa..1fb40a0d6 100644 --- a/classes/pref/prefs.php +++ b/classes/pref/prefs.php @@ -887,7 +887,6 @@ class Pref_Prefs extends Handler_Protected { if (!$otp_enabled) { $secret = $base32->encode(sha1($this->dbh->fetch_result($result, 0, "salt"))); - $topt = new \OTPHP\TOTP($secret); print QRcode::png("otpauth://totp/".urlencode($login). "?secret=$secret&issuer=".urlencode("Tiny Tiny RSS")); diff --git a/classes/rpc.php b/classes/rpc.php index 7d55e6ba8..b4de44a74 100644 --- a/classes/rpc.php +++ b/classes/rpc.php @@ -95,7 +95,7 @@ class RPC extends Handler_Protected { WHERE orig_feed_id = '$id') = 0 AND id = '$id' AND owner_uid = ".$_SESSION["uid"]); - $rc = $this->dbh->affected_rows($result); + $this->dbh->affected_rows($result); } } @@ -138,7 +138,7 @@ class RPC extends Handler_Protected { $mark = "false"; } - $result = $this->dbh->query("UPDATE ttrss_user_entries SET marked = $mark, + $this->dbh->query("UPDATE ttrss_user_entries SET marked = $mark, last_marked = NOW() WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]); @@ -148,8 +148,8 @@ class RPC extends Handler_Protected { function delete() { $ids = $this->dbh->escape_string($_REQUEST["ids"]); - $result = $this->dbh->query("DELETE FROM ttrss_user_entries - WHERE ref_id IN ($ids) AND owner_uid = " . $_SESSION["uid"]); + $this->dbh->query("DELETE FROM ttrss_user_entries + WHERE ref_id IN ($ids) AND owner_uid = " . $_SESSION["uid"]); purge_orphans(); @@ -258,7 +258,6 @@ class RPC extends Handler_Protected { function publ() { $pub = $_REQUEST["pub"]; $id = $this->dbh->escape_string($_REQUEST["id"]); - $note = trim(strip_tags($this->dbh->escape_string($_REQUEST["note"]))); if ($pub == "1") { $pub = "true"; @@ -266,7 +265,7 @@ class RPC extends Handler_Protected { $pub = "false"; } - $result = $this->dbh->query("UPDATE ttrss_user_entries SET + $this->dbh->query("UPDATE ttrss_user_entries SET published = $pub, last_published = NOW() WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]); @@ -620,7 +619,7 @@ class RPC extends Handler_Protected { $p = new Publisher(PUBSUBHUBBUB_HUB); - $pubsub_result = $p->publish_update($rss_link); + /* $pubsub_result = */ $p->publish_update($rss_link); } } diff --git a/include/digest.php b/include/digest.php index 4427936e5..71ee6d203 100644 --- a/include/digest.php +++ b/include/digest.php @@ -127,8 +127,6 @@ ORDER BY ttrss_feed_categories.title, ttrss_feeds.title, score DESC, date_updated DESC LIMIT $limit"); - $cur_feed_title = ""; - $headlines_count = db_num_rows($result); $headlines = array(); diff --git a/include/feedbrowser.php b/include/feedbrowser.php index d35f1ebf8..8907aa9e4 100644 --- a/include/feedbrowser.php +++ b/include/feedbrowser.php @@ -63,7 +63,7 @@ htmlspecialchars($line["title"]).""; $feed_url = ""; $rv .= "
  • $check_box $feed_url $site_url". @@ -72,7 +72,6 @@ } else if ($mode == 2) { $feed_url = htmlspecialchars($line["feed_url"]); $site_url = htmlspecialchars($line["site_url"]); - $title = htmlspecialchars($line["title"]); $check_box = ""; @@ -92,7 +91,7 @@ htmlspecialchars($line["title"]).""; $feed_url = ""; diff --git a/include/functions.php b/include/functions.php index 8e8832a58..48f6218e1 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1613,7 +1613,6 @@ AND ttrss_counters_cache.feed_id = id"; $result = db_query($query); - $fctrs_modified = false; while ($line = db_fetch_assoc($result)) { @@ -2922,7 +2921,6 @@ $fragment = $doc->createDocumentFragment(); $text = $child->textContent; - $stubs = array(); while (($pos = mb_stripos($text, $word)) !== false) { $fragment->appendChild(new DomText(mb_substr($text, 0, $pos))); @@ -3104,19 +3102,16 @@ } function format_warning($msg, $id = "") { - global $link; return "
    $msg
    "; } function format_notice($msg, $id = "") { - global $link; return "
    $msg
    "; } function format_error($msg, $id = "") { - global $link; return "
    $msg
    "; } @@ -3225,8 +3220,6 @@ $line = db_fetch_assoc($result); - $tag_cache = $line["tag_cache"]; - $line["tags"] = get_article_tags($id, $owner_uid, $line["tag_cache"]); unset($line["tag_cache"]); @@ -3382,7 +3375,7 @@ $rv['content'] .= " "; $rv['content'] .= ""; - $rv['content'] .= ""; + $rv['content'] .= ""; $rv['content'] .= "
  • "; } @@ -4268,9 +4261,9 @@ $fetch_last_error = curl_errno($curl) . " " . curl_error($curl); curl_close($curl); - $oline=''; - foreach($status as $key=>$eline){$oline.='['.$key.']'.$eline.' ';} - $line =$oline." \r\n ".$url."\r\n-----------------\r\n"; +# $oline=''; +# foreach($status as $key=>$eline){$oline.='['.$key.']'.$eline.' ';} +# $line =$oline." \r\n ".$url."\r\n-----------------\r\n"; # $handle = @fopen('./curl.error.log', 'a'); # fwrite($handle, $line); return FALSE; diff --git a/include/labels.php b/include/labels.php index 6e0bfcb98..4149864b3 100644 --- a/include/labels.php +++ b/include/labels.php @@ -109,7 +109,7 @@ if (!$label_id) return; - $result = db_query( + db_query( "DELETE FROM ttrss_user_labels2 WHERE label_id = '$label_id' AND -- cgit v1.2.3-54-g00ecf From 34899cf9e87303a5d35d8979b8d790c7a45ea13d Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 22 May 2014 08:10:24 +0000 Subject: add hidden tunable _DISABLE_INACTIVE_FEEDS --- classes/pref/feeds.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'classes/pref/feeds.php') diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php index 7d541ded1..6021978b7 100644 --- a/classes/pref/feeds.php +++ b/classes/pref/feeds.php @@ -1259,13 +1259,18 @@ class Pref_Feeds extends Handler_Protected { $interval_qpart = "DATE_SUB(NOW(), INTERVAL 3 MONTH)"; } - $result = $this->dbh->query("SELECT COUNT(*) AS num_inactive FROM ttrss_feeds WHERE + // could be performance-intensive and prevent feeds pref-panel from showing + if (!defined('_DISABLE_INACTIVE_FEEDS') || !_DISABLE_INACTIVE_FEEDS) { + $result = $this->dbh->query("SELECT COUNT(*) AS num_inactive FROM ttrss_feeds WHERE (SELECT MAX(updated) FROM ttrss_entries, ttrss_user_entries WHERE ttrss_entries.id = ref_id AND ttrss_user_entries.feed_id = ttrss_feeds.id) < $interval_qpart AND ttrss_feeds.owner_uid = ".$_SESSION["uid"]); - $num_inactive = $this->dbh->fetch_result($result, 0, "num_inactive"); + $num_inactive = $this->dbh->fetch_result($result, 0, "num_inactive"); + } else { + $num_inactive = 0; + } if ($num_inactive > 0) { $inactive_button = " - "; diff --git a/css/dijit.css b/css/dijit.css index bd51929a7..eb4f767db 100644 --- a/css/dijit.css +++ b/css/dijit.css @@ -346,6 +346,10 @@ button[disabled], line-height : 20px; } +.claro .dijitButton.small .dijitButtonText { + font-size : 11px; +} + .claro .dijitMenu { border-color : #ccc; } -- cgit v1.2.3-54-g00ecf