You are here

function recipe_unit_name in Recipe 5

Same name and namespace in other branches
  1. 6 recipe.module \recipe_unit_name()

Converts a recipe unit ID to it's name

1 call to recipe_unit_name()
theme_node_recipe in ./recipe.module
A custom theme function.

File

./recipe.module, line 817
recipe.module - share recipes for drupal 5.x

Code

function recipe_unit_name($unit_id) {
  static $unit_names;
  if (!$unit_names) {
    $rs = db_query('SELECT id,name FROM {recipe_unit}');
    while ($unit = db_fetch_object($rs)) {
      $unit_names[$unit->id] = $unit->name;
    }
  }
  return $unit_names[$unit_id];
}