'fieldset', '#collapsible' => TRUE, '#collapsed' => TRUE, '#title' => t('!Points for registering', userpoints_translation()), ); $form[$group][USERPOINTS_REGISTER_REGISTER] = array( '#type' => 'textfield', '#title' => t('!Points for registering', userpoints_translation()), '#default_value' => variable_get(USERPOINTS_REGISTER_REGISTER, 0), '#size' => 5, '#maxlength' => 5, ); $form[$group][USERPOINTS_REGISTER_TID] = array( '#type' => 'select', '#title' => t('Category'), '#default_value' => variable_get(USERPOINTS_REGISTER_TID, 0), '#options' => userpoints_get_categories(), '#description' => t('Registration will be assigned to this category. You can modify what categories are available by modifying the Userpoints taxonomy.', array('!url' => url('admin/content/taxonomy/'. variable_get(USERPOINTS_CATEGORY_DEFAULT_VID, '')))), ); return $form; } } /* * Implementation of hook_user() * Awards the points for registering */ function userpoints_register_user($op, &$edit, &$account, $category = NULL) { if ($op == 'insert') { // Award the points - implementation of hook_userpointsapi() $param = array( 'points' => variable_get(USERPOINTS_REGISTER_REGISTER, 0), 'uid' => $account->uid, 'operation' => 'register', 'entity_type' => 'user', 'entity_id' => $account->uid, 'tid' => variable_get(USERPOINTS_REGISTER_TID, 0), ); userpoints_userpointsapi($param); } }