Commit c77153f1 authored by Dries's avatar Dries
Browse files

- Removed dumb taxonomy block (based on DrupalCon feedback).

parent 456fd7cc
......@@ -92,29 +92,6 @@ function taxonomy_menu($may_cache) {
return $items;
}
/**
* Implementation of hook_block().
*
* Generates a block with all categories.
*/
function taxonomy_block($op = 'list', $delta = 0) {
if ($op == 'list') {
$blocks[0]['info'] = t('Categories');
return $blocks;
}
else if ($op == 'view' && user_access('access content')) {
$result = db_query(db_rewrite_sql('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 n.status = 1 GROUP BY d.tid, d.name ORDER BY updated DESC, d.name'));
$items = array();
while ($category = db_fetch_object($result)) {
$items[] = l($category->name .' ('. $category->count .')', 'taxonomy/term/'. $category->tid) .'<br />'. t('%time ago', array('%time' => format_interval(time() - $category->updated)));
}
$block['subject'] = t('Categories');
$block['content'] = theme('item_list', $items);
return $block;
}
}
function taxonomy_form_vocabulary($edit = array()) {
foreach (array_merge(node_list(), $edit['nodes']) as $type) {
$node_type = node_invoke($type, 'node_name');
......
......@@ -92,29 +92,6 @@ function taxonomy_menu($may_cache) {
return $items;
}
/**
* Implementation of hook_block().
*
* Generates a block with all categories.
*/
function taxonomy_block($op = 'list', $delta = 0) {
if ($op == 'list') {
$blocks[0]['info'] = t('Categories');
return $blocks;
}
else if ($op == 'view' && user_access('access content')) {
$result = db_query(db_rewrite_sql('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 n.status = 1 GROUP BY d.tid, d.name ORDER BY updated DESC, d.name'));
$items = array();
while ($category = db_fetch_object($result)) {
$items[] = l($category->name .' ('. $category->count .')', 'taxonomy/term/'. $category->tid) .'<br />'. t('%time ago', array('%time' => format_interval(time() - $category->updated)));
}
$block['subject'] = t('Categories');
$block['content'] = theme('item_list', $items);
return $block;
}
}
function taxonomy_form_vocabulary($edit = array()) {
foreach (array_merge(node_list(), $edit['nodes']) as $type) {
$node_type = node_invoke($type, 'node_name');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment