From fcfa9ef15b641f818f3473d2b60d1c1328aef564 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 19 Apr 2011 13:20:59 +0400 Subject: rework article notes; re-add built-in XSL template for generated feeds; remove schema_version caching in session --- functions.php | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'functions.php') diff --git a/functions.php b/functions.php index a3e3e8f97..e1c60e15f 100644 --- a/functions.php +++ b/functions.php @@ -2360,15 +2360,18 @@ 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) { @@ -3677,7 +3680,8 @@ 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;"; @@ -3729,7 +3733,7 @@ $content = sanitize_rss($link, $line["content_preview"], false, $owner_uid); if ($line['note']) { - $content = "
" . $line['note'] . "
" . + $content = "
Article note: " . $line['note'] . "
" . $content; } @@ -4847,17 +4851,17 @@ $rv['content'] .= ""; - $rv['content'] .= "
" . - "". - $feed_icon . "
"; - $rv['content'] .= "
"; if ($line['note']) { $rv['content'] .= format_article_note($id, $line['note']); } $rv['content'] .= "
"; + $rv['content'] .= "
" . + "". + $feed_icon . "
"; + $rv['content'] .= "
"; $article_content = sanitize_rss($link, $line["content"], false, false, @@ -6367,8 +6371,9 @@ function format_article_note($id, $note) { - $str = "
$note
"; + $str = "
+
". + __('(edit note)')."
$note
"; return $str; } -- cgit v1.2.3-54-g00ecf