You are here

function notify_user in Notify 6

Same name and namespace in other branches
  1. 5.2 notify.module \notify_user()
  2. 5 notify.module \notify_user()

Implementation of hook_user().

File

./notify.module, line 137
Notify module sends email digests of new content and comments.

Code

function notify_user($type, &$edit, &$user, $category = NULL) {
  switch ($type) {
    case 'delete':
      db_query('DELETE FROM {notify} WHERE uid = %d', $user->uid);
      break;
    case 'register':
      return _notify_user_reg_fields();
      break;
    case 'insert':
      if (isset($edit['notify_decision']) && $edit['notify_decision'] == 1) {
        db_query('INSERT INTO {notify} (uid, status, node, teasers, comment) VALUES (%d, %d, %d, %d, %d)', $user->uid, 1, 1, 0, 0);
        $edit['notify_decision'] = NULL;
      }
      break;
  }
}