statistics_get
modules/statistics/statistics.module, строка 445
- Версии
- 5 – 6
statistics_get($nid)
Retrieves a node's 'view statistics'
.
Параметры
$nid
node ID
Возвращаемое значение
An array with three entries: [0]=totalcount, [1]=daycount, [2]=timestamp
- totalcount: count of the total number of times that node has been viewed.
- daycount: count of the total number of times that node has been viewed
'today'
. For the daycount to be reset, cron must be enabled. - timestamp: timestamp of when that node was last viewed.
Код
<?php
function statistics_get($nid) {
if ($nid > 0) {
/* retrieves 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;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии