statistics_title_list

Versions
4.6 – 7
statistics_title_list($dbfield, $dbrows)

Returns all time or today top or last viewed node(s).

Parameters

$dbfield one of

  • 'totalcount': top viewed content of all time.
  • 'daycount': top viewed content for today.
  • 'timestamp': last viewed node.

$dbrows number of rows to be returned.

Return value

A query result containing n.nid, n.title, u.uid, u.name of the selected node(s) or FALSE if the query could not be executed correctly.

Code

modules/statistics.module, line 386

<?php
function statistics_title_list($dbfield, $dbrows) {
  return db_query_range(db_rewrite_sql("SELECT n.nid, n.title, u.uid, u.name FROM {node_counter} s INNER JOIN {node} n ON s.nid = n.nid INNER JOIN {users} u ON n.uid = u.uid WHERE %s <> '0' AND n.status = 1 ORDER BY %s DESC"), 's.'. $dbfield, 's.'. $dbfield, 0, $dbrows);
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.