From: Andrew Dolgov Date: Wed, 23 Nov 2005 10:47:30 +0000 (+0100) Subject: sortable feed editor X-Git-Tag: schema_feature_freeze_for_1.1~124 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=b83c75451c08569d90aedf7a54b5fa868ec6608e;p=tt-rss.git sortable feed editor --- diff --git a/backend.php b/backend.php index 69559a69..87b4708b 100644 --- a/backend.php +++ b/backend.php @@ -1116,28 +1116,52 @@ type=\"submit\" class=\"button\" onclick=\"javascript:addFeed()\" value=\"Add feed\">"; + $feeds_sort = db_escape_string($_GET["sort"]); + + if (!$feeds_sort || $feeds_sort == "undefined") { + $feeds_sort = $_SESSION["pref_sort_feeds"]; + if (!$feeds_sort) $feeds_sort = "title"; + } + + $_SESSION["pref_sort_feeds"] = $feeds_sort; + $result = db_query($link, "SELECT id,title,feed_url,substring(last_updated,1,16) as last_updated, update_interval,purge_interval, (SELECT title FROM ttrss_feed_categories WHERE id = cat_id) AS category FROM - ttrss_feeds WHERE owner_uid = '".$_SESSION["uid"]."' ORDER by title"); + ttrss_feeds WHERE owner_uid = '".$_SESSION["uid"]."' + ORDER by $feeds_sort,title"); print "
PLACEHOLDER
"; print "

"; print " - - "; + + + + "; if (get_pref($link, 'ENABLE_FEED_CATS')) { - print ""; + print ""; } - print " - - "; + print " + + + + "; $lnum = 0; diff --git a/prefs.js b/prefs.js index 846f6825..04b31383 100644 --- a/prefs.js +++ b/prefs.js @@ -165,8 +165,7 @@ function notify_callback() { } } - -function updateFeedList() { +function updateFeedList(sort_key) { if (!xmlhttp_ready(xmlhttp)) { printLockingError(); @@ -177,7 +176,8 @@ function updateFeedList() { p_notify("Loading, please wait..."); - xmlhttp.open("GET", "backend.php?op=pref-feeds", true); + xmlhttp.open("GET", "backend.php?op=pref-feeds" + + "&sort=" + param_escape(sort_key), true); xmlhttp.onreadystatechange=feedlist_callback; xmlhttp.send(null);
 SelectTitleLink Select + Title + Link + Category + CategoryUpdate IntervalPurge DaysLast updated
+ Update Interval + + Purge Days + + Last updated +