I'm using Tagadelic & liking it a lot!

One issue: If exactly one node has a certain tag, THEN that node is UNpublished, that tag still shows up in the tag cloud. If a user clicks that tag, he gets an empty list.

Would it be possible to NOT SHOW tags in the cloud if the only node(s) they point to is/are unpublished?

Thank you!

Comments

chazz’s picture

yeah i have the same problem...

chazz’s picture

Version: 4.7.x-2.0 » 5.x-0.1

Have you a got a fix for this for drupal 5 ?

suborbitcom’s picture

I just experienced the same thing and found that no-one had an answer yet.

Time to invent the wheel...

--- tagadelic.module.old        2007-06-10 17:55:54.980771815 +0100
+++ tagadelic.module    2007-06-10 18:03:32.950326194 +0100
@@ -211,7 +211,7 @@
   if (!is_array($vids) || count($vids) == 0) {
     return array();
   }
-  $result = db_query_range('SELECT COUNT(*) AS count, d.tid, d.name, d.vid FROM {term_data} d INNER JOIN {term_node} n ON d.tid = n.tid WHERE d.vid IN ('. substr(str_repeat('%d,', count($vids)), 0, -1) .') GROUP BY d.tid, d.name, d.vid ORDER BY count DESC', $vids, 0, $size);
+  $result = db_query_range('SELECT COUNT(*) AS count, d.tid, d.name, d.vid FROM {term_data} d INNER JOIN {term_node} n ON d.tid = n.tid INNER JOIN node ON n.nid = node.nid WHERE d.vid IN ('. substr(str_repeat('%d,', count($vids)), 0, -1) .') AND node.status = 1 GROUP BY d.tid, d.name, d.vid ORDER BY count DESC', $vids, 0, $size);
 
   return tagadelic_build_weighted_tags($result, $steps);
 }
ardee-1’s picture

Looks OK, except you might want to but braces around "node" for the new inner join:

$result = db_query_range('SELECT COUNT(*) AS count, d.tid, d.name, d.vid FROM {term_data} d INNER JOIN {term_node} n ON d.tid = n.tid INNER JOIN {node} ON n.nid = node.nid WHERE d.vid IN ('. substr(str_repeat('%d,', count($vids)), 0, -1) .') AND node.status = 1 GROUP BY d.tid, d.name, d.vid ORDER BY count DESC', $vids, 0, $size);

Thanks. I'm using it on my site now.

Bèr Kessels’s picture

Status: Active » Needs work

if possible, please create a ral patch (http://drupal.org/diffandpatch)

Also, please do a small benchmark and measurement please. Devel module allows you to calculate the time a query takes to complete. AFAIKS your solution, eventhough it works, will make tagadelic clouds immensly slower on large node tables.

Bèr Kessels’s picture

Status: Needs work » Closed (duplicate)