You are here

function regcode_get_categories in Registration codes 6

Return a list of distinct categories

3 calls to regcode_get_categories()
regcode_admin_ajax_categories in ./regcode.admin.php
Autocomplete helper for categories
regcode_og_admin in regcode_og/regcode_og.module
Admin page for role assignment
regcode_roles_admin in regcode_roles/regcode_roles.module
Admin page for role assignment

File

./regcode.api.php, line 89
A generic set of functions for interacting with and creating regcodes

Code

function regcode_get_categories($match = '', $limit = 50) {
  $result = db_query_range("SELECT DISTINCT category FROM {regcode} WHERE LOWER(category) LIKE LOWER('%s%%')", $match, 0, $limit);
  $matches = array();
  while ($regcode = db_fetch_object($result)) {
    $matches[$regcode->category] = check_plain($regcode->category);
  }
  return $matches;
}