statistics_node_tracker
- Versions
- 4.6 – 7
statistics_node_tracker()
Code
modules/statistics.module, line 163
<?php
function statistics_node_tracker() {
if ($node = node_load(array('nid' => arg(1)))) {
$header = array(
array('data' => t('Time'), 'field' => 'a.timestamp', 'sort' => 'desc'),
array('data' => t('Referrer'), 'field' => 'a.url'),
array('data' => t('User'), 'field' => 'u.name'),
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);
while ($log = db_fetch_object($result)) {
$rows[] = array(
array('data' => format_date($log->timestamp, 'small'), 'nowrap' => 'nowrap'),
l(_statistics_column_width($log->url), $log->url),
format_name($log),
l(t('details'), "admin/logs/access/$log->aid"));
}
if ($pager = theme('pager', NULL, 30, 0, tablesort_pager())) {
$rows[] = array(array('data' => $pager, 'colspan' => '4'));
}
drupal_set_title(check_plain($node->title));
print theme('page', theme('table', $header, $rows));
}
else {
drupal_not_found();
}
}
?>Login or register to post comments 