You are here

function devel_generate_add_statistics in Devel 6

Same name and namespace in other branches
  1. 8.3 devel_generate/devel_generate.module \devel_generate_add_statistics()
  2. 8 devel_generate/devel_generate.module \devel_generate_add_statistics()
  3. 8.2 devel_generate/devel_generate.module \devel_generate_add_statistics()
  4. 7 devel_generate/devel_generate.inc \devel_generate_add_statistics()
  5. 4.x devel_generate/devel_generate.module \devel_generate_add_statistics()

Generate statistics information for a node.

Parameters

$node: A node object.

1 call to devel_generate_add_statistics()
devel_generate_nodeapi in ./devel_generate.inc

File

./devel_generate.inc, line 412

Code

function devel_generate_add_statistics($node) {
  $totalcount = mt_rand(0, 500);
  $daycount = mt_rand(0, $totalcount);
  $timestamp = time() - mt_rand(0, $node->created);
  db_query('INSERT INTO {node_counter} (nid, daycount, totalcount, timestamp) VALUES (%d, %d, %d, %d)', $node->nid, $daycount, $totalcount, $timestamp);
}