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') 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 afa1a260d0c47ddb44225786fb3ed892a0a0b428 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 26 Jun 2013 02:17:49 +0400 Subject: fix inverse status not being set correctly for filters when creating them fix inverse rules not being saved/restored properly through opml --- classes/opml.php | 6 ++++-- classes/pref/filters.php | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'classes/pref') diff --git a/classes/opml.php b/classes/opml.php index c5d14cdde..e9a07bb52 100644 --- a/classes/opml.php +++ b/classes/opml.php @@ -190,6 +190,7 @@ class Opml extends Handler_Protected { } $tmp_line["cat_filter"] = sql_bool_to_bool($tmp_line["cat_filter"]); + $tmp_line["inverse"] = sql_bool_to_bool($tmp_line["inverse"]); unset($tmp_line["feed_id"]); unset($tmp_line["cat_id"]); @@ -363,9 +364,10 @@ class Opml extends Handler_Protected { $cat_filter = bool_to_sql_bool($rule["cat_filter"]); $reg_exp = $this->dbh->escape_string($rule["reg_exp"]); $filter_type = (int)$rule["filter_type"]; + $inverse = bool_to_sql_bool($rule["inverse"]); - $this->dbh->query("INSERT INTO ttrss_filters2_rules (feed_id,cat_id,filter_id,filter_type,reg_exp,cat_filter) - VALUES ($feed_id, $cat_id, $filter_id, $filter_type, '$reg_exp', $cat_filter)"); + $this->dbh->query("INSERT INTO ttrss_filters2_rules (feed_id,cat_id,filter_id,filter_type,reg_exp,cat_filter,inverse) + VALUES ($feed_id, $cat_id, $filter_id, $filter_type, '$reg_exp', $cat_filter,$inverse)"); } foreach ($filter["actions"] as $action) { diff --git a/classes/pref/filters.php b/classes/pref/filters.php index bcc7b5aec..6a70e622c 100644 --- a/classes/pref/filters.php +++ b/classes/pref/filters.php @@ -585,14 +585,15 @@ class Pref_Filters extends Handler_Protected { $enabled = checkbox_to_sql_bool($_REQUEST["enabled"]); $match_any_rule = checkbox_to_sql_bool($_REQUEST["match_any_rule"]); $title = $this->dbh->escape_string($_REQUEST["title"]); + $inverse = checkbox_to_sql_bool($_REQUEST["inverse"]); $this->dbh->query("BEGIN"); /* create base filter */ $result = $this->dbh->query("INSERT INTO ttrss_filters2 - (owner_uid, match_any_rule, enabled, title) VALUES - (".$_SESSION["uid"].",$match_any_rule,$enabled, '$title')"); + (owner_uid, match_any_rule, enabled, title, inverse) VALUES + (".$_SESSION["uid"].",$match_any_rule,$enabled, '$title', $inverse)"); $result = $this->dbh->query("SELECT MAX(id) AS id FROM ttrss_filters2 WHERE owner_uid = ".$_SESSION["uid"]); -- cgit v1.2.3-54-g00ecf From 891e36f57e2e3955a4f13019e8fdc58fce826434 Mon Sep 17 00:00:00 2001 From: justauser Date: Thu, 27 Jun 2013 11:18:23 -0400 Subject: Changes to add a new hook: HOOK_QUERY_HEADLINES. An example is provided. --- classes/api.php | 21 +++++++++++++----- classes/feeds.php | 16 +++++++++----- classes/handler/public.php | 22 ++++++++++++++----- classes/pluginhost.php | 1 + classes/pref/filters.php | 9 ++++++-- include/functions.php | 10 +++------ plugins/query_headlines/init.js | 0 plugins/query_headlines/init.php | 47 ++++++++++++++++++++++++++++++++++++++++ 8 files changed, 101 insertions(+), 25 deletions(-) create mode 100644 plugins/query_headlines/init.js create mode 100644 plugins/query_headlines/init.php (limited to 'classes/pref') diff --git a/classes/api.php b/classes/api.php index 23866072f..139a486ee 100644 --- a/classes/api.php +++ b/classes/api.php @@ -636,8 +636,13 @@ class API extends Handler { $feed_title = $qfh_ret[1]; $headlines = array(); - + while ($line = db_fetch_assoc($result)) { + + foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) { + $line = $p->hook_query_headlines($line, 100, true); + } + $is_updated = ($line["last_read"] == "" && ($line["unread"] != "t" && $line["unread"] != "1")); @@ -664,24 +669,27 @@ class API extends Handler { $headline_row['attachments'] = get_article_enclosures( $line['id']); - if ($show_excerpt) { - $excerpt = truncate_string(strip_tags($line["content_preview"]), 100); + if ($show_excerpt ){ + if(isset($line["modified_preview"])) + $excerpt = strip_tags($line["content_preview"]); + else + $excerpt = truncate_string(strip_tags($line["content_preview"]), 100); $headline_row["excerpt"] = $excerpt; } if ($show_content) { if ($line["cached_content"] != "") { - $line["content_preview"] =& $line["cached_content"]; + $line["content"] =& $line["cached_content"]; } if ($sanitize_content) { $headline_row["content"] = sanitize( - $line["content_preview"], + $line["content"], sql_bool_to_bool($line['hide_images']), false, $line["site_url"]); } else { - $headline_row["content"] = $line["content_preview"]; + $headline_row["content"] = $line["content"]; } } @@ -699,6 +707,7 @@ class API extends Handler { $headline_row["always_display_attachments"] = sql_bool_to_bool($line["always_display_enclosures"]); $headline_row["author"] = $line["author"]; + $headline_row["score"] = (int)$line["score"]; foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_RENDER_ARTICLE_API) as $p) { diff --git a/classes/feeds.php b/classes/feeds.php index 83736925c..fd4c7fe53 100644 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -288,6 +288,9 @@ class Feeds extends Handler_Protected { $expand_cdm = get_pref('CDM_EXPANDED'); while ($line = $this->dbh->fetch_assoc($result)) { + foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) { + $line = $p->hook_query_headlines($line, 250); + } $id = $line["id"]; $feed_id = $line["feed_id"]; $label_cache = $line["label_cache"]; @@ -360,9 +363,12 @@ class Feeds extends Handler_Protected { $date_entered_fmt = T_sprintf("Imported at %s", make_local_datetime($line["date_entered"], false)); - if (get_pref('SHOW_CONTENT_PREVIEW')) { - $content_preview = truncate_string(strip_tags($line["content_preview"]), - 250); + if (get_pref('SHOW_CONTENT_PREVIEW') ) { + if(isset($line["modified_preview"])) + $content_preview = strip_tags($line["content_preview"]); + else + $content_preview = truncate_string(strip_tags($line["content_preview"]), + 250); } $score = $line["score"]; @@ -502,7 +508,7 @@ class Feeds extends Handler_Protected { else $tags = false; - $line["content"] = sanitize($line["content_preview"], + $line["content"] = sanitize($line["content"], sql_bool_to_bool($line['hide_images']), false, $entry_site_url); foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_RENDER_ARTICLE_CDM) as $p) { @@ -575,7 +581,7 @@ class Feeds extends Handler_Protected { $excerpt_hidden = "style=\"display : none\""; $reply['content'] .= " - $content_preview"; + id=\"CEXC-$id\" class=\"cdmExcerpt\"> -" . $content_preview . ""; $reply['content'] .= ""; if (!get_pref('VFEED_GROUP_BY_FEED')) { diff --git a/classes/handler/public.php b/classes/handler/public.php index f05beafd2..825ea5e2e 100644 --- a/classes/handler/public.php +++ b/classes/handler/public.php @@ -87,14 +87,20 @@ class Handler_Public extends Handler { $tpl->setVariable('SELF_URL', htmlspecialchars(get_self_url_prefix()), true); while ($line = $this->dbh->fetch_assoc($result)) { + foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) { + $line = $p->hook_query_headlines($line); + } $tpl->setVariable('ARTICLE_ID', htmlspecialchars($line['link']), true); $tpl->setVariable('ARTICLE_LINK', htmlspecialchars($line['link']), true); $tpl->setVariable('ARTICLE_TITLE', htmlspecialchars($line['title']), true); - $tpl->setVariable('ARTICLE_EXCERPT', - truncate_string(strip_tags($line["content_preview"]), 100, '...'), true); + if(isset($line["modified_preview"])) + $tpl->setVariable('ARTICLE_EXCERPT', strip_tags($line["content_preview"]), true); + else + $tpl->setVariable('ARTICLE_EXCERPT', + truncate_string(strip_tags($line["content_preview"]), 100, '...'), true); - $content = sanitize($line["content_preview"], false, $owner_uid); + $content = sanitize($line["content"], false, $owner_uid); if ($line['note']) { $content = "
Article note: " . $line['note'] . "
" . @@ -164,13 +170,19 @@ class Handler_Public extends Handler { $feed['articles'] = array(); while ($line = $this->dbh->fetch_assoc($result)) { + foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) { + $line = $p->hook_query_headlines($line, 100); + } $article = array(); $article['id'] = $line['link']; $article['link'] = $line['link']; $article['title'] = $line['title']; - $article['excerpt'] = truncate_string(strip_tags($line["content_preview"]), 100, '...'); - $article['content'] = sanitize($line["content_preview"], false, $owner_uid); + if(isset($line["modified_preview"])) + $article['excerpt'] = strip_tags($line["content_preview"]); + else + $article['excerpt'] = truncate_string(strip_tags($line["content_preview"]), 100, '...'); + $article['content'] = sanitize($line["content"], false, $owner_uid); $article['updated'] = date('c', strtotime($line["updated"])); if ($line['note']) $article['note'] = $line['note']; diff --git a/classes/pluginhost.php b/classes/pluginhost.php index 53adf01f9..a1bd1b364 100644 --- a/classes/pluginhost.php +++ b/classes/pluginhost.php @@ -37,6 +37,7 @@ class PluginHost { const HOOK_PREFS_EDIT_FEED = 20; const HOOK_PREFS_SAVE_FEED = 21; const HOOK_FETCH_FEED = 22; + const HOOK_QUERY_HEADLINES = 23; const KIND_ALL = 1; const KIND_SYSTEM = 2; diff --git a/classes/pref/filters.php b/classes/pref/filters.php index bcc7b5aec..099c88252 100644 --- a/classes/pref/filters.php +++ b/classes/pref/filters.php @@ -97,12 +97,17 @@ class Pref_Filters extends Handler_Protected { print ""; while ($line = $this->dbh->fetch_assoc($result)) { + foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) { + $line = $p->hook_query_headlines($line, 100); + } $entry_timestamp = strtotime($line["updated"]); $entry_tags = get_article_tags($line["id"], $_SESSION["uid"]); - $content_preview = truncate_string( - strip_tags($line["content_preview"]), 100, '...'); + if(isset($line["modified_preview"])) + $content_preview = strip_tags($line["content_preview"]); + else + $content_preview = truncate_string(strip_tags($line["content_preview"]), 100, '...'); if ($line["feed_title"]) $feed_title = $line["feed_title"]; diff --git a/include/functions.php b/include/functions.php index 355eec2cd..eb011b6db 100644 --- a/include/functions.php +++ b/include/functions.php @@ -71,7 +71,6 @@ "hu_HU" => "Magyar (Hungarian)", "it_IT" => "Italiano", "ja_JP" => "日本語 (Japanese)", - "ko_KR" => "한국어 (Korean)", "lv_LV" => "Latviešu", "nb_NO" => "Norwegian bokmål", "nl_NL" => "Dutch", @@ -1059,7 +1058,7 @@ $date_qpart = "date_entered < DATE_SUB(NOW(), INTERVAL 1 WEEK) "; } break; - case "2week": + case "2weeks": if (DB_TYPE == "pgsql") { $date_qpart = "date_entered < NOW() - INTERVAL '2 week' "; } else { @@ -2579,7 +2578,7 @@ } } - $content_query_part = "content as content_preview, cached_content, "; + $content_query_part = "content, content AS content_preview, cached_content, "; if (is_numeric($feed)) { @@ -2750,13 +2749,10 @@ if ($site_url) { - if ($entry->hasAttribute('href')) { + if ($entry->hasAttribute('href')) $entry->setAttribute('href', rewrite_relative_url($site_url, $entry->getAttribute('href'))); - $entry->setAttribute('rel', 'noreferrer'); - } - if ($entry->hasAttribute('src')) { $src = rewrite_relative_url($site_url, $entry->getAttribute('src')); diff --git a/plugins/query_headlines/init.js b/plugins/query_headlines/init.js new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/query_headlines/init.php b/plugins/query_headlines/init.php new file mode 100644 index 000000000..2c8a402c2 --- /dev/null +++ b/plugins/query_headlines/init.php @@ -0,0 +1,47 @@ +host = $host; + $host->add_hook($host::HOOK_QUERY_HEADLINES, $this); + } + + // passes in the array for an item + // second argument is the length of the preview the caller is using + // create a key called "modified_preview" if you change the preview and don't want + // caller to override with their default + + function hook_query_headlines($line, $preview_length = 100,$api_call=false) { + //make the author field empty + $line["author"] = ""; + + // and toss tags, since I don't use + $line["tag_cache"] = ""; + return $line; + + + } + + + function api_version() { + return 2; + } + +} +?> -- cgit v1.2.3-54-g00ecf From 67631438353273ea260be518e627bc25500e01f2 Mon Sep 17 00:00:00 2001 From: justauser Date: Fri, 28 Jun 2013 10:46:45 -0400 Subject: Changed the implementation of HOOK_QUERY_HEADLINES to deal with issue Fox raised --- classes/api.php | 11 +++-------- classes/feeds.php | 15 +++++---------- classes/handler/public.php | 14 ++++---------- classes/pref/filters.php | 9 +++------ 4 files changed, 15 insertions(+), 34 deletions(-) (limited to 'classes/pref') diff --git a/classes/api.php b/classes/api.php index 139a486ee..aa092df78 100644 --- a/classes/api.php +++ b/classes/api.php @@ -638,7 +638,7 @@ class API extends Handler { $headlines = array(); while ($line = db_fetch_assoc($result)) { - + $line["content_preview"] = truncate_string(strip_tags($line["content_preview"]), 100); foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) { $line = $p->hook_query_headlines($line, 100, true); } @@ -669,13 +669,8 @@ class API extends Handler { $headline_row['attachments'] = get_article_enclosures( $line['id']); - if ($show_excerpt ){ - if(isset($line["modified_preview"])) - $excerpt = strip_tags($line["content_preview"]); - else - $excerpt = truncate_string(strip_tags($line["content_preview"]), 100); - $headline_row["excerpt"] = $excerpt; - } + if (!$show_excerpt ) + $headline_row["excerpt"] = $ine["content_preview"]; if ($show_content) { diff --git a/classes/feeds.php b/classes/feeds.php index b0447fd25..44af9ae0b 100644 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -286,8 +286,9 @@ class Feeds extends Handler_Protected { if ($_REQUEST["debug"]) $timing_info = print_checkpoint("PS", $timing_info); $expand_cdm = get_pref('CDM_EXPANDED'); - + while ($line = $this->dbh->fetch_assoc($result)) { + $line["content_preview"] = "— " . truncate_string(strip_tags($line["content_preview"]),250); foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) { $line = $p->hook_query_headlines($line, 250); } @@ -364,11 +365,7 @@ class Feeds extends Handler_Protected { make_local_datetime($line["date_entered"], false)); if (get_pref('SHOW_CONTENT_PREVIEW') ) { - if(isset($line["modified_preview"])) - $content_preview = " — " . strip_tags($line["content_preview"]); - else - $content_preview = " — " . truncate_string(strip_tags($line["content_preview"]), - 250); + $content_preview = $line["content_preview"]; } $score = $line["score"]; @@ -461,9 +458,7 @@ class Feeds extends Handler_Protected { truncate_string($line["title"], 200); if (get_pref('SHOW_CONTENT_PREVIEW')) { - if ($content_preview) { - $reply['content'] .= "$content_preview"; - } + $reply['content'] .= "" . $line["content_preview"] . ""; } $reply['content'] .= ""; @@ -580,7 +575,7 @@ class Feeds extends Handler_Protected { else $excerpt_hidden = "style=\"display : none\""; - $reply['content'] .= "$content_preview"; + $reply['content'] .= "" . $line["content_preview"] . ""; $reply['content'] .= ""; diff --git a/classes/handler/public.php b/classes/handler/public.php index 825ea5e2e..08f35e212 100644 --- a/classes/handler/public.php +++ b/classes/handler/public.php @@ -85,7 +85,7 @@ class Handler_Public extends Handler { } $tpl->setVariable('SELF_URL', htmlspecialchars(get_self_url_prefix()), true); - + $line["content_preview"] = truncate_string(strip_tags($line["content_preview"]), 100, '...'); while ($line = $this->dbh->fetch_assoc($result)) { foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) { $line = $p->hook_query_headlines($line); @@ -94,11 +94,7 @@ class Handler_Public extends Handler { $tpl->setVariable('ARTICLE_ID', htmlspecialchars($line['link']), true); $tpl->setVariable('ARTICLE_LINK', htmlspecialchars($line['link']), true); $tpl->setVariable('ARTICLE_TITLE', htmlspecialchars($line['title']), true); - if(isset($line["modified_preview"])) - $tpl->setVariable('ARTICLE_EXCERPT', strip_tags($line["content_preview"]), true); - else - $tpl->setVariable('ARTICLE_EXCERPT', - truncate_string(strip_tags($line["content_preview"]), 100, '...'), true); + $tpl->setVariable('ARTICLE_EXCERPT', $line["content_preview"], true); $content = sanitize($line["content"], false, $owner_uid); @@ -170,6 +166,7 @@ class Handler_Public extends Handler { $feed['articles'] = array(); while ($line = $this->dbh->fetch_assoc($result)) { + $line["content_preview"]] = truncate_string(strip_tags($line["content_preview"]), 100, '...'); foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) { $line = $p->hook_query_headlines($line, 100); } @@ -178,10 +175,7 @@ class Handler_Public extends Handler { $article['id'] = $line['link']; $article['link'] = $line['link']; $article['title'] = $line['title']; - if(isset($line["modified_preview"])) - $article['excerpt'] = strip_tags($line["content_preview"]); - else - $article['excerpt'] = truncate_string(strip_tags($line["content_preview"]), 100, '...'); + $article['excerpt'] = $line["content_preview"]; $article['content'] = sanitize($line["content"], false, $owner_uid); $article['updated'] = date('c', strtotime($line["updated"])); diff --git a/classes/pref/filters.php b/classes/pref/filters.php index 63318033e..5d19a5556 100644 --- a/classes/pref/filters.php +++ b/classes/pref/filters.php @@ -95,7 +95,7 @@ class Pref_Filters extends Handler_Protected { print "
"; print "
"; - + $line["content_preview"] = strip_tags($line["content_preview"]), 100, '...'); while ($line = $this->dbh->fetch_assoc($result)) { foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) { $line = $p->hook_query_headlines($line, 100); @@ -104,10 +104,7 @@ class Pref_Filters extends Handler_Protected { $entry_timestamp = strtotime($line["updated"]); $entry_tags = get_article_tags($line["id"], $_SESSION["uid"]); - if(isset($line["modified_preview"])) - $content_preview = strip_tags($line["content_preview"]); - else - $content_preview = truncate_string(strip_tags($line["content_preview"]), 100, '...'); + $content_preview = $line["content_preview"]; if ($line["feed_title"]) $feed_title = $line["feed_title"]; @@ -123,7 +120,7 @@ class Pref_Filters extends Handler_Protected { print " ("; print "" . $feed_title . ""; print "): "; - print "" . $content_preview . ""; + print "" . $line["content_preview"] . ""; print " " . mb_substr($line["date_entered"], 0, 16); print ""; -- cgit v1.2.3-54-g00ecf From 2f20dd58d277d0ec5e4898feed0f530479a0c831 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 10 Jul 2013 13:09:12 +0400 Subject: integrate silk icons by Mark James --- README.md | 2 + classes/feeds.php | 14 +-- classes/pref/prefs.php | 8 +- classes/pref/users.php | 2 +- css/prefs.css | 8 ++ css/tt-rss.css | 35 ++++---- css/utility.css | 2 +- images/alert.png | Bin 340 -> 701 bytes images/alert.svg | 87 ------------------- images/archive.png | Bin 213 -> 555 bytes images/close_notify.svg | 76 ----------------- images/collapse.png | Bin 186 -> 317 bytes images/cross.png | Bin 0 -> 655 bytes images/feed.png | Bin 0 -> 691 bytes images/filter.png | Bin 0 -> 586 bytes images/folder.png | Bin 0 -> 537 bytes images/fresh.png | Bin 251 -> 633 bytes images/information.png | Bin 0 -> 778 bytes images/label.png | Bin 387 -> 586 bytes images/mark_set.png | Bin 0 -> 670 bytes images/mark_set.svg | 73 ---------------- images/mark_unset.png | Bin 0 -> 610 bytes images/mark_unset.svg | 76 ----------------- images/new_version.png | Bin 141 -> 372 bytes images/plugin.png | Bin 0 -> 591 bytes images/plugin_disabled.png | Bin 0 -> 347 bytes images/pub_set.png | Bin 0 -> 691 bytes images/pub_set.svg | 184 ---------------------------------------- images/pub_unset.png | Bin 0 -> 718 bytes images/pub_unset.svg | 149 -------------------------------- images/recently_read.png | Bin 1281 -> 0 bytes images/score_half_high.png | Bin 205 -> 295 bytes images/score_half_low.png | Bin 181 -> 211 bytes images/score_high.png | Bin 190 -> 295 bytes images/score_low.png | Bin 168 -> 211 bytes images/score_neutral.png | Bin 172 -> 201 bytes images/sign_excl.svg | 80 ----------------- images/sign_info.svg | 83 ------------------ images/star.png | Bin 0 -> 670 bytes images/tag.png | Bin 372 -> 594 bytes images/time.png | Bin 0 -> 793 bytes images/user.png | Bin 0 -> 741 bytes include/functions.php | 14 +-- install/index.php | 4 +- js/PrefFilterTree.js | 8 ++ js/PrefLabelTree.js | 4 +- js/functions.js | 2 +- plugins/close_button/button.png | Bin 3643 -> 655 bytes plugins/mail/mail.png | Bin 192 -> 641 bytes plugins/mailto/mail.png | Bin 254 -> 821 bytes plugins/mark_button/init.php | 2 +- plugins/note/note.png | Bin 159 -> 500 bytes plugins/share/share.png | Bin 3639 -> 343 bytes 53 files changed, 61 insertions(+), 852 deletions(-) delete mode 100644 images/alert.svg delete mode 100644 images/close_notify.svg create mode 100644 images/cross.png create mode 100644 images/feed.png create mode 100644 images/filter.png create mode 100644 images/folder.png create mode 100644 images/information.png create mode 100644 images/mark_set.png delete mode 100644 images/mark_set.svg create mode 100644 images/mark_unset.png delete mode 100644 images/mark_unset.svg create mode 100644 images/plugin.png create mode 100644 images/plugin_disabled.png create mode 100644 images/pub_set.png delete mode 100644 images/pub_set.svg create mode 100644 images/pub_unset.png delete mode 100644 images/pub_unset.svg delete mode 100644 images/recently_read.png delete mode 100644 images/sign_excl.svg delete mode 100644 images/sign_info.svg create mode 100644 images/star.png create mode 100644 images/time.png create mode 100644 images/user.png (limited to 'classes/pref') diff --git a/README.md b/README.md index 3aeea3319..469184c87 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ Licensed under GNU GPL version 2 Copyright (c) 2005 Andrew Dolgov (unless explicitly stated otherwise). +Uses Silk icons by Mark James: http://www.famfamfam.com/lab/icons/silk/ + ## Requirements * Compatible web browser (http://tt-rss.org/wiki/CompatibleBrowsers) diff --git a/classes/feeds.php b/classes/feeds.php index b15875bd3..89b2f7128 100644 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -74,7 +74,7 @@ class Feeds extends Handler_Protected { - "; + "; $reply .= ""; @@ -323,24 +323,24 @@ class Feeds extends Handler_Protected { if (sql_bool_to_bool($line["marked"])) { $marked_pic = "\"Unstar"; $class .= " marked"; } else { $marked_pic = "\"Star"; } if (sql_bool_to_bool($line["published"])) { - $published_pic = "\"Unpublish"; $class .= " published"; } else { - $published_pic = "\"Publish"; } @@ -395,7 +395,7 @@ class Feeds extends Handler_Protected { if ($has_feed_icon) { $feed_icon_img = "\"\""; } else { - $feed_icon_img = "\"\""; + $feed_icon_img = "\"\""; } $entry_site_url = $line["site_url"]; @@ -638,7 +638,7 @@ class Feeds extends Handler_Protected { $reply['content'] .= " "; $reply['content'] .= ""; - $reply['content'] .= ""; + $reply['content'] .= ""; $reply['content'] .= ""; } diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php index 32071e3b3..3dfe95241 100644 --- a/classes/pref/prefs.php +++ b/classes/pref/prefs.php @@ -765,7 +765,9 @@ class Pref_Prefs extends Handler_Protected { dojoType=\"dijit.form.CheckBox\" $checked type=\"checkbox\">"; - print ""; + $plugin_icon = $checked ? "plugin.png" : "plugin_disabled.png"; + + print ""; print ""; - print ""; + print ""; print ""; + print ""; if (!$line["email"]) $line["email"] = " "; diff --git a/css/prefs.css b/css/prefs.css index 1cc8b7b03..502a53be9 100644 --- a/css/prefs.css +++ b/css/prefs.css @@ -98,6 +98,14 @@ table.prefPluginsList td label, table.prefUserList td { cursor : pointer; } +table.prefPluginsList label { + white-space : nowrap; +} + +table.prefPluginsList label img { + vertical-align : middle; +} + table.prefErrorLog tr.errrow td { font-size : 10px; } diff --git a/css/tt-rss.css b/css/tt-rss.css index bdf1bf72a..94bc5826c 100644 --- a/css/tt-rss.css +++ b/css/tt-rss.css @@ -299,7 +299,7 @@ div.error { } div.warning img, div.notice img, div.error img { - margin-right : 4px; + margin : 4px; vertical-align : middle; } @@ -660,29 +660,18 @@ div.dlgButtons { } span.labelColorIndicator { - height : 14px; - width : 14px; + height : 16px; + width : 16px; + border-radius : 4px; line-height : 14px; + vertical-align : middle; font-size : 9px; display : inline-block; - border : 1px solid black; - background-color : #fff7d5; - color : #063064; - text-align : center; - margin-right : 2px; -} - -span.labelColorIndicator2 { - height : 14px; - width : 14px; - font-size : 9px; - display : inline-block; - border : 1px solid black; + border : 1px solid #ccc; background-color : #fff7d5; color : #063064; text-align : center; - margin-right : 2px; - vertical-align : bottom; + box-shadow : 0px 0px 1px 0px rgba(0,0,0,0.1); } div#cmdline { @@ -894,6 +883,7 @@ div.fatalError textarea { img.feedIcon, img.tinyFeedIcon { width : 16px; height : 16px; + line-height : 16px; vertical-align : middle; display : inline-block; } @@ -1070,6 +1060,11 @@ div.hl.active { margin-right : 25px; } +#feedTree img.feedIcon { + position : relative; + top : -2px; +} + body#ttrssMain #feedTree .dijitTreeRow { padding : 2px 0px 2px; height : 22px; @@ -1078,8 +1073,8 @@ body#ttrssMain #feedTree .dijitTreeRow { color : #333; } -.dijitFolderClosed, -.dijitFolderOpened { +body#ttrssMain #feedTree .dijitFolderClosed, +body#ttrssMain #feedTree .dijitFolderOpened { display : none; } diff --git a/css/utility.css b/css/utility.css index 029fa9cb3..f342223e3 100644 --- a/css/utility.css +++ b/css/utility.css @@ -86,7 +86,7 @@ div.error { } div.warning img, div.notice img, div.error img { - margin-right : 4px; + margin : 4px; vertical-align : middle; } diff --git a/images/alert.png b/images/alert.png index 9687c4cf1..c37bd062e 100644 Binary files a/images/alert.png and b/images/alert.png differ diff --git a/images/alert.svg b/images/alert.svg deleted file mode 100644 index 237f66caf..000000000 --- a/images/alert.svg +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - ! - - diff --git a/images/archive.png b/images/archive.png index 1afa254f7..8443c23eb 100644 Binary files a/images/archive.png and b/images/archive.png differ diff --git a/images/close_notify.svg b/images/close_notify.svg deleted file mode 100644 index b3a17e02e..000000000 --- a/images/close_notify.svg +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/images/collapse.png b/images/collapse.png index 5adbd5e1c..79b344645 100644 Binary files a/images/collapse.png and b/images/collapse.png differ diff --git a/images/cross.png b/images/cross.png new file mode 100644 index 000000000..1514d51a3 Binary files /dev/null and b/images/cross.png differ diff --git a/images/feed.png b/images/feed.png new file mode 100644 index 000000000..315c4f4fa Binary files /dev/null and b/images/feed.png differ diff --git a/images/filter.png b/images/filter.png new file mode 100644 index 000000000..9757fc6ed Binary files /dev/null and b/images/filter.png differ diff --git a/images/folder.png b/images/folder.png new file mode 100644 index 000000000..784e8fa48 Binary files /dev/null and b/images/folder.png differ diff --git a/images/fresh.png b/images/fresh.png index f5b741a19..b7bfcd15f 100644 Binary files a/images/fresh.png and b/images/fresh.png differ diff --git a/images/information.png b/images/information.png new file mode 100644 index 000000000..12cd1aef9 Binary files /dev/null and b/images/information.png differ diff --git a/images/label.png b/images/label.png index aea67c4fd..83d12924f 100644 Binary files a/images/label.png and b/images/label.png differ diff --git a/images/mark_set.png b/images/mark_set.png new file mode 100644 index 000000000..b88c85789 Binary files /dev/null and b/images/mark_set.png differ diff --git a/images/mark_set.svg b/images/mark_set.svg deleted file mode 100644 index 1942d14c2..000000000 --- a/images/mark_set.svg +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - image/svg+xml - - - - - - - - diff --git a/images/mark_unset.png b/images/mark_unset.png new file mode 100644 index 000000000..537e2f0c0 Binary files /dev/null and b/images/mark_unset.png differ diff --git a/images/mark_unset.svg b/images/mark_unset.svg deleted file mode 100644 index 4b31d31c4..000000000 --- a/images/mark_unset.svg +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - diff --git a/images/new_version.png b/images/new_version.png index 878f7a4fb..1ebb19324 100644 Binary files a/images/new_version.png and b/images/new_version.png differ diff --git a/images/plugin.png b/images/plugin.png new file mode 100644 index 000000000..6187b15ae Binary files /dev/null and b/images/plugin.png differ diff --git a/images/plugin_disabled.png b/images/plugin_disabled.png new file mode 100644 index 000000000..f4f6be59c Binary files /dev/null and b/images/plugin_disabled.png differ diff --git a/images/pub_set.png b/images/pub_set.png new file mode 100644 index 000000000..315c4f4fa Binary files /dev/null and b/images/pub_set.png differ diff --git a/images/pub_set.svg b/images/pub_set.svg deleted file mode 100644 index c13a5c31b..000000000 --- a/images/pub_set.svg +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/images/pub_unset.png b/images/pub_unset.png new file mode 100644 index 000000000..3629d4cb8 Binary files /dev/null and b/images/pub_unset.png differ diff --git a/images/pub_unset.svg b/images/pub_unset.svg deleted file mode 100644 index 7b823fc5e..000000000 --- a/images/pub_unset.svg +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/images/recently_read.png b/images/recently_read.png deleted file mode 100644 index ac1bf1782..000000000 Binary files a/images/recently_read.png and /dev/null differ diff --git a/images/score_half_high.png b/images/score_half_high.png index 205429aba..058ad261f 100644 Binary files a/images/score_half_high.png and b/images/score_half_high.png differ diff --git a/images/score_half_low.png b/images/score_half_low.png index 62da70043..57619706d 100644 Binary files a/images/score_half_low.png and b/images/score_half_low.png differ diff --git a/images/score_high.png b/images/score_high.png index 0ab5c07cb..058ad261f 100644 Binary files a/images/score_high.png and b/images/score_high.png differ diff --git a/images/score_low.png b/images/score_low.png index 7a18affc9..57619706d 100644 Binary files a/images/score_low.png and b/images/score_low.png differ diff --git a/images/score_neutral.png b/images/score_neutral.png index 22d44f8ef..a9af8d44b 100644 Binary files a/images/score_neutral.png and b/images/score_neutral.png differ diff --git a/images/sign_excl.svg b/images/sign_excl.svg deleted file mode 100644 index eb5e6dd20..000000000 --- a/images/sign_excl.svg +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - ! - - diff --git a/images/sign_info.svg b/images/sign_info.svg deleted file mode 100644 index b5a3e9f4d..000000000 --- a/images/sign_info.svg +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - i - - diff --git a/images/star.png b/images/star.png new file mode 100644 index 000000000..b88c85789 Binary files /dev/null and b/images/star.png differ diff --git a/images/tag.png b/images/tag.png index 5fe6596ec..80547e927 100644 Binary files a/images/tag.png and b/images/tag.png differ diff --git a/images/time.png b/images/time.png new file mode 100644 index 000000000..911da3f1d Binary files /dev/null and b/images/time.png differ diff --git a/images/user.png b/images/user.png new file mode 100644 index 000000000..79f35ccbd Binary files /dev/null and b/images/user.png differ diff --git a/include/functions.php b/include/functions.php index bcded7e5f..603a865a1 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1876,19 +1876,19 @@ return "images/archive.png"; break; case -1: - return "images/mark_set.svg"; + return "images/star.png"; break; case -2: - return "images/pub_set.svg"; + return "images/feed.png"; break; case -3: return "images/fresh.png"; break; case -4: - return "images/tag.png"; + return "images/folder.png"; break; case -6: - return "images/recently_read.png"; + return "images/time.png"; break; default: if ($id < LABEL_BASE_INDEX) { @@ -2996,19 +2996,19 @@ function format_warning($msg, $id = "") { global $link; return "
- $msg
"; + $msg"; } function format_notice($msg, $id = "") { global $link; return "
- $msg
"; + $msg"; } function format_error($msg, $id = "") { global $link; return "
- $msg
"; + $msg"; } function print_notice($msg) { diff --git a/install/index.php b/install/index.php index f71a779fa..440954537 100644 --- a/install/index.php +++ b/install/index.php @@ -80,13 +80,13 @@ } function print_error($msg) { - print "
+ print "
$msg
"; } function print_notice($msg) { print "
- $msg
"; + $msg
"; } function db_connect($host, $user, $pass, $db, $type, $port = false) { diff --git a/js/PrefFilterTree.js b/js/PrefFilterTree.js index 4e49075bd..d9391c135 100644 --- a/js/PrefFilterTree.js +++ b/js/PrefFilterTree.js @@ -32,6 +32,14 @@ dojo.declare("fox.PrefFilterTree", lib.CheckBoxTree, { dojo.place(param, tnode.rowNode, 'first'); } + if (this.model.store.getValue(args.item, 'id') != 'root') { + var img = dojo.doc.createElement('img'); + img.src ='images/filter.png'; + img.className = 'markedPic'; + tnode._filterIconNode = img; + dojo.place(tnode._filterIconNode, tnode.labelNode, 'before'); + } + return tnode; }, diff --git a/js/PrefLabelTree.js b/js/PrefLabelTree.js index 05a0c15b6..2f7dc0f53 100644 --- a/js/PrefLabelTree.js +++ b/js/PrefLabelTree.js @@ -22,7 +22,7 @@ dojo.declare("fox.PrefLabelTree", lib.CheckBoxTree, { if (type == 'label') { var span = dojo.doc.createElement('span'); span.innerHTML = 'α'; - span.className = 'labelColorIndicator2'; + span.className = 'labelColorIndicator'; span.id = 'LICID-' + bare_id; span.setStyle({ @@ -38,6 +38,6 @@ dojo.declare("fox.PrefLabelTree", lib.CheckBoxTree, { }, getIconClass: function (item, opened) { return (!item || this.model.mayHaveChildren(item)) ? (opened ? "dijitFolderOpened" : "dijitFolderClosed") : "invisible"; - }, + }, }); diff --git a/js/functions.js b/js/functions.js index 8691c1ee5..b9b3aa44e 100644 --- a/js/functions.js +++ b/js/functions.js @@ -232,7 +232,7 @@ function notify_real(msg, no_hide, n_type) { msg = "" + msg; } - msg += " "; // msg = " " + msg; diff --git a/plugins/close_button/button.png b/plugins/close_button/button.png index b04aed796..1514d51a3 100644 Binary files a/plugins/close_button/button.png and b/plugins/close_button/button.png differ diff --git a/plugins/mail/mail.png b/plugins/mail/mail.png index 4d3fe7751..7348aed77 100644 Binary files a/plugins/mail/mail.png and b/plugins/mail/mail.png differ diff --git a/plugins/mailto/mail.png b/plugins/mailto/mail.png index fcdcbd604..2c49f78a6 100644 Binary files a/plugins/mailto/mail.png and b/plugins/mailto/mail.png differ diff --git a/plugins/mark_button/init.php b/plugins/mark_button/init.php index 971b12932..103475251 100644 --- a/plugins/mark_button/init.php +++ b/plugins/mark_button/init.php @@ -21,7 +21,7 @@ class Mark_Button extends Plugin { if (get_pref("COMBINED_DISPLAY_MODE")) { if (sql_bool_to_bool($line["marked"])) { $marked_pic = "\"Unstar"; } else { diff --git a/plugins/note/note.png b/plugins/note/note.png index 7f9f3fc3f..244e6ca04 100644 Binary files a/plugins/note/note.png and b/plugins/note/note.png differ diff --git a/plugins/share/share.png b/plugins/share/share.png index 3b6398f4a..25eacb7c2 100644 Binary files a/plugins/share/share.png and b/plugins/share/share.png differ -- cgit v1.2.3-54-g00ecf From 06a39024ddf664c9cee2ec2e2e7b47c4c6859df4 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 10 Jul 2013 13:11:40 +0400 Subject: plugin list: fix system plugins image position --- classes/pref/prefs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes/pref') diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php index 3dfe95241..671756f08 100644 --- a/classes/pref/prefs.php +++ b/classes/pref/prefs.php @@ -767,7 +767,7 @@ class Pref_Prefs extends Handler_Protected { $plugin_icon = $checked ? "plugin.png" : "plugin_disabled.png"; - print ""; + print ""; print "
$name $name" . htmlspecialchars($about[1]); if (@$about[4]) { print " — "; + $plugin_icon = $checked ? "plugin.png" : "plugin_disabled.png"; + print ""; if (@$about[4]) { print " — " . $line["login"] . " " . $line["login"] . " $name" . htmlspecialchars($about[1]); if (@$about[4]) { print " — Date: Wed, 10 Jul 2013 20:39:57 +0400 Subject: fix crash in filter preferences --- classes/pref/filters.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'classes/pref') diff --git a/classes/pref/filters.php b/classes/pref/filters.php index 5d19a5556..c4d6fea1d 100644 --- a/classes/pref/filters.php +++ b/classes/pref/filters.php @@ -95,7 +95,9 @@ class Pref_Filters extends Handler_Protected { print "
"; print ""; - $line["content_preview"] = strip_tags($line["content_preview"]), 100, '...'); + + $line["content_preview"] = truncate_string(strip_tags($line["content_preview"]), 100, '...'); + while ($line = $this->dbh->fetch_assoc($result)) { foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) { $line = $p->hook_query_headlines($line, 100); -- 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') 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') 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 74175e6ae31aaab56f45468b3f809cb71d74b48b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 14 Jul 2013 21:55:14 +0400 Subject: fix filter content previews showing html content --- classes/pref/filters.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'classes/pref') diff --git a/classes/pref/filters.php b/classes/pref/filters.php index c4d6fea1d..18d1f383f 100644 --- a/classes/pref/filters.php +++ b/classes/pref/filters.php @@ -96,9 +96,9 @@ class Pref_Filters extends Handler_Protected { print "
"; print "
"; - $line["content_preview"] = truncate_string(strip_tags($line["content_preview"]), 100, '...'); - while ($line = $this->dbh->fetch_assoc($result)) { + $line["content_preview"] = truncate_string(strip_tags($line["content_preview"]), 100, '...'); + foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) { $line = $p->hook_query_headlines($line, 100); } @@ -122,7 +122,7 @@ class Pref_Filters extends Handler_Protected { print " ("; print "" . $feed_title . ""; print "): "; - print "" . $line["content_preview"] . ""; + print "" . $content_preview . ""; print " " . mb_substr($line["date_entered"], 0, 16); print ""; -- cgit v1.2.3-54-g00ecf From e7a40490b8cfaec76b7a6dfc2b109996e6c34032 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 2 Sep 2013 13:54:56 +0400 Subject: filters: add a link to the wiki page to the rule create/edit dialog --- classes/pref/filters.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'classes/pref') diff --git a/classes/pref/filters.php b/classes/pref/filters.php index 18d1f383f..87e63cc2d 100644 --- a/classes/pref/filters.php +++ b/classes/pref/filters.php @@ -875,6 +875,11 @@ class Pref_Filters extends Handler_Protected { print "
"; + print ""; + + print " "; -- cgit v1.2.3-54-g00ecf From bf5bcb8e272feb19103d601d29f17cb9917e95c3 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 29 Nov 2013 13:54:30 +0400 Subject: queryFeedHeadlines: remove obsolete content_preview --- classes/api.php | 2 +- classes/feeds.php | 2 +- classes/handler/public.php | 2 +- classes/pref/filters.php | 2 +- include/functions.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'classes/pref') diff --git a/classes/api.php b/classes/api.php index e3fcc8d3d..8e279521a 100644 --- a/classes/api.php +++ b/classes/api.php @@ -642,7 +642,7 @@ class API extends Handler { $headlines = array(); while ($line = db_fetch_assoc($result)) { - $line["content_preview"] = truncate_string(strip_tags($line["content_preview"]), 100); + $line["content_preview"] = truncate_string(strip_tags($line["content"]), 100); foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) { $line = $p->hook_query_headlines($line, 100, true); } diff --git a/classes/feeds.php b/classes/feeds.php index 2c17a2257..5fc75cb2f 100644 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -292,7 +292,7 @@ class Feeds extends Handler_Protected { $expand_cdm = get_pref('CDM_EXPANDED'); while ($line = $this->dbh->fetch_assoc($result)) { - $line["content_preview"] = "— " . truncate_string(strip_tags($line["content_preview"]), 250); + $line["content_preview"] = "— " . truncate_string(strip_tags($line["content"]), 250); foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) { $line = $p->hook_query_headlines($line, 250, false); diff --git a/classes/handler/public.php b/classes/handler/public.php index 86e58fd68..037e6bf0f 100644 --- a/classes/handler/public.php +++ b/classes/handler/public.php @@ -91,7 +91,7 @@ class Handler_Public extends Handler { $tpl->setVariable('SELF_URL', htmlspecialchars(get_self_url_prefix()), true); while ($line = $this->dbh->fetch_assoc($result)) { - $line["content_preview"] = truncate_string(strip_tags($line["content_preview"]), 100, '...'); + $line["content_preview"] = truncate_string(strip_tags($line["content"]), 100, '...'); foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) { $line = $p->hook_query_headlines($line); diff --git a/classes/pref/filters.php b/classes/pref/filters.php index 87e63cc2d..43da6d04d 100644 --- a/classes/pref/filters.php +++ b/classes/pref/filters.php @@ -97,7 +97,7 @@ class Pref_Filters extends Handler_Protected { print "
"; while ($line = $this->dbh->fetch_assoc($result)) { - $line["content_preview"] = truncate_string(strip_tags($line["content_preview"]), 100, '...'); + $line["content_preview"] = truncate_string(strip_tags($line["content"]), 100, '...'); foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) { $line = $p->hook_query_headlines($line, 100); diff --git a/include/functions.php b/include/functions.php index 28a51b232..f7e910ad3 100644 --- a/include/functions.php +++ b/include/functions.php @@ -2651,7 +2651,7 @@ } - $content_query_part = "content, content AS content_preview, "; + $content_query_part = "content, "; if (is_numeric($feed)) { -- 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') 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') 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 ab85ad89b33b14f30fce17bdfa25877e0d72833e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 19 Jan 2014 00:29:42 +0400 Subject: otp: use application name in provisioning uri --- classes/pref/prefs.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'classes/pref') diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php index 671756f08..3e7d467fa 100644 --- a/classes/pref/prefs.php +++ b/classes/pref/prefs.php @@ -888,7 +888,9 @@ 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($topt->provisioning_uri($login)); + print QRcode::png("otpauth://totp/".urlencode($login). + "?secret=$secret&issuer=".urlencode("Tiny Tiny RSS")); + } } -- 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') 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 b41c5741fef5a3dc93dcf4540c6ee6c1d6fb17e3 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 9 Mar 2014 10:33:41 +0400 Subject: disable OTP on user password reset --- classes/pref/users.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes/pref') diff --git a/classes/pref/users.php b/classes/pref/users.php index 6db7d558b..a5d48ac96 100644 --- a/classes/pref/users.php +++ b/classes/pref/users.php @@ -258,7 +258,7 @@ class Pref_Users extends Handler_Protected { $pwd_hash = encrypt_password($tmp_user_pwd, $new_salt, true); - db_query("UPDATE ttrss_users SET pwd_hash = '$pwd_hash', salt = '$new_salt' + db_query("UPDATE ttrss_users SET pwd_hash = '$pwd_hash', salt = '$new_salt', otp_enabled = false WHERE id = '$uid'"); if ($show_password) { -- cgit v1.2.3-54-g00ecf From 50e04efdc854fc58fab9692f0d6d4b83e60d79c7 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 2 Apr 2014 08:15:33 +0000 Subject: expand filtertree display to make filters easier to distinguish --- classes/pref/filters.php | 40 ++++++++++++++++++++++++++++++++++++++-- css/dijit.css | 22 ++++++++++++++++++++++ include/functions.php | 2 ++ js/PrefFilterTree.js | 8 ++++++++ 4 files changed, 70 insertions(+), 2 deletions(-) (limited to 'classes/pref') diff --git a/classes/pref/filters.php b/classes/pref/filters.php index 2e1e841fc..cfc20e419 100644 --- a/classes/pref/filters.php +++ b/classes/pref/filters.php @@ -147,6 +147,38 @@ class Pref_Filters extends Handler_Protected { } + private function getfilterrules_concise($filter_id) { + $result = $this->dbh->query("SELECT reg_exp, + inverse, + feed_id, + cat_id, + cat_filter, + ttrss_filter_types.description AS field + FROM + ttrss_filters2_rules, ttrss_filter_types + WHERE + filter_id = '$filter_id' AND filter_type = ttrss_filter_types.id"); + + $rv = ""; + + while ($line = $this->dbh->fetch_assoc($result)) { + + $where = sql_bool_to_bool($line["cat_filter"]) ? + getCategoryTitle($line["cat_id"]) : getFeedTitle($line["feed_id"]); + +# $where = $line["cat_id"] . "/" . $line["feed_id"]; + + $inverse = sql_bool_to_bool($line["inverse"]) ? "inverse" : ""; + + $rv .= "" . T_sprintf("%s on %s in %s %s", + strip_tags($line["reg_exp"]), + $line["field"], + $where, + sql_bool_to_bool($line["inverse"]) ? __("(inverse)") : "") . ""; + } + + return $rv; + } function getfiltertree() { $root = array(); @@ -210,6 +242,7 @@ class Pref_Filters extends Handler_Protected { $filter['param'] = $name[1]; $filter['checkbox'] = false; $filter['enabled'] = sql_bool_to_bool($line["enabled"]); + $filter['rules'] = $this->getfilterrules_concise($line['id']); if (!$filter_search || $match_ok) { array_push($folder['items'], $filter); @@ -416,8 +449,11 @@ class Pref_Filters extends Handler_Protected { WHERE id = ".(int)$rule["filter_type"]); $filter_type = $this->dbh->fetch_result($result, 0, "description"); - return T_sprintf("%s on %s in %s %s", strip_tags($rule["reg_exp"]), - $filter_type, $feed, isset($rule["inverse"]) ? __("(inverse)") : ""); + $inverse = isset($rule["inverse"]) ? "inverse" : ""; + + return "" . + T_sprintf("%s on %s in %s %s", strip_tags($rule["reg_exp"]), + $filter_type, $feed, isset($rule["inverse"]) ? __("(inverse)") : "") . ""; } function printRuleName() { diff --git a/css/dijit.css b/css/dijit.css index 9379f9263..bd51929a7 100644 --- a/css/dijit.css +++ b/css/dijit.css @@ -15,6 +15,28 @@ margin-right : 1em; } +.claro .dijitTree .filterRules { + display : block; + color : #ccc; + font-size : 10px; + margin-left : 100px; +} + +.claro .dijitTree .filterRules span { + display : block; + color : green; +} + +#filterDlg_Matches span.filterRule { + color : green; +} + +.claro .dijitTree .filterRules span.inverse, +#filterDlg_Matches span.filterRule.inverse { + color : red; +} + + .claro .dijitTree .labelParam { float : right; margin-right : 1em; diff --git a/include/functions.php b/include/functions.php index 5af20aa14..1390d8185 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1965,6 +1965,8 @@ function getFeedTitle($id, $cat = false) { if ($cat) { return getCategoryTitle($id); + } else if ($id == 0) { + return __("All feeds"); } else if ($id == -1) { return __("Starred articles"); } else if ($id == -2) { diff --git a/js/PrefFilterTree.js b/js/PrefFilterTree.js index d9391c135..7a561c55b 100644 --- a/js/PrefFilterTree.js +++ b/js/PrefFilterTree.js @@ -24,6 +24,7 @@ dojo.declare("fox.PrefFilterTree", lib.CheckBoxTree, { var enabled = this.model.store.getValue(args.item, 'enabled'); var param = this.model.store.getValue(args.item, 'param'); + var rules = this.model.store.getValue(args.item, 'rules'); if (param) { param = dojo.doc.createElement('span'); @@ -32,6 +33,13 @@ dojo.declare("fox.PrefFilterTree", lib.CheckBoxTree, { dojo.place(param, tnode.rowNode, 'first'); } + if (rules) { + param = dojo.doc.createElement('span'); + param.className = 'filterRules'; + param.innerHTML = rules; + dojo.place(param, tnode.rowNode, 'next'); + } + if (this.model.store.getValue(args.item, 'id') != 'root') { var img = dojo.doc.createElement('img'); img.src ='images/filter.png'; -- 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') 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