| description | value |
|---|---|
| External referrers today | 135 |
| Internal referrers today | 69 |
| Viewed nodes today | 132 |
| Viewed nodes all time | 242138 |
| Viewed pages today | 1367 |
| Hits today | 1367 |
| RSS feed subscribers | 366 |
Most popular blog entries
Submitted by fgm on Fri, 2006-08-25 21:53.
20 most popular entries in this blog, based on data from the statistics module. And, of course, the code to build such a list.
Lament
Looks like my drupal posts are more popular than my music-related ones :-(
Gimme the code !
In case you'd wonder how to get to these results, here is the code used:
drupal_set_html_head('<style type="text/css">.num { text-align: center; padding: 0 1em ; }</style>');
$limit = 20;
$header = array ('Daily hits', 'Total hits', 'Post title');
$sq = 'SELECT nc.totalcount cnt, 86400 * nc.totalcount / (UNIX_TIMESTAMP() - n.created) daily, '
. 'n.nid nid, n.title title '
. 'FROM {node_counter} nc '
. ' INNER JOIN {node} n ON n.nid = nc.nid '
. 'ORDER BY 2 DESC, 1 DESC ';
$q = db_query_range($sq, 0, $limit);
$data = array();
while ($o = db_fetch_object($q))
{
$data[] = array(
array(
'data' => round($o->daily),
'class' => 'num'
),
array(
'data' => $o->cnt,
'class' => 'num',
),
l($o->title, "node/$o->nid"));
}
$ret = theme_table($header, $data);
echo $ret;



Recent comments
1 week 3 days ago
1 week 3 days ago
6 weeks 4 days ago
6 weeks 5 days ago
7 weeks 3 days ago
7 weeks 3 days ago
8 weeks 1 day ago
8 weeks 1 day ago
10 weeks 2 days ago
10 weeks 2 days ago