From: Andrew Dolgov Date: Fri, 18 May 2007 06:12:17 +0000 (+0100) Subject: pref-feeds: add checkbox to toggle last article times info X-Git-Tag: schema_freeze_for_1.2.11~4 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=400b60d8c23f41f9db3bf3f910b556448b9d0ccb;p=tt-rss.git pref-feeds: add checkbox to toggle last article times info --- diff --git a/modules/pref-feeds.php b/modules/pref-feeds.php index 9292ae40..3f5e2f61 100644 --- a/modules/pref-feeds.php +++ b/modules/pref-feeds.php @@ -799,6 +799,18 @@ $order_by_qpart = "$feeds_sort,title"; } + $show_last_article_info = false; + $show_last_article_checked = ""; + $show_last_article_qpart = ""; + + if ($_GET["slat"] == "true") { + $show_last_article_info = true; + $show_last_article_checked = "checked"; + $show_last_article_qpart = ", (SELECT SUBSTRING(MAX(updated),1,16) FROM ttrss_user_entries, + ttrss_entries WHERE ref_id = ttrss_entries.id + AND feed_id = F1.id) AS last_article"; + } + $result = db_query($link, "SELECT F1.id, F1.title, @@ -812,10 +824,8 @@ F2.title AS parent_title, C1.title AS category, F1.hidden, - F1.include_in_digest, - (SELECT SUBSTRING(MAX(updated),1,16) FROM ttrss_user_entries, - ttrss_entries WHERE ref_id = ttrss_entries.id - AND feed_id = F1.id) AS last_article + F1.include_in_digest + $show_last_article_qpart FROM ttrss_feeds AS F1 LEFT JOIN ttrss_feeds AS F2 @@ -832,8 +842,12 @@ print "

"; - print ""; } - print " - - "; + print ""; + + if ($show_last_article_info) { + print ""; + } + + print ""; $cur_cat_id = $cat_id; } @@ -952,8 +972,10 @@ print ""; - print ""; + if ($show_last_article_info) { + print ""; + } print ""; diff --git a/prefs.js b/prefs.js index 30a8928d..33b9cc71 100644 --- a/prefs.js +++ b/prefs.js @@ -205,8 +205,16 @@ function updateFeedList(sort_key) { var search = ""; if (feed_search) { search = feed_search.value; } + var slat = document.getElementById("show_last_article_times"); + + var slat_checked = false; + if (slat) { + slat_checked = slat.checked; + } + xmlhttp.open("GET", "backend.php?op=pref-feeds" + "&sort=" + param_escape(sort_key) + + "&slat=" + param_escape(slat_checked) + "&search=" + param_escape(search), true); xmlhttp.onreadystatechange=feedlist_callback; xmlhttp.send(null); @@ -1716,3 +1724,8 @@ function changeUserEmail() { return false; } + +function feedlistToggleSLAT() { + notify_progress("Loading, please wait..."); + updateFeedList() +}
- ".__('Select:')." + print "
". + "
". + "
". + __('Select:')." ".__('All').", ".__('None')." "; @@ -904,9 +918,15 @@ print "
 ".__('Title')."".__('Last Article')."".__('Updated')."".__('Title')." + ".__('Last Article')." + ".__('Updated')."" . "$edit_title $parent_title" . "" . - "$last_article" . + "$last_article" . "$last_updated