You are here

function regcode_og_get_rules in Registration codes 6

Same name and namespace in other branches
  1. 6.2 regcode_og/regcode_og.module \regcode_og_get_rules()

List all of the regcode rules

2 calls to regcode_og_get_rules()
regcode_og_get_list_markup in regcode_og/regcode_og.module
Return the formatted HTML list
regcode_og_regcode_used in regcode_og/regcode_og.module
Implements hook_regcode_used()

File

regcode_og/regcode_og.module, line 151

Code

function regcode_og_get_rules($category = '') {

  // Query
  $query = 'SELECT id, category, regcode_og.og AS ogid
            FROM {regcode_og} AS regcode_og';
  if (empty($category)) {
    $res = db_query($query);
  }
  else {
    $res = db_query($query . " WHERE category='%s'", $category);
  }

  // Build array
  $rules = array();
  while ($row = db_fetch_array($res)) {
    $rules[] = $row;
  }
  return $rules;
}