| 1 |
<?php |
<?php |
| 2 |
// $Id: user_stats.install,v 1.1.2.6.2.2 2008/03/29 07:34:04 liammcdermott Exp $ |
// $Id: user_stats.install,v 1.1.2.6.2.3 2008/11/18 22:24:43 liammcdermott Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 6 |
* Install hooks for the User Stats module. |
* Install hooks for the User Stats module. |
| 7 |
*/ |
*/ |
| 8 |
|
|
| 9 |
|
|
| 10 |
/** |
/** |
| 11 |
* Implementation of hook_install(). |
* Implementation of hook_install(). |
| 12 |
*/ |
*/ |
| 36 |
variable_del('user_stats_user_per_cron'); |
variable_del('user_stats_user_per_cron'); |
| 37 |
variable_del('user_stats_count_posts'); |
variable_del('user_stats_count_posts'); |
| 38 |
variable_del('user_stats_count_logins'); |
variable_del('user_stats_count_logins'); |
| 39 |
variable_del('user_stats_postcount_profile_field'); |
variable_del('user_stats_post_count_profile_field'); |
| 40 |
db_query("DELETE FROM {profile_values} |
db_query("DELETE FROM {profile_values} |
| 41 |
WHERE fid IN (SELECT fid FROM {profile_fields} |
WHERE fid IN (SELECT fid FROM {profile_fields} |
| 42 |
WHERE name IN ('%s', 'user_ip_address', 'user_login_count'))", $post_count_profile_field); |
WHERE name IN ('%s', 'user_ip_address', 'user_login_count'))", $post_count_profile_field); |
| 43 |
db_query("DELETE FROM {profile_fields} |
db_query("DELETE FROM {profile_fields} |
| 44 |
WHERE name IN ('%s', 'user_ip_address', 'user_login_count')", $post_count_profile_field); |
WHERE name IN ('%s', 'user_ip_address', 'user_login_count')", $post_count_profile_field); |
| 45 |
} |
} |
| 46 |
|
|
| 47 |
|
/** |
| 48 |
|
* Implementation of hook_update_N(). |
| 49 |
|
*/ |
| 50 |
|
function user_stats_update_6100() { |
| 51 |
|
// Making variable names consistent: 'postcount' becomes 'post_count'. |
| 52 |
|
$post_count_field = variable_get('user_stats_postcount_profile_field', 'user_post_count'); |
| 53 |
|
variable_set('user_stats_post_count_profile_field', $post_count_field); |
| 54 |
|
variable_del('user_stats_postcount_profile_field'); |
| 55 |
|
} |