]> git.mxchange.org Git - mailer.git/blobdiff - inc/functions.php
Support form fixed
[mailer.git] / inc / functions.php
index bf8b9b907b8d54041be49c64ff27013248d58243..3f5f434e2486fc8551b0b79fdde7d04d5945e099 100644 (file)
@@ -132,7 +132,7 @@ function OUTPUT_HTML($HTML, $NEW_LINE = true) {
 
                default:
                        // Huh, something goes wrong or maybe you have edited config.php ???
-                       DEBUG_LOG(__FILE__, __LINE__, sprintf("Invalid renderer %s detected.", OUTPUT_MODE));
+                       DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Invalid renderer %s detected.", OUTPUT_MODE));
                        MXCHANGE_DIE("<STRONG>".FATAL_ERROR.":</STRONG> ".LANG_NO_RENDER_DIRECT);
                        break;
                }
@@ -240,11 +240,11 @@ function LOAD_TEMPLATE($template, $return=false, $content=array()) {
        $ret = "";
        if (empty($GLOBALS['refid'])) $GLOBALS['refid'] = 0;
 
-       // @DEPRECATED Try to remove this if() block
+       // @DEPRECATED Try to rewrite the if() condition
        if ($template == "member_support_form") {
                // Support request of a member
-               $result = SQL_QUERY_ESC("SELECT gender, surname, family, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
-                array($GLOBALS['userid']), __FILE__, __LINE__);
+               $result = SQL_QUERY_ESC("SELECT userid, gender, surname, family, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+                       array($GLOBALS['userid']), __FILE__, __LINE__);
 
                // Is content an array?
                if (is_array($content)) {
@@ -259,6 +259,7 @@ function LOAD_TEMPLATE($template, $return=false, $content=array()) {
 
                        // Translate gender
                        $gender = TRANSLATE_GENDER($gender);
+                       DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("DEPRECATION-WARNING: content is not array (%s).", gettype($content)));
                }
 
                // Free result
@@ -569,7 +570,7 @@ function MAKE_DATETIME ($time, $mode="0")
                        case "2": $ret = date("d.m.Y|H:i", $time); break;
                        case "3": $ret = date("d.m.Y", $time); break;
                        default:
-                               DEBUG_LOG(__FILE__, __LINE__, sprintf("Invalid date mode %s detected.", $mode));
+                               DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Invalid date mode %s detected.", $mode));
                                break;
                }
                break;
@@ -581,7 +582,7 @@ function MAKE_DATETIME ($time, $mode="0")
                        case "2": $ret = date("y-m-d|H:i", $time); break;
                        case "3": $ret = date("y-m-d", $time); break;
                        default:
-                               DEBUG_LOG(__FILE__, __LINE__, sprintf("Invalid date mode %s detected.", $mode));
+                               DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Invalid date mode %s detected.", $mode));
                                break;
                }
        }
@@ -703,7 +704,7 @@ function TRANSLATE_STATUS($status) {
                break;
 
        default:
-               DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown status %s detected.", $status));
+               DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Unknown status %s detected.", $status));
                $ret = UNKNOWN_STATUS_1.$status.UNKNOWN_STATUS_2;
                break;
        }
@@ -1755,6 +1756,7 @@ function POST_URL ($script, $postData) {
        // Is postData an array?
        if (!is_array($postData)) {
                // Abort here
+               DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("postData is not an array. Type: %s", gettype($postData)));
                return array("", "", "");
        } // END - if
 
@@ -2383,7 +2385,7 @@ function merge_array ($array1, $array2) {
        die("</pre>");
 }
 // Debug message logger
-function DEBUG_LOG ($file, $line, $message, $force=false) {
+function DEBUG_LOG ($file, $line, $message, $force=true) {
        // Is debug mode enabled?
        if ((isBooleanConstantAndTrue('DEBUG_MODE')) || ($force)) {
                // Log this message away