From 59b8192f946cc44f6e88f2bb904d96dab2187c27 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 26 Feb 2006 15:07:22 +0100 Subject: [PATCH] workaround for Opera cache of feeds/headlines panel; remove addheader param handling --- backend.php | 117 ++++++++++++--------------- feedlist.js | 10 ++- schema/upgrade-1.1.3-1.1.4-mysql.sql | 2 +- tt-rss.js | 6 ++ viewfeed.js | 2 +- 5 files changed, 69 insertions(+), 68 deletions(-) diff --git a/backend.php b/backend.php index da9087f9c..b1b9e61f1 100644 --- a/backend.php +++ b/backend.php @@ -1,7 +1,7 @@ - Tiny Tiny RSS : Article $id - "; + print " + Tiny Tiny RSS : Article $id + "; - $user_theme = $_SESSION["theme"]; - if ($user_theme) { - print ""; - } - - if (get_pref($link, 'USE_COMPACT_STYLESHEET')) { - print ""; - } else { - print ""; - } - - print " - - "; + $user_theme = $_SESSION["theme"]; + if ($user_theme) { + print ""; } + if (get_pref($link, 'USE_COMPACT_STYLESHEET')) { + print ""; + } else { + print ""; + } + + print " + + "; + if ($result) { $line = db_fetch_assoc($result); @@ -1035,9 +1031,7 @@ "; } - if ($addheader) { - print ""; - } + print ""; } if ($op == "viewfeed") { @@ -1046,7 +1040,6 @@ $skip = $_GET["skip"]; $subop = $_GET["subop"]; $view_mode = $_GET["view"]; - $addheader = $_GET["addheader"]; $limit = $_GET["limit"]; if (!$feed) { @@ -1057,42 +1050,40 @@ if ($subop == "undefined") $subop = ""; - if ($addheader) { - print " - Tiny Tiny RSS : Feed $feed - "; + print " + Tiny Tiny RSS : Feed $feed + "; - $user_theme = $_SESSION["theme"]; - if ($user_theme) { - print ""; - } - - if (get_pref($link, 'USE_COMPACT_STYLESHEET')) { - print ""; - - } else { - print ""; - } - - print " - - - - - "; + $user_theme = $_SESSION["theme"]; + if ($user_theme) { + print ""; } + if (get_pref($link, 'USE_COMPACT_STYLESHEET')) { + print ""; + + } else { + print ""; + } + + print " + + + + + "; + if ($subop == "ForceUpdate" && sprintf("%d", $feed) > 0) { /* if (ENABLE_UPDATE_DAEMON) { @@ -1651,9 +1642,7 @@ } '; - if ($addheader) { - print ""; - } + print ""; } if ($op == "pref-rpc") { diff --git a/feedlist.js b/feedlist.js index 7dcb68fa2..5610c2908 100644 --- a/feedlist.js +++ b/feedlist.js @@ -101,8 +101,14 @@ function viewfeed(feed, skip, subop, doc) { var headlines_frame = parent.frames["headlines-frame"]; // alert(headlines_frame) - - headlines_frame.location.href = query + "&addheader=true"; + + if (navigator.userAgent.match("Opera")) { + var date = new Date(); + var timestamp = Math.round(date.getTime() / 1000); + query = query + "&ts=" + timestamp + } + + headlines_frame.location.href = query; cleanSelectedList("feedList"); diff --git a/schema/upgrade-1.1.3-1.1.4-mysql.sql b/schema/upgrade-1.1.3-1.1.4-mysql.sql index a4e2e7ab5..2570bb4ba 100644 --- a/schema/upgrade-1.1.3-1.1.4-mysql.sql +++ b/schema/upgrade-1.1.3-1.1.4-mysql.sql @@ -1,6 +1,6 @@ alter table ttrss_entries add column author varchar(250); -update ttrss_entries set author = ;;; +update ttrss_entries set author = ''; alter table ttrss_entries change author author varchar(250) not null; alter table ttrss_entries alter column author set default ''; diff --git a/tt-rss.js b/tt-rss.js index 3e5ad3a15..63a707ab3 100644 --- a/tt-rss.js +++ b/tt-rss.js @@ -225,6 +225,12 @@ function updateFeedList(silent, fetch) { query_str = query_str + "&actid=" + getActiveFeedId(); } + if (navigator.userAgent.match("Opera")) { + var date = new Date(); + var timestamp = Math.round(date.getTime() / 1000); + query_str = query_str + "&ts=" + timestamp + } + if (fetch) query_str = query_str + "&fetch=yes"; var feeds_frame = document.getElementById("feeds-frame"); diff --git a/viewfeed.js b/viewfeed.js index 1f0d4d283..06a483bcc 100644 --- a/viewfeed.js +++ b/viewfeed.js @@ -70,7 +70,7 @@ function view(id, feed_id) { var content = m_document.getElementById("content-frame"); if (content) { - content.src = "backend.php?op=view&addheader=true&id=" + param_escape(id) + + content.src = "backend.php?op=view&id=" + param_escape(id) + "&feed=" + param_escape(feed_id); markHeadline(active_post_id); }