You are here

function user_stats_comment_update in User Stats 7

Implements hook_comment_update().

File

./user_stats.module, line 372
User Stats provides commonly requested user statistics for themers. These are:

Code

function user_stats_comment_update($comment) {
  if (variable_get('user_stats_count_comments', TRUE)) {
    if ($comment->uid == NULL) {
      $comment->uid = 0;
    }
    $post_count_content_types = variable_get('user_stats_included_content_types', array());
    $node = node_load($comment->nid);
    if (empty($post_count_content_types) || in_array($node->type, $post_count_content_types)) {
      if ($comment->status == COMMENT_PUBLISHED) {
        user_stats_post_count_update('reset', $comment->uid);
      }
    }
  }
}