In the end I created my own custom module to get the terms from the database and group/sort them.
Please note that I've modified the code below slightly for posting and I've not tested the modified version. It's also worth noting that it was written for a site using PostgreSQL, but it should work with MySQL.
/**
* Implements hook_block_info().
*/
function MYMODULE_block_info() {
$blocks['poptags'] = array(
'info' => t('Most Popular Tags'),
'cache' => DRUPAL_NO_CACHE
);
return $blocks;
}
/**
* Implements hook_block_view().
*/
function MYMODULE_block_view($delta = '') {
$block = array();
switch ($delta) {
case 'poptags':
$block['subject'] = t('Most Popular Tags');
$block['content'] = _MYMODULE_popular_terms();
break;
}
return $block;
}
function _MYMODULE_popular_terms() {
$vocabId = 1;
$links = array();
$results = db_query_range('SELECT taxonomy_term_data.tid, taxonomy_term_data.name, count(taxonomy_term_data.tid) AS times_used FROM taxonomy_term_data INNER JOIN taxonomy_index ON taxonomy_term_data.tid = taxonomy_index.tid WHERE taxonomy_term_data.vid = :vid GROUP BY taxonomy_term_data.tid, taxonomy_term_data.name ORDER BY times_used DESC', 0, 10, array(':vid' => $vocabId));
foreach ($results as $term) {
$links['term-link-' . db_escape_field($term->name)] = array('title' => $term->name, 'href' => drupal_get_path_alias('taxonomy/term/' . $term->tid));
}
return theme('links', array('links' => $links, 'attributes' => array('class' => 'term-links')));
}
Don't forget to change MYMODULE
for the name of your module.
Lastly change the $vocabId = 1
line in the _MYMODULE_popular_terms
function to the vid (vocabulary id) of the vocabulary that you want to list the terms of.
Note this is for Drupal 7 only, though it would not take much to port it to Drupal 6.