From 3a6521f0411daea27dac9525964684915b31f75f Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 24 Jan 2009 06:20:09 +0100 Subject: [PATCH] remove old-style big feed browser --- help/4.php | 8 +- modules/pref-feed-browser.php | 227 ---------------------------------- prefs.js | 76 +----------- prefs.php | 4 +- 4 files changed, 9 insertions(+), 306 deletions(-) delete mode 100644 modules/pref-feed-browser.php diff --git a/help/4.php b/help/4.php index 33879eb2..c7773c9f 100644 --- a/help/4.php +++ b/help/4.php @@ -7,10 +7,10 @@ - - - - + + + +
g 1
g 2
g 3
g 4
g 5
g 6
g 3
g 4
g 5
g x
diff --git a/modules/pref-feed-browser.php b/modules/pref-feed-browser.php deleted file mode 100644 index aa6ef311..00000000 --- a/modules/pref-feed-browser.php +++ /dev/null @@ -1,227 +0,0 @@ -"; - print "".__('Feed information:').""; - - $result = db_query($link, "SELECT - feed_url,site_url, - ".SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated - FROM ttrss_feeds WHERE id = '$id' AND - auth_login = '' AND auth_pass = '' AND private IS NOT true - AND feed_url NOT LIKE '%:%@%/%'"); - - if (db_num_rows($result) == 1) { - - print "
"; - - $feed_url = db_fetch_result($result, 0, "feed_url"); - $site_url = db_fetch_result($result, 0, "site_url"); - $last_updated = db_fetch_result($result, 0, "last_updated"); - - if (get_pref($link, 'HEADLINES_SMART_DATE')) { - $last_updated = smart_date_time(strtotime($last_updated)); - } else { - $short_date = get_pref($link, 'SHORT_DATE_FORMAT'); - $last_updated = date($short_date, strtotime($last_updated)); - } - - print __("Site:")." $site_url ". - "(feed), ". - __("Last updated:")." $last_updated"; - - print "
"; - - $result = db_query($link, "SELECT - ttrss_entries.title, - content,link, - ".SUBSTRING_FOR_DATE."(date_entered,1,19) as date_entered, - ".SUBSTRING_FOR_DATE."(updated,1,19) as updated - FROM ttrss_entries,ttrss_user_entries - WHERE ttrss_entries.id = ref_id AND feed_id = '$id' - ORDER BY updated DESC LIMIT 5"); - - if (db_num_rows($result) > 0) { - - print "".__('Last headlines:')."
"; - - print "
"; - print "
"; - } - } else { - print "

".__("Feed not found.")."

"; - } - - print ""; - - return; - } - - set_pref($link, "_PREFS_ACTIVE_TAB", "feedBrowser"); - - $limit = db_escape_string($_GET["limit"]); - - $browser_search = db_escape_string($_GET["search"]); - - if (array_key_exists("search", $_GET)) { - $_SESSION["prefs_browser_search"] = $browser_search; - } else { - $browser_search = $_SESSION["prefs_browser_search"]; - } - - if (!$limit) $limit = 25; - - $owner_uid = $_SESSION["uid"]; - -/* $result = db_query($link, "SELECT feed_url,COUNT(id) AS subscribers - FROM ttrss_feeds WHERE (SELECT COUNT(id) = 0 FROM ttrss_feeds AS tf - WHERE tf.feed_url = ttrss_feeds.feed_url - AND (private IS true OR feed_url LIKE '%:%@%/%' OR - owner_uid = '$owner_uid')) GROUP BY feed_url - ORDER BY subscribers DESC LIMIT $limit"); */ - - $result = db_query($link, "SELECT COUNT(feed_url) AS cfu FROM - ttrss_feedbrowser_cache"); - - $cfu = db_fetch_result($result, 0, "cfu"); - - if ($cfu == 0) { - print_warning(__("Feed browser cache information is missing. Please refer to the wiki for more information.")); - return; - - } - - /* print "
".__('This panel shows feeds subscribed by other users of this system, just in case you are interested in them too.')."
"; */ - - print "
- - -
"; - - print "
- ".__('Top')." - -
"; - - if ($browser_search) { - $search_qpart = " AND ( - UPPER(ttrss_feedbrowser_cache.feed_url) LIKE UPPER('%$browser_search%') OR - UPPER(title) LIKE UPPER('%$browser_search%'))"; - } else { - $search_qpart = ""; - } - - $result = db_query($link, "SELECT ttrss_feedbrowser_cache.feed_url, - subscribers,title - FROM - ttrss_feedbrowser_cache - WHERE - (SELECT COUNT(id) = 0 FROM ttrss_feeds AS tf - WHERE tf.feed_url = ttrss_feedbrowser_cache.feed_url - AND owner_uid = '$owner_uid') - $search_qpart - ORDER BY subscribers DESC LIMIT $limit"); - - print "
"; - - if (db_num_rows($result) > 0) { - - print "
-
"; - - print ""; - - } - - if ($feedctr == 0) { - print_notice(__("Couldn't find any feeds available for subscription.")); - } - - print ""; - } -?> diff --git a/prefs.js b/prefs.js index b3b88467..78b1d18d 100644 --- a/prefs.js +++ b/prefs.js @@ -1238,8 +1238,6 @@ function selectTab(id, noupdate, subop) { updatePrefsList(); } else if (id == "userConfig") { updateUsersList(); - } else if (id == "feedBrowser") { - updateBigFeedBrowser(); } } @@ -1481,69 +1479,6 @@ function updateBigFeedBrowserBtn() { return updateBigFeedBrowser(); } -function updateBigFeedBrowser(limit, from_button) { - - if (!xmlhttp_ready(xmlhttp)) { - printLockingError(); - return - } - - var query = "backend.php?op=pref-feed-browser"; - - var limit_sel = document.getElementById("feedBrowserLimit"); - - if (limit_sel) { - var limit = limit_sel[limit_sel.selectedIndex].value; - query = query + "&limit=" + param_escape(limit); - } - - var search = document.getElementById("feed_browser_search"); - - if (search) { - query = query + "&search=" + param_escape(search.value); - } - - xmlhttp.open("GET", query, true); - xmlhttp.onreadystatechange=feed_browser_callback; - xmlhttp.send(null); -} - -function browserToggleExpand(id) { - try { -/* if (feed_to_expand && feed_to_expand != id) { - var d = document.getElementById("BRDET-" + feed_to_expand); - d.style.display = "none"; - } */ - - if (!xmlhttp_ready(xmlhttp)) { - printLockingError(); - return - } - -/* if (feed_to_expand && id != feed_to_expand) { - Effect.Fade('BRDET-' + feed_to_expand, {duration : 0.5}); - } */ - - var d = document.getElementById("BRDET-" + id); - - notify_progress("Loading, please wait..."); - - if (Element.visible(d)) { - Effect.Fade(d, {duration : 0.5}); - } else { - feed_to_expand = id; - - xmlhttp.open("GET", "backend.php?op=pref-feed-browser&subop=details&id=" - + param_escape(id), true); - xmlhttp.onreadystatechange=expand_feed_callback; - xmlhttp.send(null); - } - - } catch (e) { - exception_error("browserToggleExpand", e); - } -} - function selectPrefRows(kind, select) { if (kind) { @@ -1768,22 +1703,17 @@ function pref_hotkey_handler(e) { return false; } - if (keycode == 51 && document.getElementById("feedBrowserTab")) { // 3 - selectTab("feedBrowser"); - return false; - } - - if (keycode == 52 && document.getElementById("filterConfigTab")) { // 4 + if (keycode == 51 && document.getElementById("filterConfigTab")) { // 4 selectTab("filterConfig"); return false; } - if (keycode == 53 && document.getElementById("labelConfigTab")) { // 5 + if (keycode == 52 && document.getElementById("labelConfigTab")) { // 5 selectTab("labelConfig"); return false; } - if (keycode == 54 && document.getElementById("userConfigTab")) { // 6 + if (keycode == 53 && document.getElementById("userConfigTab")) { // 6 selectTab("userConfig"); return false; } diff --git a/prefs.php b/prefs.php index 7223b3b3..7ecea90e 100644 --- a/prefs.php +++ b/prefs.php @@ -124,9 +124,9 @@ window.onload = init;
-
- + -->