]> git.wh0rd.org Git - tt-rss.git/commitdiff
tag cloud improvements
authorAndrew Dolgov <fox@madoka.spb.ru>
Thu, 17 May 2007 13:07:34 +0000 (14:07 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Thu, 17 May 2007 13:07:34 +0000 (14:07 +0100)
functions.js
functions.php
modules/popup-dialog.php
tt-rss.js

index d14b632d1ca2875280f20fff80cab40f460c3b5b..b99a53c96aa262ba99ecd3103ecf3224acd4a404 100644 (file)
@@ -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) + "&param=" + param_escape(param), true);
index 3cfcef875b667b34e82d2310a552f4bc9698fb25..2ea1f856c3e62dd7d7eee3a5ced0ac51f3888da3 100644 (file)
 // 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);
index 3011f8c1be1138976ecd57a5794930cdb45dc50f..4aa498cbfdb6f3b75fa90d41be3c27019f91d35a 100644 (file)
                        print "<div id=\"infoBoxTitle\">".__('Tag Cloud')."</div>";
                        print "<div class=\"infoBoxContents\">";
 
-                       print "Showing top 50 most popular tags (<a 
-                               href='javascript:toggleTags(true)'>show all</a>):<br/>";
+                       print "Showing most popular tags for the last month (<a 
+                               href='javascript:toggleTags(true)'>browse all</a>):<br/>";
 
                        print "<div class=\"tagCloudContainer\">";
 
index a4e825a145f1734b6fc381cc826fdf404bd78161..ec7e15aac3383d6de780fe1d08458d3f8dff0567 100644 (file)
--- 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();
        }
 }