From d9fa39f1d444fbd5a909aabe19dfc50aa8601131 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 27 Jan 2007 12:32:59 +0100 Subject: add new version indicator on main chrome --- functions.php | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'functions.php') diff --git a/functions.php b/functions.php index 5f3978ff9..6169f93a8 100644 --- a/functions.php +++ b/functions.php @@ -2133,6 +2133,18 @@ print ""; } + if (CHECK_FOR_NEW_VERSION && $_SESSION["access_level"] >= 10) { + + if ($_SESSION["last_version_check"] + 600 < time()) { + $new_version_details = check_for_update($link); + + print ""; + + $_SESSION["last_version_check"] = time(); + } + } + print ""; } @@ -2595,7 +2607,7 @@ return array($tmp, $headlines_count); } - function check_for_update($link) { + function check_for_update($link, $brief_fmt = true) { $releases_feed = "http://tt-rss.spb.ru/releases.rss"; if (!CHECK_FOR_NEW_VERSION || $_SESSION["access_level"] < 10) { @@ -2625,9 +2637,16 @@ $content = sanitize_rss($latest_item["description"]); if (version_compare(VERSION, $latest_version) == -1) { - return "
- New version of Tiny-Tiny RSS ($latest_version) is available (click for details) -
$content
"; + if ($brief_fmt) { + return "
+ New version of Tiny-Tiny RSS ($latest_version) is available (click for details) +
$content
"; + } else { + return "New version of Tiny-Tiny RSS ($latest_version) is available: +
$content
"; + } + } } } -- cgit v1.2.3-54-g00ecf