/[drupal]/contributions/modules/user_stats/user_stats.install
ViewVC logotype

Contents of /contributions/modules/user_stats/user_stats.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Sun Nov 4 19:10:24 2007 UTC (2 years ago) by liammcdermott
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-5
File MIME type: text/x-php
Initial commit of user stats module. Module provides commonly requested user statistics for themers.
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 }

  ViewVC Help
Powered by ViewVC 1.1.2