From a06b79c433823e69fbbe88efa9d453b643505809 Mon Sep 17 00:00:00 2001 From: Tomáš Chvátal Date: Tue, 19 Mar 2013 14:39:08 +0100 Subject: Add basic czech translation ~48% done. --- include/functions.php | 1 + 1 file changed, 1 insertion(+) (limited to 'include/functions.php') diff --git a/include/functions.php b/include/functions.php index 3793e0426..54b565799 100644 --- a/include/functions.php +++ b/include/functions.php @@ -44,6 +44,7 @@ $tr = array( "auto" => "Detect automatically", "ca_CA" => "Català", + "cs_CZ" => "Česky", "en_US" => "English", "es_ES" => "Español", "de_DE" => "Deutsch", -- cgit v1.2.3-54-g00ecf From 94a567df8487faeee752c72ab11b3013d3803253 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 21 Mar 2013 12:12:01 +0400 Subject: fix browsing by tag --- include/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/functions.php') diff --git a/include/functions.php b/include/functions.php index 1a106be0b..ac42a5d77 100644 --- a/include/functions.php +++ b/include/functions.php @@ -2501,7 +2501,7 @@ "label_cache," . "link," . "last_read," . - "hide_images," . + "(SELECT hide_images FROM ttrss_feeds WHERE id = feed_id) AS hide_images," . "last_marked, last_published, " . SUBSTRING_FOR_DATE . "(last_read,1,19) as last_read_noms," . $since_id_part . -- cgit v1.2.3-54-g00ecf From 2191eb7aab7686df01bee88ed18068897ce2912f Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 21 Mar 2013 14:56:04 +0400 Subject: update.php: add support for output logging --- include/functions.php | 18 ++++++++++++++---- update.php | 8 +++++++- 2 files changed, 21 insertions(+), 5 deletions(-) (limited to 'include/functions.php') diff --git a/include/functions.php b/include/functions.php index ac42a5d77..f259a7189 100644 --- a/include/functions.php +++ b/include/functions.php @@ -122,14 +122,24 @@ * @return void */ function _debug($msg) { - if (defined('QUIET') && QUIET) { - return; - } $ts = strftime("%H:%M:%S", time()); if (function_exists('posix_getpid')) { $ts = "$ts/" . posix_getpid(); } - print "[$ts] $msg\n"; + + if (!(defined('QUIET') && QUIET)) { + print "[$ts] $msg\n"; + } + + if (defined('LOGFILE')) { + $fp = fopen(LOGFILE, 'a+'); + + if ($fp) { + fputs($fp, "[$ts] $msg\n"); + fclose($fp); + } + } + } // function _debug /** diff --git a/update.php b/update.php index a92b125e4..9862e1ff2 100755 --- a/update.php +++ b/update.php @@ -29,6 +29,7 @@ "task:", "cleanup-tags", "quiet", + "log:", "indexes", "convert-filters", "force-update", @@ -60,7 +61,6 @@ exit; } - if (count($options) == 0 || isset($options["help"]) ) { print "Tiny Tiny RSS data update script.\n\n"; print "Options:\n"; @@ -70,6 +70,7 @@ print " --task N - create lockfile using this task id\n"; print " --cleanup-tags - perform tags table maintenance\n"; print " --quiet - don't show messages\n"; + print " --log FILE - log messages to FILE\n"; print " --indexes - recreate missing schema indexes\n"; print " --convert-filters - convert type1 filters to type2\n"; print " --force-update - force update of all feeds\n"; @@ -84,6 +85,11 @@ return; } + if (isset($options["log"])) { + _debug("Logging to " . $options["log"]); + define('LOGFILE', $options["log"]); + } + define('QUIET', isset($options['quiet'])); if (!isset($options["daemon"])) { -- cgit v1.2.3-54-g00ecf From 33de3d37af24f870fe2477d5b358e6f4167077b6 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 21 Mar 2013 15:37:08 +0400 Subject: make sure rendering image enclosures respect hide_image setting --- classes/feeds.php | 3 +-- include/functions.php | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) (limited to 'include/functions.php') diff --git a/classes/feeds.php b/classes/feeds.php index 79aaa8e55..b8ef1f544 100644 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -637,8 +637,7 @@ class Feeds extends Handler_Protected { $always_display_enclosures = sql_bool_to_bool($line["always_display_enclosures"]); - $reply['content'] .= format_article_enclosures($this->link, $id, $always_display_enclosures, - $line["content"]); + $reply['content'] .= format_article_enclosures($this->link, $id, $always_display_enclosures, $line["content"], sql_bool_to_bool($line["hide_images"])); $reply['content'] .= ""; diff --git a/include/functions.php b/include/functions.php index 7071765ba..72cca500e 100644 --- a/include/functions.php +++ b/include/functions.php @@ -2952,6 +2952,7 @@ $result = db_query($link, "SELECT id,title,link,content,feed_id,comments,int_id, ".SUBSTRING_FOR_DATE."(updated,1,16) as updated, (SELECT site_url FROM ttrss_feeds WHERE id = feed_id) as site_url, + (SELECT hide_images FROM ttrss_feeds WHERE id = feed_id) as hide_images, num_comments, tag_cache, author, @@ -3133,7 +3134,7 @@ $rv['content'] .= $line["content"]; $rv['content'] .= format_article_enclosures($link, $id, - $always_display_enclosures, $line["content"]); + $always_display_enclosures, $line["content"], $line["hide_images"]); $rv['content'] .= ""; @@ -3596,7 +3597,7 @@ } function format_article_enclosures($link, $id, $always_display_enclosures, - $article_content) { + $article_content, $hide_images = false) { $result = get_article_enclosures($link, $id); $rv = ''; @@ -3646,10 +3647,16 @@ if (preg_match("/image/", $entry["type"]) || preg_match("/\.(jpg|png|gif|bmp)/i", $entry["filename"])) { - $rv .= "

\"".htmlspecialchars($entry["filename"])."\"

"; + if (!$hide_images) { + $rv .= "

\"".htmlspecialchars($entry["filename"])."\"

"; + } else { + $rv .= "

" .htmlspecialchars($entry["url"]) . "

"; + } } } } -- cgit v1.2.3-54-g00ecf From 2ccc7b8e07d584f85e4f5d4477d554de31a15272 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 21 Mar 2013 16:57:36 +0400 Subject: add a e hotkey for embed_original --- include/functions.php | 4 +++- js/tt-rss.js | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'include/functions.php') diff --git a/include/functions.php b/include/functions.php index 72cca500e..3d6b7c89a 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1896,7 +1896,8 @@ "select_article_cursor" => __("Select article under cursor"), "email_article" => __("Email article"), "close_article" => __("Close/collapse article"), - "toggle_widescreen" => __("Toggle widescreen mode")), + "toggle_widescreen" => __("Toggle widescreen mode"), + "toggle_embed_original" => __("Toggle embed original")), __("Article selection") => array( "select_all" => __("Select all articles"), "select_unread" => __("Select unread"), @@ -1959,6 +1960,7 @@ "*(38)|Shift+up" => "article_scroll_up", "*(40)|Shift+down" => "article_scroll_down", "a *w" => "toggle_widescreen", + "a e" => "toggle_embed_original", "e" => "email_article", "a q" => "close_article", // "article_selection" => array( diff --git a/js/tt-rss.js b/js/tt-rss.js index bced92674..77bb5117c 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -786,6 +786,14 @@ function hotkey_handler(e) { case "collapse_sidebar": collapse_feedlist(); return false; + case "toggle_embed_original": + if (typeof embedOriginalArticle != "undefined") { + if (getActiveArticleId()) + embedOriginalArticle(getActiveArticleId()); + } else { + alert(__("Please enable embed_original plugin first.")); + } + return false; case "toggle_widescreen": if (!isCdmMode()) { _widescreen_mode = !_widescreen_mode; -- cgit v1.2.3-54-g00ecf From 16314ddafe88b6c214892799a5da354e2188524c Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 21 Mar 2013 18:01:42 +0400 Subject: implement basic auto-reload on some dependent file timestamp changing --- include/functions.php | 14 ++++++++++++++ js/tt-rss.js | 6 ++++++ 2 files changed, 20 insertions(+) (limited to 'include/functions.php') diff --git a/include/functions.php b/include/functions.php index 3d6b7c89a..aa5575548 100644 --- a/include/functions.php +++ b/include/functions.php @@ -2034,6 +2034,8 @@ $data['last_article_id'] = getLastArticleId($link); $data['cdm_expanded'] = get_pref($link, 'CDM_EXPANDED'); + $data['dep_ts'] = calculate_dep_timestamp(); + if (file_exists(LOCK_DIRECTORY . "/update_daemon.lock")) { $data['daemon_is_running'] = (int) file_is_locked("update_daemon.lock"); @@ -4103,4 +4105,16 @@ echo "\n"; } + function calculate_dep_timestamp() { + $files = array_merge(glob("js/*.js"), glob("*.css")); + + $max_ts = -1; + + foreach ($files as $file) { + if (filemtime($file) > $max_ts) $max_ts = filemtime($file); + } + + return $max_ts; + } + ?> diff --git a/js/tt-rss.js b/js/tt-rss.js index 77bb5117c..ed5e01d4b 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -446,6 +446,12 @@ function parse_runtime_info(data) { return; } + if (k == "dep_ts" && parseInt(getInitParam("dep_ts")) > 0) { + if (parseInt(getInitParam("dep_ts")) < parseInt(v)) { + window.location.reload(); + } + } + if (k == "daemon_is_running" && v != 1) { notify_error("Update daemon is not running.", true); return; -- cgit v1.2.3-54-g00ecf From a60446bed05d0f0cc1e50150ed2a162fccbf908d Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 21 Mar 2013 21:49:52 +0400 Subject: remove sign_* from init params --- include/functions.php | 5 ----- js/functions.js | 6 +++--- 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'include/functions.php') diff --git a/include/functions.php b/include/functions.php index aa5575548..535d47674 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1831,11 +1831,6 @@ function make_init_params($link) { $params = array(); - $params["sign_progress"] = "images/indicator_white.gif"; - $params["sign_progress_tiny"] = "images/indicator_tiny.gif"; - $params["sign_excl"] = "images/sign_excl.svg"; - $params["sign_info"] = "images/sign_info.svg"; - foreach (array("ON_CATCHUP_SHOW_NEXT_FEED", "HIDE_READ_FEEDS", "ENABLE_FEED_CATS", "FEEDS_SORT_BY_UNREAD", "CONFIRM_FEED_CATCHUP", "CDM_AUTO_CATCHUP", "FRESH_ARTICLE_MAX_AGE", "DEFAULT_ARTICLE_LIMIT", diff --git a/js/functions.js b/js/functions.js index 4840bcbe1..db4fedcd5 100644 --- a/js/functions.js +++ b/js/functions.js @@ -201,13 +201,13 @@ function notify_real(msg, no_hide, n_type) { n.className = "notify"; } else if (n_type == 2) { n.className = "notifyProgress"; - msg = " " + msg; + msg = " " + msg; } else if (n_type == 3) { n.className = "notifyError"; - msg = " " + msg; + msg = " " + msg; } else if (n_type == 4) { n.className = "notifyInfo"; - msg = " " + msg; + msg = " " + msg; } // msg = " " + msg; -- cgit v1.2.3-54-g00ecf