Skip to Content

dfsdfsdf

<?php

$vid = 4; //vocabulary id
$num_term = 20; //limit maximum terms

$query = "SELECT tid, name, count
FROM (
SELECT td.tid AS tid, name, COUNT(*) AS count
FROM {term_data} AS td
JOIN {term_node }AS tn ON td.tid = tn.tid
JOIN {node} AS n ON n.nid = tn.nid AND n.vid = tn.vid
WHERE td.vid = ". $vid ." AND n.status = 1
GROUP BY td.tid
ORDER BY count DESC
LIMIT ". $num_term . "
) AS t
ORDER BY name ASC";

$result = db_query($query);
while ($term = db_fetch_object($result)) {
if ($term->count > -1 & $term->parents = 0) {
$items[]= l($term->name, "taxonomy/term/$term->tid") . ' (' . $term->count . ')';
}
}

if(count($items)) {
return theme('item_list',$items);
}

$boom = taxonomy_get_tree(4, $parent = 363, $depth = 0, $max_depth = 2);
print "

";
$boomke = $boom[0][name]
print_r($boomke);
print "

";
?>