diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-07-13 21:34:14 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-07-13 21:34:14 +0000 |
commit | 739bb8a868a0887743c2e343e7462ce0381b653b (patch) | |
tree | f8ef7604bb3d320abf9503d35fd3ea9f5cb4d6a5 | |
parent | 2c9b5e31b7d4dbe2dd344517b1f4dc94c2baa340 (diff) | |
download | brdo-739bb8a868a0887743c2e343e7462ce0381b653b.tar.gz brdo-739bb8a868a0887743c2e343e7462ce0381b653b.tar.bz2 |
- Patch #9261 by drumm: made the aggregator overview tables more consistent by adding a items column to the categories table which acts like the same column in the feeds table.
-rw-r--r-- | modules/aggregator.module | 6 | ||||
-rw-r--r-- | modules/aggregator/aggregator.module | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/modules/aggregator.module b/modules/aggregator.module index 16b12d464..210283703 100644 --- a/modules/aggregator.module +++ b/modules/aggregator.module @@ -666,14 +666,14 @@ function aggregator_view() { } $output .= theme('table', $header, $rows); - $result = db_query('SELECT * FROM {aggregator_category} ORDER BY title'); + $result = db_query('SELECT c.cid, c.title, count(ci.iid) as items FROM {aggregator_category} c LEFT JOIN {aggregator_category_item} ci ON c.cid = ci.cid GROUP BY c.cid ORDER BY title'); $output .= '<h3>'. t('Category overview') .'</h3>'; - $header = array(t('title'), t('operations')); + $header = array(t('title'), t('items'), t('operations')); $rows = array(); while ($category = db_fetch_object($result)) { - $rows[] = array(l($category->title, "aggregator/categories/$category->cid"), l(t('edit category'), "admin/aggregator/edit/category/$category->cid")); + $rows[] = array(l($category->title, "aggregator/categories/$category->cid"), format_plural($category->items, '1 item', '%count items'), l(t('edit category'), "admin/aggregator/edit/category/$category->cid")); } $output .= theme('table', $header, $rows); diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index 16b12d464..210283703 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -666,14 +666,14 @@ function aggregator_view() { } $output .= theme('table', $header, $rows); - $result = db_query('SELECT * FROM {aggregator_category} ORDER BY title'); + $result = db_query('SELECT c.cid, c.title, count(ci.iid) as items FROM {aggregator_category} c LEFT JOIN {aggregator_category_item} ci ON c.cid = ci.cid GROUP BY c.cid ORDER BY title'); $output .= '<h3>'. t('Category overview') .'</h3>'; - $header = array(t('title'), t('operations')); + $header = array(t('title'), t('items'), t('operations')); $rows = array(); while ($category = db_fetch_object($result)) { - $rows[] = array(l($category->title, "aggregator/categories/$category->cid"), l(t('edit category'), "admin/aggregator/edit/category/$category->cid")); + $rows[] = array(l($category->title, "aggregator/categories/$category->cid"), format_plural($category->items, '1 item', '%count items'), l(t('edit category'), "admin/aggregator/edit/category/$category->cid")); } $output .= theme('table', $header, $rows); |