You are here

function googleanalytics_update_1 in Google Analytics 6.3

Same name and namespace in other branches
  1. 5 googleanalytics.install \googleanalytics_update_1()
  2. 6.4 googleanalytics.install \googleanalytics_update_1()
  3. 6 googleanalytics.install \googleanalytics_update_1()
  4. 6.2 googleanalytics.install \googleanalytics_update_1()

File

./googleanalytics.install, line 69
Installation file for Google Analytics module.

Code

function googleanalytics_update_1() {
  $ret = array();
  $result = db_query("SELECT * FROM {role}");
  while ($role = db_fetch_object($result)) {

    // can't use empty spaces in varname
    $role_varname = str_replace(' ', '_', $role->name);
    variable_set('googleanalytics_track_' . $role->rid, !variable_get("googleanalytics_track_{$role_varname}", FALSE));
    variable_del("googleanalytics_track_{$role_varname}");
  }
  variable_set('googleanalytics_track__user1', FALSE);
  return $ret;
}