From: Andrew Dolgov Date: Thu, 17 May 2007 13:07:34 +0000 (+0100) Subject: tag cloud improvements X-Git-Tag: schema_freeze_for_1.2.11~14 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=35a03bddc2b2b0ca18bf549a604788afc8f5422c;p=tt-rss.git tag cloud improvements --- diff --git a/functions.js b/functions.js index d14b632d..b99a53c9 100644 --- a/functions.js +++ b/functions.js @@ -1362,7 +1362,7 @@ function displayDlg(id, param) { return } - notify_progress("Loading, please wait..."); + notify_progress("Loading, please wait...", true); xmlhttp.open("GET", "backend.php?op=dlg&id=" + param_escape(id) + "¶m=" + param_escape(param), true); diff --git a/functions.php b/functions.php index 3cfcef87..2ea1f856 100644 --- a/functions.php +++ b/functions.php @@ -3864,9 +3864,27 @@ // from here: http://www.roscripts.com/Create_tag_cloud-71.html function printTagCloud($link) { - + + /* get first ref_id to count from */ + + $query = ""; + + if (DB_TYPE == "pgsql") { + $query = "SELECT MIN(id) AS id FROM ttrss_user_entries, ttrss_entries + WHERE int_id = id AND owner_uid = ".$_SESSION["uid"]." + AND date_entered > NOW() - INTERVAL '30 days'"; + } else { + $query = "SELECT MIN(id) AS id FROM ttrss_user_entries, ttrss_entries + WHERE int_id = id AND owner_uid = ".$_SESSION["uid"]." + AND date_entered > DATE_SUB(NOW(), INTERVAL 30 DAY)"; + } + + $result = db_query($link, $query); + $first_id = db_fetch_result($result, 0, "id"); + $query = "SELECT tag_name, COUNT(post_int_id) AS count FROM ttrss_tags WHERE owner_uid = ".$_SESSION["uid"]." + AND post_int_id >= '$first_id' GROUP BY tag_name ORDER BY count DESC LIMIT 50"; $result = db_query($link, $query); diff --git a/modules/popup-dialog.php b/modules/popup-dialog.php index 3011f8c1..4aa498cb 100644 --- a/modules/popup-dialog.php +++ b/modules/popup-dialog.php @@ -416,8 +416,8 @@ print "
".__('Tag Cloud')."
"; print "
"; - print "Showing top 50 most popular tags (show all):
"; + print "Showing most popular tags for the last month (browse all):
"; print "
"; diff --git a/tt-rss.js b/tt-rss.js index a4e825a1..ec7e15aa 100644 --- a/tt-rss.js +++ b/tt-rss.js @@ -37,12 +37,12 @@ function toggleTags(show_all) { closeInfoBox(); display_tags = true; p.innerHTML = __("display feeds"); - notify_progress("Loading, please wait..."); + notify_progress("Loading, please wait...", true); updateFeedList(); } else if (display_tags) { display_tags = false; p.innerHTML = __("tag cloud"); - notify_progress("Loading, please wait..."); + notify_progress("Loading, please wait...", true); updateFeedList(); } }