You are here

function spam_user in Spam 5.3

Same name and namespace in other branches
  1. 6 content/spam_content_user.inc \spam_user()

File

modules/spam_user.inc, line 6

Code

function spam_user($type, &$edit, &$user, $category = NULL) {
  switch ($type) {
    case 'update':
      $user = spam_user_profile_update($user);
      return spam_content_update($user, 'user');
    case 'insert':
      $user = spam_user_profile_update($user);
      return spam_content_insert($user, 'user');
    case 'delete':
      return spam_content_delete($user, 'user');
    case 'view':
      $links = '';
      if (user_spamapi('filter_content_type', $user)) {
        foreach (spam_links('user', $user->uid, $user) as $link) {
          if ($link['href']) {
            $links .= l($link['title'], $link['href']) . ' ';
          }
          else {
            $links .= $link['title'] . ' ';
          }
        }
        $items['spam_links'] = array(
          'value' => $links,
          'class' => 'spam',
        );
        $status = db_result(db_query('SELECT status FROM {users} WHERE uid = %d', $user->uid));
        $status_text = t('User status: %status', array(
          '%status' => $status ? t('not blocked') : t('blocked'),
        ));
        $items['spam_status'] = array(
          'value' => $status_text,
          'class' => 'spam',
        );
        return array(
          t('Spam status') => $items,
        );
      }
      break;
  }
}