Quote Originally Posted by dreamdaily View Post
Just in case someone is still on 1.2.x and wants to implement the Google Analytics:

Here is what needs to be done on 1.2.x:

1) Install the Mod like described in the README file.
2) Modify the core file /includes/classes/db/sql/query_factory.php:

a) Find around line 268

function queryTime() {
return $this->total_query_time;
}

}

b) Add right AFTER the function queryTime() and BEFORE the second curly brace the following code from the 1.3.x version of this file.
The final result looks like this:

function queryTime() {
return $this->total_query_time;
}

function getBindVarValue($value, $type) {
$typeArray = explode(':',$type);
$type = $typeArray[0];
switch ($type) {
case 'csv':
return $value;
break;
case 'passthru':
return $value;
break;
case 'float':
return (!zen_not_null($value) || $value=='' || $value == 0) ? 0 : $value;
break;
case 'integer':
return (int)$value;
break;
case 'string':
if (isset($typeArray[1])) {
$regexp = $typeArray[1];
}
return '\'' . $this->prepare_input($value) . '\'';
break;
case 'noquotestring':
return $this->prepare_input($value);
break;
case 'currency':
return '\'' . $this->prepare_input($value) . '\'';
break;
case 'date':
return '\'' . $this->prepare_input($value) . '\'';
break;
case 'enum':
if (isset($typeArray[1])) {
$enumArray = explode('|', $typeArray[1]);
}
return '\'' . $this->prepare_input($value) . '\'';
default:
die('var-type undefined: ' . $type . '('.$value.')');
}
}
/**
* method to do bind variables to a query
**/
function bindVars($sql, $bindVarString, $bindVarValue, $bindVarType, $debug = false) {
$bindVarTypeArray = explode(':', $bindVarType);
$sqlNew = $this->getBindVarValue($bindVarValue, $bindVarType);
$sqlNew = str_replace($bindVarString, $sqlNew, $sql);
return $sqlNew;
}

function prepareInput($string) {
return @mysql_real_escape_string($string);
}
}


It seems to be working without a glitch on the 1.2.5 code.

All the best,
--dreamdaily

hi all...

i just followed these steps as i'm running 1.2.4 and it doesn't seem to be working.

Before doing the additional change that dreamdaily suggests, it all functioned properly, but on Google Analytics it said i wasn't configured properly, and wasn't set up yet...

I then tried dreamdaily's suggestion for 1.2.x users, and i couldn't load a single thing (admin or catalog) as it said there was an error in my query_factory file...
any suggestions cuda?