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

Diff of /contributions/modules/user_stats/user_stats.install

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

revision 1.1.2.6, Fri Mar 21 17:17:01 2008 UTC revision 1.1.2.7, Sun Feb 1 03:44:11 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: user_stats.install,v 1.1.2.5 2008/03/14 02:31:26 liammcdermott Exp $  // $Id: user_stats.install,v 1.1.2.6 2008/03/21 17:17:01 liammcdermott Exp $
3    
4  /**  /**
5   * Implementation of hook_install().   * Implementation of hook_install().
# Line 11  function user_stats_install() { Line 11  function user_stats_install() {
11      case 'pgsql':      case 'pgsql':
12        db_query("DELETE FROM {profile_fields} WHERE name IN ('user_post_count', 'user_ip_address', 'user_login_count')");        db_query("DELETE FROM {profile_fields} WHERE name IN ('user_post_count', 'user_ip_address', 'user_login_count')");
13        db_query("INSERT INTO {profile_fields} (        db_query("INSERT INTO {profile_fields} (
14          title, name, explanation, category, page, type, weight, required, register, visibility, options) VALUES          title, name, explanation, category, page, type, weight, required, register, visibility, options) VALUES
15          ('Post Count', 'user_post_count', '', 'Statistics', '', 'textfield', 0, 0, 0, %d, '')", PROFILE_HIDDEN);          ('Post Count', 'user_post_count', '', 'Statistics', '', 'textfield', 0, 0, 0, %d, '')", PROFILE_HIDDEN);
16        db_query("INSERT INTO {profile_fields} (        db_query("INSERT INTO {profile_fields} (
17          title, name, explanation, category, page, type, weight, required, register, visibility, options) VALUES          title, name, explanation, category, page, type, weight, required, register, visibility, options) VALUES
18          ('IP Address', 'user_ip_address', '', 'Statistics', '', 'textfield', 0, 0, 0, %d, '')", PROFILE_HIDDEN);          ('IP Address', 'user_ip_address', '', 'Statistics', '', 'textfield', 0, 0, 0, %d, '')", PROFILE_HIDDEN);
19        db_query("INSERT INTO {profile_fields} (        db_query("INSERT INTO {profile_fields} (
20          title, name, explanation, category, page, type, weight, required, register, visibility, options) VALUES          title, name, explanation, category, page, type, weight, required, register, visibility, options) VALUES
21          ('Login Count', 'user_login_count', '', 'Statistics', '', 'textfield', 0, 0, 0, %d, '')", PROFILE_HIDDEN);          ('Login Count', 'user_login_count', '', 'Statistics', '', 'textfield', 0, 0, 0, %d, '')", PROFILE_HIDDEN);
22        break;        break;
23    }    }
# Line 60  function user_stats_update_1() { Line 60  function user_stats_update_1() {
60      case 'mysqli':      case 'mysqli':
61        // We use 4 instead of PROFILE_HIDDEN as this constant is not available during updates        // We use 4 instead of PROFILE_HIDDEN as this constant is not available during updates
62        $ret[] = update_sql("INSERT IGNORE INTO {profile_fields} (        $ret[] = update_sql("INSERT IGNORE INTO {profile_fields} (
63          title, name, explanation, category, page, type, weight, required, register, visibility, options) VALUES          title, name, explanation, category, page, type, weight, required, register, visibility, options) VALUES
64          ('IP Address', 'user_ip_address', '', 'Statistics', '', 'textfield', 0, 0, 0, 4, '')");          ('IP Address', 'user_ip_address', '', 'Statistics', '', 'textfield', 0, 0, 0, 4, '')");
65        break;        break;
66    }    }
# Line 91  function user_stats_update_3() { Line 91  function user_stats_update_3() {
91    $ret = array();    $ret = array();
92    // We use 4 instead of PROFILE_HIDDEN as this constant is not available during updates    // We use 4 instead of PROFILE_HIDDEN as this constant is not available during updates
93    $ret[] = update_sql("INSERT INTO {profile_fields} (    $ret[] = update_sql("INSERT INTO {profile_fields} (
94      title, name, explanation, category, page, type, weight, required, register, visibility, options) VALUES      title, name, explanation, category, page, type, weight, required, register, visibility, options) VALUES
95      ('Login count', 'user_login_count', '', 'Statistics', '', 'textfield', 0, 0, 0, 4, '')");      ('Login count', 'user_login_count', '', 'Statistics', '', 'textfield', 0, 0, 0, 4, '')");
96    
97    return $ret;    return $ret;
# Line 108  function user_stats_update_4() { Line 108  function user_stats_update_4() {
108    
109    return $ret;    return $ret;
110  }  }
111    
112    /**
113     * Implementation of hook_update().
114     */
115    function user_stats_update_5() {
116      // Making variable names consistent: 'postcount' becomes 'post_count'.
117      $post_count_field = variable_get('user_stats_postcount_profile_field', 'user_post_count');
118      variable_set('user_stats_post_count_profile_field', $post_count_field);
119      variable_del('user_stats_postcount_profile_field');
120    
121    }

Legend:
Removed from v.1.1.2.6  
changed lines
  Added in v.1.1.2.7

  ViewVC Help
Powered by ViewVC 1.1.2