l($t('here'), 'http://textcaptcha.com/'), '!admin' => l($t('here'), 'admin/config/people/captcha/textcaptcha'), ) ); drupal_set_message($text, 'warning'); } /** * Implements hook_uninstall(). */ function textcaptcha_uninstall() { drupal_uninstall_schema('textcaptcha'); $variables = array( 'textcaptcha_api_key', 'textcaptcha_challenge_description', 'textcaptcha_cron', 'textcaptcha_question_limit', ); foreach ($variables as $variable) { variable_del($variable); } } /** * Implements hook_schema(). */ function textcaptcha_schema() { $schema['textcaptcha_answers'] = array( 'description' => 'Caches textcaptcha answers to prevent exceeding the API rate limit.', 'fields' => array( 'aid' => array( 'description' => 'The primary identifier for an answer.', 'type' => 'serial', 'not null' => TRUE, ), 'qid' => array( 'description' => 'The question to which the answer belongs.', 'type' => 'int', 'not null' => TRUE, ), 'answer' => array( 'description' => 'A MD5 hash of the answer.', 'type' => 'text', 'not null' => TRUE, ), 'created' => array( 'description' => 'The date the answer was added.', 'type' => 'int', 'not null' => TRUE, ), ), 'primary key' => array('aid'), ); $schema['textcaptcha_questions'] = array( 'description' => 'Caches textcaptcha questions to prevent exceeding the API rate limit.', 'fields' => array( 'qid' => array( 'description' => 'The primary identifier for a question.', 'type' => 'serial', 'not null' => TRUE, ), 'question' => array( 'description' => 'The text of the question.', 'type' => 'text', 'not null' => TRUE, ), 'created' => array( 'description' => 'The date the question was added.', 'type' => 'int', 'not null' => TRUE, ), ), 'primary key' => array('qid'), ); return $schema; } /** * Implements hook_update_N(). * * Install new schema for textcaptcha database tables. */ function textcaptcha_update_6001() { if (!db_table_exists('textcaptcha_answers')) { drupal_install_schema('textcaptcha'); } }