Changed tracking variables to use rolenames with '_' insteadof spaces.
authorMike Carter
Tue, 21 Nov 2006 14:17:54 +0000 (14:17 +0000)
committerMike Carter
Tue, 21 Nov 2006 14:17:54 +0000 (14:17 +0000)
googleanalytics.install

index b1ea771..0da7e80 100644 (file)
@@ -5,7 +5,8 @@ function googleanalytics_install() {
   $result = db_query('SELECT * FROM {role} ORDER BY name');
 
   while ($role = db_fetch_object($result)) {
-    $ga_role = "googleanalytics_track_{$role->name}";
+    $role_varname = $string = str_replace(" ", "_", $role->name);
+    $ga_role = "googleanalytics_track_{$role_varname}";
 
     //check if variable is not already set from a previous install
     if(strpos(variable_get($ga_role, 'new'), 'new') !== FALSE) {