]> git.wh0rd.org Git - tt-rss.git/commitdiff
workaround for Opera cache of feeds/headlines panel; remove addheader param handling
authorAndrew Dolgov <fox@bah.spb.su>
Sun, 26 Feb 2006 14:07:22 +0000 (15:07 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sun, 26 Feb 2006 14:07:22 +0000 (15:07 +0100)
backend.php
feedlist.js
schema/upgrade-1.1.3-1.1.4-mysql.sql
tt-rss.js
viewfeed.js

index da9087f9c17f78181e55e3fbad9608c57efb3bc6..b1b9e61f15c7c854ca36d0bab7ec8ad936c4dc02 100644 (file)
@@ -1,7 +1,7 @@
 <?
        session_start();
 
-       header("Cache-Control: no-cache");
+       header("Cache-Control: no-cache, must-revalidate");
        header("Pragma: no-cache");
        header("Expires: -1");
        
                        SET unread = false,last_read = NOW() 
                        WHERE ref_id = '$id' AND feed_id = '$feed_id' AND owner_uid = " . $_SESSION["uid"]);
 
-               $addheader = $_GET["addheader"];
-
                $result = db_query($link, "SELECT title,link,content,feed_id,comments,int_id,
                        SUBSTRING(updated,1,16) as updated,
                        (SELECT icon_url FROM ttrss_feeds WHERE id = feed_id) as icon_url,
                        FROM ttrss_entries,ttrss_user_entries
                        WHERE   id = '$id' AND ref_id = id");
 
-               if ($addheader) {
-                       print "<html><head>
-                               <title>Tiny Tiny RSS : Article $id</title>
-                               <link rel=\"stylesheet\" href=\"tt-rss.css\" type=\"text/css\">";
-
-                       $user_theme = $_SESSION["theme"];
-                       if ($user_theme) { 
-                               print "<link rel=\"stylesheet\" type=\"text/css\" 
-                                       href=\"themes/$user_theme/theme.css\">";
-                       }
+               print "<html><head>
+                       <title>Tiny Tiny RSS : Article $id</title>
+                       <link rel=\"stylesheet\" href=\"tt-rss.css\" type=\"text/css\">";
 
-                       if (get_pref($link, 'USE_COMPACT_STYLESHEET')) {
-                               print "<link rel=\"stylesheet\" type=\"text/css\" 
-                                       href=\"tt-rss_compact.css\"/>";
-                       } else {
-                               print "<link title=\"Compact Stylesheet\" rel=\"alternate stylesheet\" 
-                                               type=\"text/css\" href=\"tt-rss_compact.css\"/>";
-                       }
+               $user_theme = $_SESSION["theme"];
+               if ($user_theme) { 
+                       print "<link rel=\"stylesheet\" type=\"text/css\" 
+                               href=\"themes/$user_theme/theme.css\">";
+               }
 
-                       print "<script type=\"text/javascript\" src=\"functions.js\"></script>
-                               <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
-                               </head><body>";
+               if (get_pref($link, 'USE_COMPACT_STYLESHEET')) {
+                       print "<link rel=\"stylesheet\" type=\"text/css\" 
+                               href=\"tt-rss_compact.css\"/>";
+               } else {
+                       print "<link title=\"Compact Stylesheet\" rel=\"alternate stylesheet\" 
+                                       type=\"text/css\" href=\"tt-rss_compact.css\"/>";
                }
 
+               print "<script type=\"text/javascript\" src=\"functions.js\"></script>
+                       <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
+                       </head><body>";
+
                if ($result) {
 
                        $line = db_fetch_assoc($result);
                        </script>";
                }
 
-               if ($addheader) {
-                       print "</body></html>";
-               }
+               print "</body></html>";
        }
 
        if ($op == "viewfeed") {
                $skip = $_GET["skip"];
                $subop = $_GET["subop"];
                $view_mode = $_GET["view"];
-               $addheader = $_GET["addheader"];
                $limit = $_GET["limit"];
 
                if (!$feed) {
 
                if ($subop == "undefined") $subop = "";
 
-               if ($addheader) {
-                       print "<html><head>
-                               <title>Tiny Tiny RSS : Feed $feed</title>
-                               <link rel=\"stylesheet\" href=\"tt-rss.css\" type=\"text/css\">";
-
-                       $user_theme = $_SESSION["theme"];
-                       if ($user_theme) { 
-                               print "<link rel=\"stylesheet\" type=\"text/css\" 
-                                       href=\"themes/$user_theme/theme.css\">";
-                       }
+               print "<html><head>
+                       <title>Tiny Tiny RSS : Feed $feed</title>
+                       <link rel=\"stylesheet\" href=\"tt-rss.css\" type=\"text/css\">";
 
-                       if (get_pref($link, 'USE_COMPACT_STYLESHEET')) {
-                               print "<link rel=\"stylesheet\" 
-                                               type=\"text/css\" href=\"tt-rss_compact.css\"/>";
+               $user_theme = $_SESSION["theme"];
+               if ($user_theme) { 
+                       print "<link rel=\"stylesheet\" type=\"text/css\" 
+                               href=\"themes/$user_theme/theme.css\">";
+               }
 
-                       } else {
-                               print "<link title=\"Compact Stylesheet\" rel=\"alternate stylesheet\" 
-                                               type=\"text/css\" href=\"tt-rss_compact.css\"/>";
-                       }
+               if (get_pref($link, 'USE_COMPACT_STYLESHEET')) {
+                       print "<link rel=\"stylesheet\" 
+                                       type=\"text/css\" href=\"tt-rss_compact.css\"/>";
 
-                       print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">  
-                               <script type=\"text/javascript\" src=\"functions.js\"></script>
-                               <script type=\"text/javascript\" src=\"viewfeed.js\"></script>
-                               <!--[if gte IE 5.5000]>
-                               <script type=\"text/javascript\" src=\"pngfix.js\"></script>
-                               <link rel=\"stylesheet\" type=\"text/css\" href=\"tt-rss-ie.css\">
-                               <![endif]-->
-                               </head><body>
-                               <script type=\"text/javascript\">
-                               if (document.addEventListener) {
-                                       document.addEventListener(\"DOMContentLoaded\", init, null);
-                               }
-                               window.onload = init;
-                               </script>";
+               } else {
+                       print "<link title=\"Compact Stylesheet\" rel=\"alternate stylesheet\" 
+                                       type=\"text/css\" href=\"tt-rss_compact.css\"/>";
                }
 
+               print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">  
+                       <script type=\"text/javascript\" src=\"functions.js\"></script>
+                       <script type=\"text/javascript\" src=\"viewfeed.js\"></script>
+                       <!--[if gte IE 5.5000]>
+                       <script type=\"text/javascript\" src=\"pngfix.js\"></script>
+                       <link rel=\"stylesheet\" type=\"text/css\" href=\"tt-rss-ie.css\">
+                       <![endif]-->
+                       </head><body>
+                       <script type=\"text/javascript\">
+                       if (document.addEventListener) {
+                               document.addEventListener(\"DOMContentLoaded\", init, null);
+                       }
+                       window.onload = init;
+                       </script>";
+
                if ($subop == "ForceUpdate" && sprintf("%d", $feed) > 0) {
 
 /*                     if (ENABLE_UPDATE_DAEMON) {
                                }
                        </script>';
 
-               if ($addheader) {
-                       print "</body></html>";
-               }
+               print "</body></html>";
        }
 
        if ($op == "pref-rpc") {
index 7dcb68fa200e4548fbd09394e314c07706410905..5610c29088bb5285df26b2aaeec6ef723b963393 100644 (file)
@@ -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");
        
index a4e2e7ab55543852d850c21ef9885012865593ee..2570bb4bad1fe09b94c6e112205d07b98ea00faf 100644 (file)
@@ -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 '';
index 3e5ad3a150cf37cf0c604bbfc1b8dcae685a8644..63a707ab3142a18f43ee3c3b44bfa1a1ecf35582 100644 (file)
--- 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");
index 1f0d4d283541a651a43721b21997c1cc858877e7..06a483bccd80556af8b709530b79562f79c613be 100644 (file)
@@ -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);
        }