You are here

function profile_categories in Drupal 5

Same name and namespace in other branches
  1. 4 modules/profile.module \profile_categories()
  2. 6 modules/profile/profile.module \profile_categories()
1 call to profile_categories()
profile_user in modules/profile/profile.module
Implementation of hook_user().

File

modules/profile/profile.module, line 751
Support for configurable user profiles.

Code

function profile_categories() {

  // Hide hidden profile fields from users that don't have permission to administer users.
  // For these users, categories with only hidden profile fields will not be returned.
  if (user_access('administer users')) {
    $result = db_query("SELECT DISTINCT(category) FROM {profile_fields}");
  }
  else {
    $result = db_query("SELECT DISTINCT(category) FROM {profile_fields} WHERE visibility <> %d", PROFILE_HIDDEN);
  }
  while ($category = db_fetch_object($result)) {
    $data[] = array(
      'name' => $category->category,
      'title' => $category->category,
      'weight' => 3,
    );
  }
  return $data;
}