From a06b79c433823e69fbbe88efa9d453b643505809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= 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') 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 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') 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 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 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'include') 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 /** -- cgit v1.2.3 From b3092a2a4324cfe5e7b6e8528093a3eea133112a Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 21 Mar 2013 15:11:03 +0400 Subject: update translations --- include/localized_schema.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/localized_schema.php b/include/localized_schema.php index 2f5903dc7..a67e535ab 100644 --- a/include/localized_schema.php +++ b/include/localized_schema.php @@ -1,4 +1,4 @@ - Date: Thu, 21 Mar 2013 15:37:08 +0400 Subject: make sure rendering image enclosures respect hide_image setting --- include/functions.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'include') 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 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 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') 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( -- cgit v1.2.3 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 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include') 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; + } + ?> -- cgit v1.2.3 From 029591964885e4a9010838cd9ae9824267dc63fc Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 21 Mar 2013 21:42:11 +0400 Subject: attempt fix db_escape_string() invocation in sessions.php --- include/db.php | 10 +++++++--- include/sessions.php | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/db.php b/include/db.php index f1a7af363..17437142b 100644 --- a/include/db.php +++ b/include/db.php @@ -41,13 +41,17 @@ function db_connect($host, $user, $pass, $db) { } } -function db_escape_string($s, $strip_tags = true) { +function db_escape_string($s, $strip_tags = true, $link = NULL) { if ($strip_tags) $s = strip_tags($s); if (DB_TYPE == "pgsql") { - return pg_escape_string($s); + if ($link) { + return pg_escape_string($link, $s); + } else { + return pg_escape_string($s); + } } else { - return mysql_real_escape_string($s); + return mysql_real_escape_string($s, $link); } } diff --git a/include/sessions.php b/include/sessions.php index 2cef1d91b..7d9b19bd5 100644 --- a/include/sessions.php +++ b/include/sessions.php @@ -53,7 +53,7 @@ $expire = time() + $session_expire; - $data = db_escape_string(base64_encode($data), $session_connection); + $data = db_escape_string(base64_encode($data), false, $session_connection); if ($session_read) { $query = "UPDATE ttrss_sessions SET data='$data', -- cgit v1.2.3 From 82ac5311549e41893d1430c5090a1d1a925c0c20 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 21 Mar 2013 21:45:00 +0400 Subject: fix #2 for mysql escape string --- include/db.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/db.php b/include/db.php index 17437142b..0f4bf3708 100644 --- a/include/db.php +++ b/include/db.php @@ -51,7 +51,11 @@ function db_escape_string($s, $strip_tags = true, $link = NULL) { return pg_escape_string($s); } } else { - return mysql_real_escape_string($s, $link); + if ($link) { + return mysql_real_escape_string($s, $link); + } else { + return mysql_real_escape_string($s); + } } } -- cgit v1.2.3 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 ----- 1 file changed, 5 deletions(-) (limited to 'include') 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", -- cgit v1.2.3 From 5c81e817d342d8a8d806c850b0f3ed051e923661 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 21 Mar 2013 21:52:20 +0400 Subject: enable mysql db session support --- include/sessions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/sessions.php b/include/sessions.php index 7d9b19bd5..92e346afe 100644 --- a/include/sessions.php +++ b/include/sessions.php @@ -96,7 +96,7 @@ db_query($session_connection, $query); } - if (!SINGLE_USER_MODE && DB_TYPE == "pgsql") { + if (!SINGLE_USER_MODE /* && DB_TYPE == "pgsql" */) { session_set_save_handler("ttrss_open", "ttrss_close", "ttrss_read", "ttrss_write", "ttrss_destroy", "ttrss_gc"); -- cgit v1.2.3