From 400b60d8c23f41f9db3bf3f910b556448b9d0ccb Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 18 May 2007 07:12:17 +0100 Subject: pref-feeds: add checkbox to toggle last article times info --- modules/pref-feeds.php | 44 +++++++++++++++++++++++++++++++++----------- prefs.js | 13 +++++++++++++ 2 files changed, 46 insertions(+), 11 deletions(-) diff --git a/modules/pref-feeds.php b/modules/pref-feeds.php index 9292ae40c..3f5e2f61f 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 30a8928d7..33b9cc71b 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() +} -- cgit v1.2.3
- ".__('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