}
// Get timestamp for given stats type and data
-function getTimestampFromUserStats ($type, $data, $userid = '0') {
+function getTimestampFromUserStats ($statsType, $statsData, $userid = '0') {
// Default timestamp is zero
$data['inserted'] = '0';
LIMIT 1",
array(
bigintval($userid),
- $type,
- $data
+ $statsType,
+ $statsData
), __FUNCTION__, __LINE__);
// Is the entry there?
}
// Inserts user stats
-function insertUserStatsRecord ($userid, $type, $data) {
+function insertUserStatsRecord ($userid, $statsType, $statsData) {
// Is the extension installed and updated?
if ((!isExtensionActive('sql_patches')) || (isExtensionOlder('sql_patches', '0.5.6'))) {
// Return zero here
} // END - if
// Does it exist?
- if ((!getTimestampFromUserStats($type, $data, $userid)) && (!is_array($data))) {
+ if ((!getTimestampFromUserStats($statsType, $statsData, $userid)) && (!is_array($statsData))) {
// Then insert it!
SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_stats_data` (`userid`,`stats_type`,`stats_data`) VALUES (%s,'%s','%s')",
- array(bigintval($userid), $type, $data), __FUNCTION__, __LINE__);
- } elseif (is_array($data)) {
+ array(bigintval($userid), $statsType, $statsData), __FUNCTION__, __LINE__);
+ } elseif (is_array($statsData)) {
// Invalid data!
- logDebugMessage(__FUNCTION__, __LINE__, "userid={$userid},type={$type},data={".gettype($data).": Invalid statistics data type!");
+ logDebugMessage(__FUNCTION__, __LINE__, "userid={$userid},type={$statsType},data={".gettype($statsData).": Invalid statistics data type!");
}
}