/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<div class="rubricator"> <?php $vid = 1; $db_result = db_query_range( "SELECT d.tid, d.name, MAX(n.created) AS updated, COUNT(*) AS count FROM {term_data} d INNER JOIN {term_node} USING (tid) INNER JOIN {node} n USING (nid) WHERE d.vid = %d AND n.status = 1 AND n.type = '%s' GROUP BY d.tid, d.name ORDER BY COUNT DESC", $vid, 'my_node_type', 0, 10 ); while ( $category = db_fetch_object( $db_result ) ) { $items[] = l( $category -> name , 'taxonomy/term/'. $category -> tid ) . ' (' . $category -> count . ')'; } print theme( 'item_list', $items ); ?> </div>