You are here

function gravatar_var in Gravatar integration 7

Same name and namespace in other branches
  1. 5 gravatar.module \gravatar_var()
  2. 6 gravatar.module \gravatar_var()

Internal implementation of variable_get().

2 calls to gravatar_var()
gravatar_get_gravatar in ./gravatar.module
Generate a gravatar URL.
gravatar_requirements in ./gravatar.install
Implementation of hook_requirements().

File

./gravatar.module, line 442
Integrates gravatar service for user pictures.

Code

function gravatar_var($name, $default = NULL) {
  static $defaults = NULL;
  if (!isset($defaults)) {
    $defaults = gravatar_variables();
  }
  $name = 'gravatar_' . $name;

  // @todo Remove when stable.
  if (!isset($defaults[$name])) {
    trigger_error('Default variable for ' . drupal_placeholder($name) . ' not found.');
  }
  return variable_get($name, isset($default) || !isset($defaults[$name]) ? $default : $defaults[$name]);
}