| Versionen | |
|---|---|
| drupal6 – drupal7 | statistics_get($nid) |
Retrieves a node's "view statistics".
$nid node ID
An array with three entries: [0]=totalcount, [1]=daycount, [2]=timestamp
modules/
<?php
function statistics_get($nid) {
if ($nid > 0) {
// Retrieve an array with both totalcount and daycount.
$statistics = db_fetch_array(db_query('SELECT totalcount, daycount, timestamp FROM {node_counter} WHERE nid = %d', $nid));
}
return $statistics;
}
?>
Kommentare
Kommentar hinzufügen