Posted by ardee on March 31, 2007 at 6:34pm
4 followers
Jump to:
| Project: | Tagadelic |
| Version: | 5.x-0.1 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (duplicate) |
Issue Summary
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
#1
yeah i have the same problem...
#2
Have you a got a fix for this for drupal 5 ?
#3
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);
}
#4
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.
#5
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.
#6
http://drupal.org/node/62840