You are here

function regcode_roles_create_rule in Registration codes 6

Same name and namespace in other branches
  1. 6.2 regcode_roles/regcode_roles.module \regcode_roles_create_rule()
  2. 7.2 regcode_roles/regcode_roles.module \regcode_roles_create_rule()
  3. 7 regcode_roles/regcode_roles.module \regcode_roles_create_rule()

Create a new regcode rule

1 call to regcode_roles_create_rule()
regcode_roles_admin_submit in regcode_roles/regcode_roles.module
Create the roles

File

regcode_roles/regcode_roles.module, line 232

Code

function regcode_roles_create_rule($category, $role, $expire_date, $expire_duration) {
  $expire_date = !$expire_date ? 'NULL' : (int) $expire_date;
  $expire_duration = !$expire_duration ? 'NULL' : (int) $expire_duration;
  db_query("INSERT INTO {regcode_roles} (category, role, expire_date, expire_duration) VALUES ('%s', %d, %s, %s)", $category, $role, $expire_date, $expire_duration);
}