]> git.wh0rd.org - tt-rss.git/blobdiff - functions.php
rework article notes; re-add built-in XSL template for generated feeds; remove schema...
[tt-rss.git] / functions.php
index a3e3e8f9746025eab90c2604dcd2e3db83f157a2..e1c60e15f514e6981f07b59415080696a510ea98 100644 (file)
                        return "even";
        }
 
+       // Session caching removed due to causing wrong redirects to upgrade
+       // script when get_schema_version() is called on an obsolete session
+       // created on a previous schema version.
        function get_schema_version($link, $nocache = false) {
-               if (!$_SESSION["schema_version"] || $nocache) {
+//             if (!$_SESSION["schema_version"] || $nocache) {
                        $result = db_query($link, "SELECT schema_version FROM ttrss_version");
                        $version = db_fetch_result($result, 0, "schema_version");
                        $_SESSION["schema_version"] = $version;
                        return $version;
-               } else {
-                       return $_SESSION["schema_version"];
-               }
+//             } else {
+//                     return $_SESSION["schema_version"];
+//             }
        }
 
        function sanity_check($link) {
 
                require_once "lib/MiniTemplator.class.php";
 
-               $note_style =   "float : right; background-color : #fff7d5; border-width : 1px; ".
+               $note_style =   "background-color : #fff7d5;
+                       border-width : 1px; ".
                        "padding : 5px; border-style : dashed; border-color : #e7d796;".
                        "margin-bottom : 1em; color : #9a8c59;";
 
                        $content = sanitize_rss($link, $line["content_preview"], false, $owner_uid);
 
                        if ($line['note']) {
-                               $content = "<div style=\"$note_style\">" . $line['note'] . "</div>" .
+                               $content = "<div style=\"$note_style\">Article note: " . $line['note'] . "</div>" .
                                        $content;
                        }
 
 
                        $rv['content'] .= "</div>";
 
-                       $rv['content'] .= "<div class=\"postIcon\">" .
-                               "<a target=\"_blank\" title=\"".__("Visit the website")."\"$
-                               href=\"".htmlspecialchars($feed_site_url)."\">".
-                               $feed_icon . "</a></div>";
-
                        $rv['content'] .= "<div id=\"POSTNOTE-$id\">";
                                if ($line['note']) {
                                        $rv['content'] .= format_article_note($id, $line['note']);
                                }
                        $rv['content'] .= "</div>";
 
+                       $rv['content'] .= "<div class=\"postIcon\">" .
+                               "<a target=\"_blank\" title=\"".__("Visit the website")."\"$
+                               href=\"".htmlspecialchars($feed_site_url)."\">".
+                               $feed_icon . "</a></div>";
+
                        $rv['content'] .= "<div class=\"postContent\">";
 
                        $article_content = sanitize_rss($link, $line["content"], false, false,
 
        function format_article_note($id, $note) {
 
-               $str = "<div class='articleNote' title=\"".__('edit note')."\"
-                       onclick=\"editArticleNote($id)\">$note</div>";
+               $str = "<div class='articleNote'        onclick=\"editArticleNote($id)\">
+                       <div class='noteEdit' onclick=\"editArticleNote($id)\">".
+                       __('(edit note)')."</div>$note</div>";
 
                return $str;
        }