You are here

function user_stats_uninstall in User Stats 5

Same name and namespace in other branches
  1. 6 user_stats.install \user_stats_uninstall()
  2. 7 user_stats.install \user_stats_uninstall()

Implementation of hook_uninstall().

File

./user_stats.install, line 29

Code

function user_stats_uninstall() {
  $post_count_profile_field = variable_get('user_stats_postcount_profile_field', 'user_post_count');
  variable_del('user_stats_rebuild_stats');
  variable_del('user_stats_last_cron_check');
  variable_del('user_stats_included_content_types');
  variable_del('user_stats_reset_count');
  variable_del('user_stats_user_per_cron');
  variable_del('user_stats_count_posts');
  variable_del('user_stats_count_logins');
  variable_del('user_stats_postcount_profile_field');
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
    case 'pgsql':
      db_query("DELETE FROM {profile_values}\n        WHERE fid IN (SELECT fid FROM {profile_fields}\n        WHERE name IN ('%s', 'user_ip_address', 'user_login_count'))", $post_count_profile_field);
      db_query("DELETE FROM {profile_fields}\n        WHERE name IN ('%s', 'user_ip_address', 'user_login_count')", $post_count_profile_field);
      break;
  }
}