Fixes for a lot bug tickets. (Sorry for lame comment)
[mailer.git] / inc / functions.php
index d47a72123e24a3c1da5190d1b5be9f351e006c39..fd8b2c5a9074c4fd388e3bb1999e6ed4f35ade1c 100644 (file)
@@ -2593,6 +2593,7 @@ function REVERT_COMMA ($str) {
        // Return float
        return $float;
 }
+
 // Handle menu-depending failed logins and return the rendered content
 function HANDLE_LOGIN_FAILTURES ($accessLevel) {
        // Default output is empty ;-)
@@ -2621,6 +2622,7 @@ function HANDLE_LOGIN_FAILTURES ($accessLevel) {
        // Return rendered content
        return $OUT;
 }
+
 // Rebuild cache
 function REBUILD_CACHE ($cache, $inc="") {
        global $cacheInstance, $CSS;
@@ -2650,6 +2652,7 @@ function REBUILD_CACHE ($cache, $inc="") {
                } // END - if
        } // END - if
 }
+
 // Purge admin menu cache
 function CACHE_PURGE_ADMIN_MENU ($id=0, $action="", $what="", $str="") {
        global $cacheInstance;
@@ -2668,8 +2671,9 @@ function CACHE_PURGE_ADMIN_MENU ($id=0, $action="", $what="", $str="") {
        }
 
        // Experiemental feature!
-       trigger_error("You have to delete the admin_*.cache files by yourself at this point.");
+       trigger_error("<strong>Experimental feature:</strong> You have to delete the admin_*.cache files by yourself at this point.");
 }
+
 // Translates the "pool type" into human-readable
 function TRANSLATE_POOL_TYPE ($type) {
        // Default type is unknown
@@ -2687,6 +2691,7 @@ function TRANSLATE_POOL_TYPE ($type) {
        // Return "translation"
        return $translated;
 }
+
 // "Getter" for remote IP number
 function GET_REMOTE_ADDR () {
        // Get remote ip from environment
@@ -2973,12 +2978,16 @@ function THEME_GET_ID ($name) {
        return $id;
 }
 
-// Increment or init with 1 the given config entry
-function incrementConfigEntry ($configEntry) {
+// Increment or init with given value or 1 as default the given config entry
+function incrementConfigEntry ($configEntry, $value=1) {
        global $_CONFIG;
 
        // Increment it if set or init it with 1
-       if (getConfig($configEntry) > 0) { $_CONFIG[$configEntry]++; } else { $_CONFIG[$configEntry] = 1; }
+       if (getConfig($configEntry) > 0) {
+               $_CONFIG[$configEntry] += $value;
+       } else {
+               $_CONFIG[$configEntry] = $value;
+       }
 }
 
 //////////////////////////////////////////////////