From f7440d4d73ec57219af232c135be3b2567dda45f Mon Sep 17 00:00:00 2001 From: Steven Wittens Date: Tue, 27 Mar 2007 05:13:55 +0000 Subject: #130971: Kitchen sink (E_NOTICE compliance / Code style / Bugfix in book toc) --- modules/statistics/statistics.module | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'modules/statistics') diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module index 9bfaf9056..d53371433 100644 --- a/modules/statistics/statistics.module +++ b/modules/statistics/statistics.module @@ -200,6 +200,7 @@ function statistics_node_tracker() { array('data' => t('Operations'))); $result = pager_query('SELECT a.aid, a.timestamp, a.url, a.uid, u.name FROM {accesslog} a LEFT JOIN {users} u ON a.uid = u.uid WHERE a.path LIKE \'node/%d%%\'' . tablesort_sql($header), 30, 0, NULL, $node->nid); + $rows = array(); while ($log = db_fetch_object($result)) { $rows[] = array( array('data' => format_date($log->timestamp, 'small'), 'class' => 'nowrap'), @@ -209,9 +210,11 @@ function statistics_node_tracker() { } drupal_set_title(check_plain($node->title)); - $output = theme('table', $header, $rows); - $output .= theme('pager', NULL, 30, 0); - return $output; + if (!empty($rows)) { + $output = theme('table', $header, $rows); + $output .= theme('pager', NULL, 30, 0); + return $output; + } } else { drupal_not_found(); -- cgit v1.2.3