function block_tracker_preprocess_block in Util 7
Same name and namespace in other branches
- 6.3 contribs/block_tracker/block_tracker.module \block_tracker_preprocess_block()
 
Implements hook_preprocess_HOOK(). Update the last used timestamp in the blocks table.
File
- contribs/
block_tracker/ block_tracker.module, line 52  - Track block usage.
 
Code
function block_tracker_preprocess_block($variables) {
  // Update the lastused timestamp in the block.
  db_update('block')
    ->fields(array(
    'lastused' => REQUEST_TIME,
  ))
    ->condition('bid', $variables['elements']['#block']->bid)
    ->execute();
}