Cache will be rebuild after refback is installed
[mailer.git] / inc / mysql-manager.php
index ec203bd135a430bff0e5eb214b2c39d67a0e294f..70721b868773fb9db75e3baf9fbdf96b34ddff26 100644 (file)
@@ -1070,16 +1070,16 @@ function REMOVE_RECEIVER(&$ARRAY, $key, $uid, $pool_id, $stats_id="", $bonus=fal
        return $ret;
 }
 //
-function GET_TOTAL_DATA($search, $tableName, $lookFor, $whereStatement="userid", $onlyRows=false) {
+function GET_TOTAL_DATA($search, $tableName, $lookFor, $whereStatement="userid", $onlyRows=false, $add="") {
        $ret = 0;
        if ($onlyRows) {
                // Count rows
-               $result = SQL_QUERY_ESC("SELECT COUNT(%s) FROM "._MYSQL_PREFIX."_%s WHERE %s='%s'",
-                array($lookFor, $tableName, $whereStatement, $search), __FILE__, __LINE__);
+               $result = SQL_QUERY_ESC("SELECT COUNT(%s) FROM "._MYSQL_PREFIX."_%s WHERE %s='%s'%s",
+                array($lookFor, $tableName, $whereStatement, $search, $add), __FILE__, __LINE__);
        } else {
                // Add all rows
-               $result = SQL_QUERY_ESC("SELECT SUM(%s) FROM "._MYSQL_PREFIX."_%s WHERE %s='%s'",
-                array($lookFor, $tableName, $whereStatement, $search), __FILE__, __LINE__);
+               $result = SQL_QUERY_ESC("SELECT SUM(%s) FROM "._MYSQL_PREFIX."_%s WHERE %s='%s'%s",
+                array($lookFor, $tableName, $whereStatement, $search, $add), __FILE__, __LINE__);
        }
 
        // Load row
@@ -1303,7 +1303,7 @@ function UPDATE_REF_COUNTER ($uid) {
        } elseif ((($ref == $uid) || ($ref == 0)) && (GET_EXT_VERSION("cache") >= "0.1.2")) {
                // Remove cache here
                //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):ref={$ref} - CACHE!<br />\n";
-               if ($cacheInstance->cache_file("refsystem", true)) $cacheInstance->cache_destroy();
+               REBUILD_CACHE("refsystem", "refsystem");
        }
 
        // "Walk" back here
@@ -1853,7 +1853,7 @@ function UPDATE_CONFIG ($entries, $values, $updateMode="") {
                $entries = substr($all, 0, -1);
        } elseif (!empty($updateMode)) {
                // Update mode set
-               $entries .= sprintf("=%s%s%s", $entries, $updateMode, (float)$value);
+               $entries .= sprintf("=%s%s%s", $entries, $updateMode, (float)$values);
        } else {
                // Regular entry to update
                $entries .= sprintf("='%s'", SQL_ESCAPE($values));