webmaster@1: t('Time'), 'field' => 'a.timestamp', 'sort' => 'desc'), webmaster@1: array('data' => t('Referrer'), 'field' => 'a.url'), webmaster@1: array('data' => t('User'), 'field' => 'u.name'), webmaster@1: array('data' => t('Operations'))); webmaster@1: webmaster@1: $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); webmaster@1: $rows = array(); webmaster@1: while ($log = db_fetch_object($result)) { webmaster@1: $rows[] = array( webmaster@1: array('data' => format_date($log->timestamp, 'small'), 'class' => 'nowrap'), webmaster@1: _statistics_link($log->url), webmaster@1: theme('username', $log), webmaster@1: l(t('details'), "admin/reports/access/$log->aid")); webmaster@1: } webmaster@1: webmaster@1: if (empty($rows)) { webmaster@1: $rows[] = array(array('data' => t('No statistics available.'), 'colspan' => 4)); webmaster@1: } webmaster@1: webmaster@1: drupal_set_title(check_plain($node->title)); webmaster@1: $output = theme('table', $header, $rows); webmaster@1: $output .= theme('pager', NULL, 30, 0); webmaster@1: return $output; webmaster@1: } webmaster@1: else { webmaster@1: drupal_not_found(); webmaster@1: } webmaster@1: } webmaster@1: webmaster@1: function statistics_user_tracker() { webmaster@1: if ($account = user_load(array('uid' => arg(1)))) { webmaster@1: webmaster@1: $header = array( webmaster@1: array('data' => t('Timestamp'), 'field' => 'timestamp', 'sort' => 'desc'), webmaster@1: array('data' => t('Page'), 'field' => 'path'), webmaster@1: array('data' => t('Operations'))); webmaster@1: webmaster@1: $result = pager_query('SELECT aid, timestamp, path, title FROM {accesslog} WHERE uid = %d'. tablesort_sql($header), 30, 0, NULL, $account->uid); webmaster@1: $rows = array(); webmaster@1: while ($log = db_fetch_object($result)) { webmaster@1: $rows[] = array( webmaster@1: array('data' => format_date($log->timestamp, 'small'), 'class' => 'nowrap'), webmaster@1: _statistics_format_item($log->title, $log->path), webmaster@1: l(t('details'), "admin/reports/access/$log->aid")); webmaster@1: } webmaster@1: webmaster@1: if (empty($rows)) { webmaster@1: $rows[] = array(array('data' => t('No statistics available.'), 'colspan' => 3)); webmaster@1: } webmaster@1: webmaster@1: drupal_set_title(check_plain($account->name)); webmaster@1: $output = theme('table', $header, $rows); webmaster@1: $output .= theme('pager', NULL, 30, 0); webmaster@1: return $output; webmaster@1: } webmaster@1: else { webmaster@1: drupal_not_found(); webmaster@1: } webmaster@1: }