| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
|
| 4 |
/**
|
| 5 |
* Implementation of hook_install().
|
| 6 |
*/
|
| 7 |
function user_stats_install() {
|
| 8 |
switch ($GLOBALS['db_type']) {
|
| 9 |
case 'mysql':
|
| 10 |
case 'mysqli':
|
| 11 |
db_query("INSERT IGNORE INTO {profile_fields} (
|
| 12 |
title, name, explanation, category, page, type, weight, required, register, visibility, options) VALUES
|
| 13 |
('Post Count', 'user_post_count', '', 'Statistics', '', 'textfield', 0, 0, 1, '%s', ''); ", PROFILE_HIDDEN);
|
| 14 |
break;
|
| 15 |
}
|
| 16 |
}
|
| 17 |
|
| 18 |
/**
|
| 19 |
* Implementation of hook_uninstall().
|
| 20 |
*/
|
| 21 |
function user_stats_uninstall() {
|
| 22 |
variable_del('user_stats_rebuild_stats');
|
| 23 |
variable_del('user_stats_last_cron_check');
|
| 24 |
switch ($GLOBALS['db_type']) {
|
| 25 |
case 'mysql':
|
| 26 |
case 'mysqli':
|
| 27 |
db_query("DELETE {profile_fields}, {profile_values}
|
| 28 |
FROM {profile_fields}, {profile_values}
|
| 29 |
WHERE {profile_fields}.fid={profile_values}.fid
|
| 30 |
AND name='user_post_count'");
|
| 31 |
break;
|
| 32 |
}
|
| 33 |
}
|