hi i've done this code to get the node's tags weighted so i want to know if i't right written and id it could be in my tagadelig.module, thanks
function get_node_tags($node)
{
$terms = taxonomy_node_get_terms($node->nid, 'tid');
foreach ($terms as $term)
{
if(!$tid && $term->vid == 1)
{
$tid= $term->tid;
}
else if($term->vid == 1)
{
$tid .= ','.$term->tid;
}
}
$steps = 6;
$result= db_query("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.tid IN (".$tid.")
GROUP BY d.tid, d.name, d.vid");
$tags = tagadelic_build_weighted_tags($result, $steps);
return theme('tagadelic_weighted', $tags);
}
Comments
Comment #1
Bèr Kessels commentedhttp://drupal.org/node/253514