]> git.mxchange.org Git - mailer.git/blobdiff - inc/functions.php
Rewrote handling of 'menu adverts' to a filter. This allows e.g. ext-clickbanner...
[mailer.git] / inc / functions.php
index 80b004f5c43e99235acec13be6556aa5f4fff4db..1935e2a8ccedda9cacd01492dec25e57fe0f4df6 100644 (file)
@@ -648,7 +648,7 @@ function createFancyTime ($stamp) {
        } // END - foreach
 
        // Is something there?
-       if (strlen($ret) > 0) {
+       if (!empty($ret)) {
                // Remove leading commata and space
                $ret = substr($ret, 2);
        } else {
@@ -799,7 +799,9 @@ function scrambleString ($str) {
        }
 
        // Compare both lengths and abort if different
-       if (strlen($str) != count($scrambleNums)) return $str;
+       if (strlen($str) != count($scrambleNums)) {
+               return $str;
+       } // END - if
 
        // Scramble string here
        //* DEBUG: */ debugOutput('***Original=' . $str.'***<br />');
@@ -904,7 +906,7 @@ function encodeHashForCookie ($passHash) {
 
                        $mod = substr($mod, 0, 2);
                        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'idx=' . $idx . ',part1=' . $part1 . '/part2=' . $part2 . '/mod=' . $mod . '(' . strlen($mod) . ')');
-                       $mod = str_repeat('0', (2 - strlen($mod))) . $mod;
+                       $mod = str_pad($mod, 2, '0', STR_PAD_LEFT);
                        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'mod(' . ($idx * 2) . ')=' . $mod . '*');
                        $start += 2;
                        $newHash .= $mod;
@@ -1351,7 +1353,7 @@ function doHandleExtraValues ($filterFunctions, $extraValues, $key, $entries, $u
        } // END - if
 
        // Send data through the filter function if found
-       if ($key == $userIdColumn[0]) {
+       if ($key === $userIdColumn[0]) {
                // Is the userid, we have to process it with convertZeroToNull()
                $entries = convertZeroToNull($entries);
        } elseif ((!empty($filterFunctions[$key])) && (isset($extraValues[$key]))) {
@@ -1826,7 +1828,6 @@ function mapModuleToTable ($moduleName) {
                case 'login': // ... and 'login' the member's menu
                        $moduleName = 'member';
                        break;
-
                // Anything else will not be mapped, silently.
        } // END - switch
 
@@ -2316,7 +2317,7 @@ function convertStringToBoolean ($str) {
                } // END - if
 
                // Determine it
-               $GLOBALS[__FUNCTION__][$str] = (($strTrimmed == 'true') ? true : false);
+               $GLOBALS[__FUNCTION__][$str] = ($strTrimmed == 'true');
        } // END - if
 
        // Return cache