You are here

function anonymous_publishing_requirements in Anonymous Publishing 7

Implements hook_requirements().

File

./anonymous_publishing.install, line 250
Install and uninstall hooks.

Code

function anonymous_publishing_requirements($phase) {
  $requirements = array();
  $t = get_t();
  if ($phase == 'runtime') {
    $stats = variable_get('anonymous_publishing_cl_stats', NULL);
    $value = $stats ? $t('Blocked !smart smart and !stupid stupid spambots since !start.', array(
      '!smart' => $stats['smart'],
      '!stupid' => $stats['stupid'],
      '!start' => format_date($stats['start'], 'short'),
    )) : $t('No spambot statistics collected.');
    $requirements['anonymous_publishing_cl_stats'] = array(
      'title' => $t('Anonymous Publishing'),
      'value' => $value,
      'severity' => REQUIREMENT_INFO,
    );
  }
  return $requirements;
}