How to perform an operation every time a node is viewed? When writing a module, how can I perform an operation every time a node is viewed by a user?
You can use hook_nodeapi() in Drupal 6 and check that the $op argument is 'view'. In Drupal 7, this has been changed to hook_node_$op() where $op is replaced by the value you would have checked for in the Drupal 6 version. So you would use hook_node_view(). For more details about the changes from Drupal 6 to Drupal 7 see http://drupal.org/update/modules/6/7#remove_op.