]> git.mxchange.org Git - mailer.git/commitdiff
New debugging function debugOutput() introduced, some rewrites to EL:
authorquix0r <quix0r@mxchange.org>
Wed, 23 Jun 2010 21:38:33 +0000 (21:38 +0000)
committerquix0r <quix0r@mxchange.org>
Wed, 23 Jun 2010 21:38:33 +0000 (21:38 +0000)
- New debugging function debugOutput() added, this function does output any
  XHTML message in a div-block to the browser.
- Some more rewrites to EL
- TODOs.txt updated

31 files changed:
DOCS/TODOs.txt
birthday_confirm.php
inc/classes/cachesystem.class.php
inc/config-functions.php
inc/db/lib-mysql3.php
inc/extensions-functions.php
inc/filters.php
inc/fix_menu.php
inc/functions.php
inc/gen_refback.php
inc/inc-functions.php
inc/language-functions.php
inc/libs/admins_functions.php
inc/libs/rallye_functions.php
inc/libs/surfbar_functions.php
inc/libs/wernis_functions.php
inc/modules/admin/admin-inc.php
inc/modules/admin/overview-inc.php
inc/modules/admin/what-del_email.php
inc/modules/admin/what-list_rallyes.php
inc/modules/admin/what-list_refs.php
inc/modules/guest/what-register.php
inc/mysql-manager.php
inc/pool/pool-bonus.php
inc/pool/pool-user.php
inc/reset/reset_daily.php
inc/revision-functions.php
inc/sql-functions.php
inc/wrapper-functions.php
templates/de/html/admin/admin_list_rallye_usr_row.tpl
templates/de/html/admin/admin_list_rallyes_row.tpl

index be9e927d472068893ba2635be6e730f6d27a3d05..334942e56b6f65018ee7d17db75ce0438d9de701 100644 (file)
 ./inc/extensions-functions.php:143:    // @TODO Do we still need this? setExtensionUpdateNotes('');
 ./inc/extensions-functions.php:423:// @TODO Change from ext_id to ext_name (not just even the variable! ;-) )
 ./inc/extensions-functions.php:539:            // @TODO Extension is loaded, what next?
-./inc/functions.php:1052:// @TODO $simple/$constants are deprecated
-./inc/functions.php:1079:      // @TODO Do only use $content and deprecate $GLOBALS and $DATA in templates
-./inc/functions.php:2412:      // @TODO This can be easily moved out after the merge from EL branch to this is complete
-./inc/functions.php:2561:              // @TODO Add a little more infos here
-./inc/functions.php:2644:                      // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ?
-./inc/functions.php:2667:                      // @TODO Rewrite this old lost code to a template
+./inc/functions.php:1078:// @TODO $simple/$constants are deprecated
+./inc/functions.php:1105:      // @TODO Do only use $content and deprecate $GLOBALS and $DATA in templates
+./inc/functions.php:2382:      // @TODO This can be easily moved out after the merge from EL branch to this is complete
+./inc/functions.php:2531:              // @TODO Add a little more infos here
+./inc/functions.php:2615:                      // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ?
+./inc/functions.php:2638:                      // @TODO Rewrite this old lost code to a template
 ./inc/functions.php:266:       // @TODO Remove this sanity-check if all is fine
 ./inc/functions.php:269:       // @TODO Try to rewrite all $DATA to $content
-./inc/functions.php:2757:                      // @TODO Are these convertions still required?
-./inc/functions.php:2775:// @TODO Rewrite this function to use readFromFile() and writeToFile()
-./inc/functions.php:3651:// @TODO Lame description for this function
-./inc/functions.php:3670:                      // @TODO Move this in a filter
-./inc/functions.php:3794:      // @TODO This is still very static, rewrite it somehow
-./inc/functions.php:478:       // @TODO Do only use $content, not $DATA or raw variables
-./inc/functions.php:548:               // @TODO Extension 'msg' does not exist
-./inc/functions.php:611:// @TODO Rewrite this to an extension 'smtp'
+./inc/functions.php:2728:                      // @TODO Are these convertions still required?
+./inc/functions.php:2746:// @TODO Rewrite this function to use readFromFile() and writeToFile()
+./inc/functions.php:3622:// @TODO Lame description for this function
+./inc/functions.php:3641:                      // @TODO Move this in a filter
+./inc/functions.php:3765:      // @TODO This is still very static, rewrite it somehow
+./inc/functions.php:482:       // @TODO Do only use $content, not $DATA or raw variables
+./inc/functions.php:555:               // @TODO Extension 'msg' does not exist
+./inc/functions.php:618:// @TODO Rewrite this to an extension 'smtp'
 ./inc/install-functions.php:63:        // @TODO DEACTIVATED: changeDataInFile(getConfig('CACHE_PATH') . 'config-local.php', 'OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestParameter('omode'), 0);
 ./inc/language/de.php:1143:// @TODO Rewrite these two constants
 ./inc/language/de.php:1158:// @TODO Rewrite these three constants
@@ -77,7 +77,7 @@
 ./inc/libs/rallye_functions.php:708:// @TODO This function does not load min_users, min_prices, please encapsulate loading rallye data with e.g. getRallyeDataFromId()
 ./inc/libs/rallye_functions.php:779:   $EXPIRE = 3; // @TODO The hard-coded value...
 ./inc/libs/rallye_functions.php:865:// @TODO Please document this function
-./inc/libs/rallye_functions.php:923:           // Load count @TODO Can't we rewrite this to our API?
+./inc/libs/rallye_functions.php:921:           // Load count @TODO Can't we rewrite this to our API?
 ./inc/libs/refback_functions.php:61:           // @TODO Try to rewrite the following unset()
 ./inc/libs/register_functions.php:299: // @TODO Rewrite these all to a single filter
 ./inc/libs/register_functions.php:375: // @TODO Rewrite this to a filter
 ./inc/modules/admin/what-list_links.php:57:            // @TODO Try to rewrite this to a filter
 ./inc/modules/admin/what-list_links.php:89:                            // @TODO Find a way to rewrite this. See some lines above for different queries
 ./inc/modules/admin/what-list_links.php:98:                                    // @TODO Rewrite this to includes/filter
-./inc/modules/admin/what-list_rallyes.php:258:                 // @TODO Rewritings: opoints->curr_points,old->refs in template
 ./inc/modules/admin/what-list_refs.php:110:                                                            // @TODO Try to rewrite some to EL
 ./inc/modules/admin/what-list_task.php:146:            // @TODO Rewrite these templates to one and add $OUT
 ./inc/modules/admin/what-list_task.php:180:                    // @TODO Rewritings: admin->assigned_admin,userid->userid,type->task_type_msg in template
 ./inc/modules/member/what-unconfirmed.php:143: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
 ./inc/modules/order.php:76:            // @TODO Unused: 2,4
 ./inc/monthly/monthly_bonus.php:69:    // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1590:                  // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
-./inc/mysql-manager.php:1690:  // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:2070:                  // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:2111:// @TODO Fix inconsistency between last_module and getWhat()
+./inc/mysql-manager.php:1627:                  // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
+./inc/mysql-manager.php:1727:  // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:2107:                  // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:2148:// @TODO Fix inconsistency between last_module and getWhat()
 ./inc/mysql-manager.php:229:                   // @TODO Nothing helped???
 ./inc/mysql-manager.php:264:                   // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:563:   // @TODO Try to rewrite this to one or more functions
+./inc/mysql-manager.php:589:   // @TODO Try to rewrite this to one or more functions
 ./inc/mysql-manager.php:94:// @TODO Can we cache this?
 ./inc/reset/reset_beg.php:51:// @TODO This should be converted in a daily beg rallye
 ./inc/reset/reset_birthday.php:92:                     // @TODO 4 is hard-coded here, should we move it out in config?
 ./inc/wrapper-functions.php:134:// @TODO Implement $decompress
 ./inc/wrapper-functions.php:455:// @TODO Do some more sanity check here
 ./inc/wrapper-functions.php:793:        * @TODO Do we really need this check? If yes, try to fix this:
-./mailid.php:135:                                      // @TODO Rewrite this to a filter
+./mailid.php:138:                                      // @TODO Rewrite this to a filter
 ./mailid.php:95:               // @TODO Rewrite this to a filter
 ./mailid_top.php:132:                                  // @TODO Rewrite this to a filter
 ./mailid_top.php:179:                                                  // @TODO Rewrite this to a filter
index 7b5bffac08891a8b1b4cd89e48acd5e35c8290e8..b06b0c71d17741272935231faa1137c32fe0cca4 100644 (file)
@@ -79,7 +79,7 @@ LIMIT 1",
                $userid,
                $chk
        ), __FILE__, __LINE__);
-//* DEBUG: */ outputHtml("userid=".$userid.",chk=".$chk." (".strlen($chk).'/'.strlen(getRequestParameter('check')).'/'.SQL_NUMROWS($result).")<br />");
+//* DEBUG: */ debugOutput("userid=".$userid.",chk=".$chk." (".strlen($chk).'/'.strlen(getRequestParameter('check')).'/'.SQL_NUMROWS($result) . ')');
 
 // Prepare content
 $content = array();
index 4c4878aa574e6b4811b44e785b5b58d6dc2007e8..929b8cbb7d82906fb8de55f7e1256bf1d6c47374 100644 (file)
@@ -90,10 +90,10 @@ class CacheSystem {
                        // Pre-fetch cache here if found
                        if ($this->isCacheReadable()) $this->getArrayFromCache();
 
-                       //* DEBUG: */ print($cacheName.'='.intval($this->isCacheReadable()).'/'.intval(is_writeable($this->fqfn)).'/'.intval($this->extensionVersionMatches('cache')).'<br />');
+                       //* DEBUG: */ debugOutput('cacheName='.$cacheName.',isCacheReadable='.intval($this->isCacheReadable()).',is_writeable='.intval(is_writeable($this->fqfn)).',extensionMatches='.intval($this->extensionVersionMatches('cache')));
                        $this->status[$cacheName] = ($this->isCacheReadable() && (is_writeable($this->fqfn)) && ($this->extensionVersionMatches('cache')));
                } // END - if
-               //* DEBUG: */ print($cacheName.'='.intval($this->status[$cacheName]).'<br />');
+               //* DEBUG: */ debugOutput('cacheName='.$cacheName.',status='.intval($this->status[$cacheName]));
 
                // Return status
                return $this->status[$cacheName];
@@ -221,7 +221,7 @@ class CacheSystem {
                        // Remove pointer and status
                        unset($this->status[$this->name]);
                        $this->pointer = false;
-                       //* DEBUG: */ outputHtml(__METHOD__ . '(<font color="#0000aa">' . __LINE__."</font>): {$this->name} - FINALIZED!<br />");
+                       //* DEBUG: */ debugOutput(__METHOD__ . '(<font color="#0000aa">' . __LINE__.'</font>): '.$this->name.' - FINALIZED!');
                } // END - if
        }
 
@@ -427,7 +427,7 @@ class CacheSystem {
                                // Write cache line to file
                                fwrite($this->pointer, $this->rewriteEntry($ext_name, $ext_ver, 'version', true));
                        } // END - if
-                       //* DEBUG: */ outputHtml(__METHOD__ . '(<font color="#0000aa">' . __LINE__."</font>): {$this->name} - {$ext_name}={$ext_ver}<br />");
+                       //* DEBUG: */ debugOutput(__METHOD__ . '(<font color="#0000aa">' . __LINE__ . '</font>): '.$this->name.' - '.$ext_name.'='.$ext_ver);
                } else {
                        // Cannot create file
                        addFatalMessage(__METHOD__, __LINE__, '(<font color="#0000aa">' . __LINE__ . '</font>): {--CACHE_PROBLEMS_DETECTED');
index b32fcf713f01eb49bd9562ada8e074fa79dd480f..918ce0fb39904e63c5c3edcfd4c974e3569f4cb5 100644 (file)
@@ -94,7 +94,7 @@ function setConfigEntry ($configEntry, $value) {
 
 // Checks wether the given config entry is set
 function isConfigEntrySet ($configEntry) {
-       //* DEBUG: */ print __FUNCTION__.':'.$configEntry.'='.intval(isset($GLOBALS['config'][$configEntry])).'<br />';
+       //* DEBUG: */ debugOutput(__FUNCTION__.':'.$configEntry.'='.intval(isset($GLOBALS['config'][$configEntry])));
        return (isset($GLOBALS['config'][$configEntry]));
 }
 
@@ -198,7 +198,7 @@ function updateOldConfigFile () {
                        // Is the line found?
                        if ((substr($line, 0, strlen($old)) == $old) && (!isset($done[$old]))) {
                                // Entry found!
-                               //* DEBUG: */ outputHtml(secureString($line) . " - FOUND!<br />");
+                               //* DEBUG: */ debugOutput(secureString($line) . ' - FOUND!');
 
                                // Eval the line...
                                eval($line);
@@ -223,9 +223,9 @@ function updateOldConfigFile () {
                                } // END - if
 
                                /// ... and write it to the new config
-                               //* DEBUG: */ outputHtml('function=' . $function . ',new=' . $new . ',comment=' . $comment . "<br />");
+                               //* DEBUG: */ debugOutput('function=' . $function . ',new=' . $new . ',comment=' . $comment);
                                changeDataInFile(getConfig('CACHE_PATH') . 'config-local.php', $comment, $function . "('" . $oldNew . "', \"", '");', constant($new), 0);
-                               //* DEBUG: */ outputHtml("CHANGED!<br />");
+                               //* DEBUG: */ debugOutput('CHANGED!');
 
                                // Mark it as done
                                $done[$old] = 1;
@@ -256,7 +256,7 @@ function updateOldConfigFile () {
                        }
 
                        // Debug output only
-                       //* DEBUG: */ outputHtml(secureString($line) . " - MySQL!<br />");
+                       //* DEBUG: */ debugOutput(secureString($line) . ' - MySQL!');
 
                        // Split parts so we can check them and prepare them
                        $parts = explode('=>', $line);
index 64db7499ab93fb7174215270ab802d58c30cf3a4..8880bef74aac03d79d985d0bb6be5132bab1334e 100644 (file)
@@ -79,7 +79,7 @@ function SQL_QUERY ($sqlString, $F, $L) {
        $querytimeBefore = microtime(true);
 
        // Run SQL command
-       //* DEBUG: */ print('F=' . basename($F) . ',L=' . $L . 'sql=' . htmlentities($GLOBALS['last_sql']) . '<br />');
+       //* DEBUG: */ debugOutput('F=' . basename($F) . ',L=' . $L . 'sql=' . htmlentities($GLOBALS['last_sql']));
        $result = mysql_query($GLOBALS['last_sql'], SQL_GET_LINK())
                or debug_report_bug($F, $L, 'file='. $F . ',line=' . $L . ':mysql_error()=' . mysql_error() . "\n".
 'Query string:' . $GLOBALS['last_sql']);
@@ -411,7 +411,7 @@ function SQL_ALTER_TABLE ($sql, $F, $L) {
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("Skipped FULLTEXT: sql=%s,file=%s,line=%s", $sql, $F, $L));
        } elseif ($noIndex === false) {
                // And column name as well
-               //* DEBUG: */ print __LINE__.':tableArray=<pre>' . print_r($tableArray, true) . '</pre>';
+               //* DEBUG: */ debugOutput(__LINE__.':tableArray=<pre>' . print_r($tableArray, true) . '</pre>');
                $keyName = str_replace('`', '', $tableArray[5]);
 
                // Is this "UNIQUE" or so? FULLTEXT has been handled the elseif() block above
@@ -448,7 +448,7 @@ function SQL_ALTER_TABLE ($sql, $F, $L) {
                // Walk through all
                while ($content = SQL_FETCHARRAY($result)) {
                        // Is it found?
-                       //* DEBUG: */ print(__LINE__.':columnName='.$keyName.',content=<pre>' . print_r($content, true) . '</pre>');
+                       //* DEBUG: */ debugOutput(__LINE__.':columnName='.$keyName.',content=<pre>' . print_r($content, true) . '</pre>');
                        if (($content['Key_name'] == $keyName) && ($tableArray[3] == 'ADD')) {
                                // Skip this query!
                                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("ADD: Skiped: %s", $sql));
index 8d981e3e24580047b42e35c56ab4758012a16840..fd17c33bd1149abf4546e74a0e0356b404d271e4 100644 (file)
@@ -279,7 +279,7 @@ function registerExtension ($ext_name, $task_id, $dry_run = false, $logout = tru
                                                // Reset extension name
                                                setCurrentExtensionName($ext_name);
                                                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName());
-                                               //* DEBUG: */ print getCurrentExtensionName().':<pre>' . print_r($test, true) . '</pre>';
+                                               //* DEBUG: */ debugOutput(getCurrentExtensionName().':<pre>' . print_r($test, true) . '</pre>');
                                        } // END - if
                                } elseif ($ext_ver != getCurrentExtensionVersion()) {
                                        // Ok, update this extension now
@@ -320,10 +320,10 @@ function registerExtension ($ext_name, $task_id, $dry_run = false, $logout = tru
 
                // Remains true if extension registration reports no failures
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName());
-               //* DEBUG: */ print getCurrentExtensionName().':<pre>' . print_r($test, true) . '</pre>';
+               //* DEBUG: */ debugOutput(getCurrentExtensionName().':<pre>' . print_r($test, true) . '</pre>');
                $test = (($test === true) && (getExtensionReportsFailure() === false));
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName());
-               //* DEBUG: */ print getCurrentExtensionName().':<pre>' . print_r($test, true) . '</pre>';
+               //* DEBUG: */ debugOutput(getCurrentExtensionName().':<pre>' . print_r($test, true) . '</pre>');
 
                // Does everthing before wents ok?
                if ($test === true) {
@@ -415,7 +415,7 @@ function registerExtension ($ext_name, $task_id, $dry_run = false, $logout = tru
 
        // Return status code
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName() . ',ext_name=' . $ext_name . ' - EXIT!');
-       //* DEBUG: */ print getCurrentExtensionName().':<pre>'.print_r($ret, true).'</pre>';
+       //* DEBUG: */ debugOutput(getCurrentExtensionName().':<pre>'.print_r($ret, true).'</pre>');
        return $ret;
 }
 
@@ -648,7 +648,7 @@ function updateExtension ($ext_name, $ext_ver, $dry_run = false) {
        initExtensionSqls();
 
        // Check if version is updated
-       //* DEBUG: */ print getCurrentExtensionName().'/'.$ext_name.':'.getThisExtensionVersion().'/'.$ext_ver.'/'.intval(is_array($history)).'<br />';
+       //* DEBUG: */ debugOutput(getCurrentExtensionName().'/'.$ext_name.':'.getThisExtensionVersion().'/'.$ext_ver.'/'.intval(is_array($history)));
        if (((getThisExtensionVersion() != $ext_ver) || (getExtensionDryRun())) && (is_array($history))) {
                // Search for starting point
                $start = array_search($ext_ver, $history);
@@ -1546,7 +1546,7 @@ function getExtensionMode () {
 
 // Setter for dry-run
 function enableExtensionDryRun ($dry_run = true) {
-       //* DEBUG: */ print __FUNCTION__.': '.getCurrentExtensionName().'='.intval($dry_run).'<br />';
+       //* DEBUG: */ debugOutput(__FUNCTION__.': '.getCurrentExtensionName().'='.intval($dry_run));
        $GLOBALS['ext_dry_run'] = (bool) $dry_run;
 }
 
index 6b33ba7f8a117af4cc7d0815ccb818c4f1e3d7d7..1d96aa316c814c10171bb7fa0324e03afe017154 100644 (file)
@@ -79,15 +79,15 @@ function FILTER_FLUSH_FILTERS () {
                // Walk through all filters
                foreach ($filterArray as $filterFunction => $active) {
                        // Is this filter loaded?
-                       //* DEBUG: */ print 'FOUND:'.$filterName.'/'.$filterFunction.'='.$active.'<br />';
+                       //* DEBUG: */ debugOutput('FOUND:'.$filterName.'/'.$filterFunction.'='.$active);
                        if (((!isset($GLOBALS['cache_array']['filter']['loaded'][$filterName][$filterFunction])) && ($active != 'R')) || ($active == 'A')) {
                                // Add this filter (all filters are active by default)
-                               //* DEBUG: */ print 'ADD:'.$filterName.'/'.$filterFunction.'<br />';
+                               //* DEBUG: */ debugOutput('ADD:'.$filterName.'/'.$filterFunction);
                                $insertSQL .= sprintf("('%s','%s','Y'),", $filterName, $filterFunction);
                                $inserted++;
                        } elseif ($active == 'R') {
                                // Remove this filter
-                               //* DEBUG: */ print 'REMOVE:'.$filterName.'/'.$filterFunction.'<br />';
+                               //* DEBUG: */ debugOutput('REMOVE:'.$filterName.'/'.$filterFunction);
                                $removeSQL .= sprintf(" (`filter_name`='%s' AND `filter_function`='%s') OR", $filterName, $filterFunction);
                                $removed++;
                        }
@@ -435,8 +435,8 @@ function FILTER_COMPILE_CONFIG ($code, $compiled = false) {
        // Should we compile it?
        if ($compiled === true) {
                // Run the code
-               $eval = "\$GLOBALS['compiled_config'][\$uncompiled] = \"" . $GLOBALS['compiled_config'][$uncompiled] . "\";";
-               //* DEBUG: */ print(__FUNCTION__.'['.__LINE__.']:<pre>' . str_replace('$', '&#36;', htmlentities($eval)) . '</pre>');
+               $eval = "\$GLOBALS['compiled_config'][\$uncompiled] = \"" . $GLOBALS['compiled_config'][$uncompiled] . '";';
+               //* DEBUG: */ debugOutput(__FUNCTION__.'['.__LINE__.']:<pre>' . str_replace('$', '&#36;', htmlentities($eval)) . '</pre>');
                eval($eval);
        } // END - if
 
@@ -449,7 +449,7 @@ function FILTER_COMPILE_EXPRESSION_CODE ($code) {
        // Compile {%cmd,callback,extraFunction=some_value%} to get expression code snippets
        // See switch() command below for supported commands
        preg_match_all('/\{%(([a-zA-Z0-9-_,]+)(=([^\}]+)){0,1})*%\}/', $code, $matches);
-       //* DEBUG: */ print(__FUNCTION__.'['.__LINE__.']:<pre>'.print_r($matches, true).'</pre>');
+       //* DEBUG: */ debugOutput(__FUNCTION__.'['.__LINE__.']:<pre>'.print_r($matches, true).'</pre>');
 
        // Default is from outputHtml()
        $outputMode = getOutputMode();
@@ -500,7 +500,7 @@ function FILTER_COMPILE_EXPRESSION_CODE ($code) {
                                );
 
                                // Call it
-                               //* DEBUG: */ print __FUNCTION__ . '[' . __LINE__ . ']: function=' . $commandFunction . "<br />\n";
+                               //* DEBUG: */ debugOutput(__FUNCTION__ . '[' . __LINE__ . ']: function=' . $commandFunction);
                                $code = call_user_func($commandFunction, $data);
                        } else {
                                // Unsupported command detected
@@ -513,7 +513,7 @@ function FILTER_COMPILE_EXPRESSION_CODE ($code) {
        if ((getOutputMode() != '0') || ($outputMode != '0')) $code = decodeEntities($code);
 
        // Return compiled code
-       //* DEBUG: */ print(__FUNCTION__.'['.__LINE__.']:<pre>'.($code).'</pre>');
+       //* DEBUG: */ debugOutput(__FUNCTION__.'['.__LINE__.']:<pre>'.($code).'</pre>');
        return $code;
 }
 
@@ -652,7 +652,7 @@ function FILTER_DETERMINE_WHAT_ACTION () {
        }
 
        // Set default 'what' value
-       //* DEBUG: */ outputHtml('-'.getModule().'/'.getWhat()."-<br />");
+       //* DEBUG: */ debugOutput('-' . getModule() . '/' . getWhat() . '-');
        if ((!isWhatSet()) && (!isActionSet()) && (getOutputMode() != 1) && (getOutputMode() != -1)) {
                if (getModule() == 'admin') {
                        // Set 'action' value to 'login' in admin menu
index 1fb3d21da5556be767ecd2a2966a4f7f15ce687f..469e22dee847c87bbf835f752ce9472f89bcc13b 100644 (file)
@@ -66,7 +66,7 @@ foreach (array('guest','member','admin') as $menu) {
                                // Sub menu
                                $entries = countSumTotalData($entry['action'], $menu . '_menu', 'action', 'action', true, sprintf(" AND `what`='%s'", $entry['what']));
                        }
-                       //* DEBUG: */ print 'menu='.$menu.',action='.$entry['action'].',what='.$entry['what'].',entries='.$entries.'<br />';
+                       //* DEBUG: */ debugOutput('menu='.$menu.',action='.$entry['action'].',what='.$entry['what'].',entries='.$entries);
 
                        // Only remove if we have at least 2 entries from same menu
                        if ($entries > 1) {
index 98533a8799a6433ba4fcccbf6e4a935a7a905457..cfde41fa538b8be08c2cf5e7ec03a64c3cb625a6 100644 (file)
@@ -184,7 +184,7 @@ function doFinalCompilation ($code, $insertComments = true) {
                $newContent = '';
 
                // Compile it
-               //* DEBUG: */ print '<pre>'.htmlentities($code).'</pre>';
+               //* DEBUG: */ debugOutput('<pre>'.htmlentities($code).'</pre>');
                $eval = '$newContent = "' . str_replace('{DQUOTE}', '"', compileCode(escapeQuotes($code))) . '";';
                //* DEBUG: */ if ($insertComments) die('<pre>'.linenumberCode($eval).'</pre>');
                eval($eval);
@@ -454,7 +454,7 @@ function loadEmailTemplate ($template, $content = array(), $userid = '0') {
        } // END - if
 
        // Load user's data
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "UID={$userid},template={$template},content[]=".gettype($content).'<br />');
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "UID={$userid},template={$template},content[]=".gettype($content));
        if (($userid > 0) && (is_array($content))) {
                // If nickname extension is installed, fetch nickname as well
                if ((isExtensionActive('nickname')) && (isNicknameUsed($userid))) {
@@ -1460,7 +1460,7 @@ function createTimeSelections ($timestamp, $prefix = '', $display = '', $align =
 
        // Calculate 2-seconds timestamp
        $stamp = round($timestamp);
-       //* DEBUG: */ print('*' . $stamp .'/' . $timestamp . '*<br />');
+       //* DEBUG: */ debugOutput('*' . $stamp .'/' . $timestamp . '*');
 
        // Do we have a leap year?
        $SWITCH = '0';
@@ -1473,25 +1473,25 @@ function createTimeSelections ($timestamp, $prefix = '', $display = '', $align =
 
        // First of all years...
        $Y = abs(floor($timestamp / (31536000 + $SWITCH)));
-       //* DEBUG: */ print("Y={$Y}<br />");
+       //* DEBUG: */ debugOutput('Y=' . $Y);
        // Next months...
        $M = abs(floor($timestamp / 2628000 - $Y * 12));
-       //* DEBUG: */ print("M={$M}<br />");
+       //* DEBUG: */ debugOutput('M=' . $M);
        // Next weeks
        $W = abs(floor($timestamp / 604800 - $Y * ((365 + $SWITCH / getConfig('ONE_DAY')) / 7) - ($M / 12 * (365 + $SWITCH / getConfig('ONE_DAY')) / 7)));
-       //* DEBUG: */ print("W={$W}<br />");
+       //* DEBUG: */ debugOutput('W=' . $W);
        // Next days...
        $D = abs(floor($timestamp / 86400 - $Y * (365 + $SWITCH / getConfig('ONE_DAY')) - ($M / 12 * (365 + $SWITCH / getConfig('ONE_DAY'))) - $W * 7));
-       //* DEBUG: */ print("D={$D}<br />");
+       //* DEBUG: */ debugOutput('D=' . $D);
        // Next hours...
        $h = abs(floor($timestamp / 3600 - $Y * (365 + $SWITCH / getConfig('ONE_DAY')) * 24 - ($M / 12 * (365 + $SWITCH / getConfig('ONE_DAY')) * 24) - $W * 7 * 24 - $D * 24));
-       //* DEBUG: */ print("h={$h}<br />");
+       //* DEBUG: */ debugOutput('h=' . $h);
        // Next minutes..
        $m = abs(floor($timestamp / 60 - $Y * (365 + $SWITCH / getConfig('ONE_DAY')) * 24 * 60 - ($M / 12 * (365 + $SWITCH / getConfig('ONE_DAY')) * 24 * 60) - $W * 7 * 24 * 60 - $D * 24 * 60 - $h * 60));
-       //* DEBUG: */ print("m={$m}<br />");
+       //* DEBUG: */ debugOutput('m=' . $m);
        // And at last seconds...
        $s = abs(floor($timestamp - $Y * (365 + $SWITCH / getConfig('ONE_DAY')) * 24 * 3600 - ($M / 12 * (365 + $SWITCH / getConfig('ONE_DAY')) * 24 * 3600) - $W * 7 * 24 * 3600 - $D * 24 * 3600 - $h * 3600 - $m * 60));
-       //* DEBUG: */ print("s={$s}<br />");
+       //* DEBUG: */ debugOutput('s=' . $s);
 
        // Is seconds zero and time is < 60 seconds?
        if (($s == '0') && ($timestamp < 60)) {
@@ -1732,7 +1732,7 @@ function extractHostnameFromUrl (&$script) {
        if (isInString('/', $host)) $host = substr($host, 0, strpos($host, '/'));
 
        // Generate relative URL
-       //* DEBUG: */ print('SCRIPT=' . $script.'<br />');
+       //* DEBUG: */ debugOutput('SCRIPT=' . $script);
        if (substr(strtolower($script), 0, 7) == 'http://') {
                // But only if http:// is in front!
                $script = substr($script, (strlen($url) + 7));
@@ -1741,7 +1741,7 @@ function extractHostnameFromUrl (&$script) {
                $script = substr($script, (strlen($url) + 8));
        }
 
-       //* DEBUG: */ print('SCRIPT=' . $script.'<br />');
+       //* DEBUG: */ debugOutput('SCRIPT=' . $script);
        if (substr($script, 0, 1) == '/') $script = substr($script, 1);
 
        // Return host name
@@ -1855,7 +1855,7 @@ function sendRawRequest ($host, $request) {
        $resolver = new HostnameResolver();
 
        // Open connection
-       //* DEBUG: */ die('SCRIPT=' . $script.'<br />');
+       //* DEBUG: */ die('SCRIPT=' . $script);
        if ($useProxy === true) {
                // Resolve hostname into IP address
                $ip = $resolver->resolveHostname(compileRawCode(getConfig('proxy_host')));
@@ -1955,8 +1955,8 @@ function sendRawRequest ($host, $request) {
                }
        } // END - foreach
 
-       //* DEBUG: */ print('<strong>Request:</strong><pre>'.print_r($request, true).'</pre>');
-       //* DEBUG: */ print('<strong>Response:</strong><pre>'.print_r($response, true).'</pre>');
+       //* DEBUG: */ debugOutput('<strong>Request:</strong><pre>'.print_r($request, true).'</pre>');
+       //* DEBUG: */ debugOutput('<strong>Response:</strong><pre>'.print_r($response, true).'</pre>');
 
        // Proxy agent found or something went wrong?
        if (!isset($response[0])) {
@@ -1998,7 +1998,7 @@ function setupProxyTunnel ($host, $resource) {
 
        // Add last new-line
        $proxyTunnel .= getConfig('HTTP_EOL');
-       //* DEBUG: */ print('<strong>proxyTunnel=</strong><pre>' . $proxyTunnel.'</pre>');
+       //* DEBUG: */ debugOutput('<strong>proxyTunnel=</strong><pre>' . $proxyTunnel.'</pre>');
 
        // Write request
        fwrite($fp, $proxyTunnel);
@@ -2040,11 +2040,11 @@ function isEmailValid ($email) {
 function isUrlValid ($URL, $compile=true) {
        // Trim URL a little
        $URL = trim(urldecode($URL));
-       //* DEBUG: */ outputHtml($URL.'<br />');
+       //* DEBUG: */ debugOutput($URL);
 
        // Compile some chars out...
        if ($compile === true) $URL = compileUriCode($URL, false, false, false);
-       //* DEBUG: */ outputHtml($URL.'<br />');
+       //* DEBUG: */ debugOutput($URL);
 
        // Check for the extension filter
        if (isExtensionActive('filter')) {
@@ -2070,7 +2070,7 @@ function generateMemberAdminActionLinks ($userid, $status = '') {
 
        foreach ($targetArray as $tar) {
                $OUT .= '<span class="admin_user_link"><a href="{%url=modules.php?module=admin&amp;what=' . $tar . '&amp;userid=' . $userid . '%}" title="{--ADMIN_LINK_';
-               //* DEBUG: */ outputHtml('*' . $tar.'/' . $status.'*<br />');
+               //* DEBUG: */ debugOutput('*' . $tar.'/' . $status.'*');
                if (($tar == 'lock_user') && ($status == 'LOCKED')) {
                        // Locked accounts shall be unlocked
                        $OUT .= 'UNLOCK_USER';
@@ -2123,7 +2123,7 @@ function generateEmailLink ($email, $table = 'admins') {
 // Generate a hash for extra-security for all passwords
 function generateHash ($plainText, $salt = '', $hash = true) {
        // Debug output
-       //* DEBUG: */ outputHtml('plainText=' . $plainText . ',salt=' . $salt . ',hash='.intval($hash).'<br />');
+       //* DEBUG: */ debugOutput('plainText=' . $plainText . ',salt=' . $salt . ',hash='.intval($hash));
 
        // Is the required extension 'sql_patches' there and a salt is not given?
        // 0123                            4                      43    3     4     432    2                  3             32    2                             3                3210
@@ -2160,20 +2160,20 @@ function generateHash ($plainText, $salt = '', $hash = true) {
 
                // Generate SHA1 sum from modula of number and the prime number
                $sha1 = sha1(($a % getConfig('_PRIME')) . $server . getConfig('ENCRYPT_SEPERATOR') . $keys . getConfig('ENCRYPT_SEPERATOR') . $data . getConfig('ENCRYPT_SEPERATOR') . getConfig('DATE_KEY') . getConfig('ENCRYPT_SEPERATOR') . $a);
-               //* DEBUG: */ outputHtml('SHA1=' . $sha1.' ('.strlen($sha1).')<br />');
+               //* DEBUG: */ debugOutput('SHA1=' . $sha1.' ('.strlen($sha1).')<br />');
                $sha1 = scrambleString($sha1);
-               //* DEBUG: */ outputHtml('Scrambled=' . $sha1.' ('.strlen($sha1).')<br />');
+               //* DEBUG: */ debugOutput('Scrambled=' . $sha1.' ('.strlen($sha1).')<br />');
                //* DEBUG: */ $sha1b = descrambleString($sha1);
-               //* DEBUG: */ outputHtml('Descrambled=' . $sha1b.' ('.strlen($sha1b).')<br />');
+               //* DEBUG: */ debugOutput('Descrambled=' . $sha1b.' ('.strlen($sha1b).')<br />');
 
                // Generate the password salt string
                $salt = substr($sha1, 0, getConfig('salt_length'));
-               //* DEBUG: */ outputHtml($salt.' ('.strlen($salt).')<br />');
+               //* DEBUG: */ debugOutput($salt.' ('.strlen($salt).')<br />');
        } else {
                // Use given salt
-               //* DEBUG: */ outputHtml('salt=' . $salt . '<br />');
+               //* DEBUG: */ debugOutput('salt=' . $salt);
                $salt = substr($salt, 0, getConfig('salt_length'));
-               //* DEBUG: */ outputHtml('salt=' . $salt . '(' . strlen($salt) . '/' . getConfig('salt_length') . ')<br />');
+               //* DEBUG: */ debugOutput('salt=' . $salt . '(' . strlen($salt) . '/' . getConfig('salt_length') . ')<br />');
 
                // Sanity check on salt
                if (strlen($salt) != getConfig('salt_length')) {
@@ -2186,7 +2186,7 @@ function generateHash ($plainText, $salt = '', $hash = true) {
        $finalHash = $salt . sha1($salt . $plainText);
 
        // Debug output
-       //* DEBUG: */ outputHtml('finalHash=' . $finalHash);
+       //* DEBUG: */ debugOutput('finalHash=' . $finalHash);
 
        // Return hash
        return $finalHash;
@@ -2213,7 +2213,7 @@ function scrambleString($str) {
        if (strlen($str) != count($scrambleNums)) return $str;
 
        // Scramble string here
-       //* DEBUG: */ outputHtml('***Original=' . $str.'***<br />');
+       //* DEBUG: */ debugOutput('***Original=' . $str.'***<br />');
        for ($idx = 0; $idx < strlen($str); $idx++) {
                // Get char on scrambled position
                $char = substr($str, $scrambleNums[$idx], 1);
@@ -2223,7 +2223,7 @@ function scrambleString($str) {
        } // END - for
 
        // Return scrambled string
-       //* DEBUG: */ outputHtml('***Scrambled=' . $scrambled.'***<br />');
+       //* DEBUG: */ debugOutput('***Scrambled=' . $scrambled.'***<br />');
        return $scrambled;
 }
 
@@ -2240,14 +2240,14 @@ function descrambleString($str) {
 
        // Begin descrambling
        $orig = str_repeat(' ', 40);
-       //* DEBUG: */ outputHtml('+++Scrambled=' . $str.'+++<br />');
+       //* DEBUG: */ debugOutput('+++Scrambled=' . $str.'+++<br />');
        for ($idx = 0; $idx < 40; $idx++) {
                $char = substr($str, $idx, 1);
                $orig = substr_replace($orig, $char, $scrambleNums[$idx], 1);
        } // END - for
 
        // Return scrambled string
-       //* DEBUG: */ outputHtml('+++Original=' . $orig.'+++<br />');
+       //* DEBUG: */ debugOutput('+++Original=' . $orig.'+++<br />');
        return $orig;
 }
 
@@ -2398,14 +2398,14 @@ function isBooleanConstantAndTrue ($constName) { // : Boolean
        // In cache?
        if (isset($GLOBALS['cache_array']['const'][$constName])) {
                // Use cache
-               //* DEBUG: */ outputHtml(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>): ' . $constName."-CACHE!<br />");
+               //* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>): ' . $constName."-CACHE!<br />");
                $res = ($GLOBALS['cache_array']['const'][$constName] === true);
        } else {
                // Check constant
-               //* DEBUG: */ outputHtml(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>): ' . $constName."-RESOLVE!<br />");
+               //* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>): ' . $constName."-RESOLVE!<br />");
                if (defined($constName)) {
                        // Found!
-                       //* DEBUG: */ outputHtml(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>): ' . $constName."-FOUND!<br />");
+                       //* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>): ' . $constName."-FOUND!<br />");
                        $res = (constant($constName) === true);
                } // END - if
 
@@ -2535,8 +2535,9 @@ function debug_report_bug ($F, $L, $message = '', $sendEmail = true) {
        // Add output
        $debug .= 'Please report this bug at <a title="Direct link to the bug-tracker" href="http://bugs.mxchange.org" rel="external" target="_blank">http://bugs.mxchange.org</a> and include the logfile from <strong>' . str_replace(getConfig('PATH'), '', getConfig('CACHE_PATH')) . 'debug.log</strong> in your report (you can now attach files):<pre>';
        $debug .= debug_get_printable_backtrace();
-       $debug .= '</pre>Request-URI: ' . getRequestUri() . '<br />';
-       $debug .= 'Thank you for finding bugs.';
+       $debug .= '</pre>';
+       $debug .= '<div>Request-URI: ' . getRequestUri() . '</div>';
+       $debug .= '<div>Thank you for finding bugs.</div>';
 
        // Send an email? (e.g. not wanted for evaluation errors)
        if (($sendEmail === true) && (!isInstallationPhase())) {
@@ -2727,7 +2728,7 @@ function isUrlValidSimple ($url) {
                        // @TODO Are these convertions still required?
                        $pat = str_replace('.', "&#92;&#46;", $pat);
                        $pat = str_replace('@', "&#92;&#64;", $pat);
-                       //* DEBUG: */ outputHtml($key."=&nbsp;" . $pat . '<br />');
+                       //* DEBUG: */ debugOutput($key."=&nbsp;" . $pat);
                } // END - if
 
                // Check if expression matches
@@ -2756,12 +2757,12 @@ function changeDataInFile ($FQFN, $comment, $prefix, $suffix, $DATA, $seek=0) {
                $tmp = $FQFN . '.tmp';
 
                // Open the source file
-               $fp = fopen($FQFN, 'r') or outputHtml('<strong>READ:</strong> ' . $FQFN . '<br />');
+               $fp = fopen($FQFN, 'r') or debug_report_bug('Cannot read. file=' . basename($FQFN));
 
                // Is the resource valid?
                if (is_resource($fp)) {
                        // Open temporary file
-                       $fp_tmp = fopen($tmp, 'w') or outputHtml('<strong>WRITE:</strong> ' . $tmp . '<br />');
+                       $fp_tmp = fopen($tmp, 'w') or debug_report_bug('Cannot write. tmp=' . basename($tmp) . ',file=' . $FQFN);
 
                        // Is the resource again valid?
                        if (is_resource($fp_tmp)) {
@@ -2810,7 +2811,7 @@ function changeDataInFile ($FQFN, $comment, $prefix, $suffix, $DATA, $seek=0) {
                }
        } else {
                // File not found, not readable or writeable
-               outputHtml('<strong>404:</strong> ' . $FQFN . '<br />');
+               debug_report_bug('File not readable/writeable. file=' . basename($FQFN));
        }
 
        // An error was detected!
@@ -3303,7 +3304,7 @@ function getArrayFromDirectory ($baseDir, $prefix, $fileIncludeDirs = false, $ad
                // Exclude '.', '..' and entries in $excludeArray automatically
                if (in_array($baseFile, $excludeArray, true))  {
                        // Exclude them
-                       //* DEBUG: */ outputHtml('excluded=' . $baseFile . '<br />');
+                       //* DEBUG: */ debugOutput('excluded=' . $baseFile);
                        continue;
                } // END - if
 
@@ -3317,9 +3318,9 @@ function getArrayFromDirectory ($baseDir, $prefix, $fileIncludeDirs = false, $ad
                // Check if the base filenname matches an exclusion pattern and if the pattern is not empty
                if ((!empty($excludePattern)) && (preg_match($excludePattern, $baseFile, $match))) {
                        // These Lines are only for debugging!!
-                       //* DEBUG: */ outputHtml('baseDir:' . $baseDir . '<br />');
-                       //* DEBUG: */ outputHtml('baseFile:' . $baseFile . '<br />');
-                       //* DEBUG: */ outputHtml('FQFN:' . $FQFN . '<br />');
+                       //* DEBUG: */ debugOutput('baseDir:' . $baseDir);
+                       //* DEBUG: */ debugOutput('baseFile:' . $baseFile);
+                       //* DEBUG: */ debugOutput('FQFN:' . $FQFN);
 
                        // Exclude this one
                        continue;
index e9073dae38dc1f1b8727db6b75928c26b0139ad0..51f01e2622ea480ace3559d799defb991bc10e1d 100644 (file)
@@ -68,10 +68,14 @@ SQL_FREERESULT($result);
 SQL_QUERY('TRUNCATE TABLE `{?_MYSQL_PREFIX?}_user_refs`', __FILE__, __LINE__);
 
 // Begin with all users in level one
-$result_direct = SQL_QUERY('SELECT u.userid
-FROM `{?_MYSQL_PREFIX?}_user_data` AS u
-WHERE u.refid=0
-ORDER BY u.userid ASC', __FILE__, __LINE__);
+$result_direct = SQL_QUERY('SELECT
+       u.userid
+FROM
+       `{?_MYSQL_PREFIX?}_user_data` AS u
+WHERE
+       u.refid=0
+ORDER BY
+       u.userid ASC', __FILE__, __LINE__);
 
 // Do we have entries?
 if (SQL_NUMROWS($result_direct) > 0) {
@@ -81,7 +85,7 @@ if (SQL_NUMROWS($result_direct) > 0) {
                $GLOBALS['refback_level'] = 1;
 
                // Update refback table
-               //* DEBUG: */ outputHtml("userid={$content['userid']}<br />");
+               //* DEBUG: */ debugOutput('userid=' . $content['userid']);
                updateRefbackTable($content['userid']);
        } // END - while
 } // END - if
@@ -89,5 +93,5 @@ if (SQL_NUMROWS($result_direct) > 0) {
 // Free result
 SQL_FREERESULT($result_direct);
 
-//
+// [EOF]
 ?>
index 989eb238d4fb910d572ab93a4b0c8eb02f77420a..ee808594438db16295ca8c916ad7f772bfc504de 100644 (file)
@@ -44,19 +44,19 @@ if (!defined('__SECURITY')) {
 
 // Init INC_POOL
 function initIncludePool ($pool) {
-       //* DEBUG: */ print __FUNCTION__.':pool='.$pool.'<br />';
+       //* DEBUG: */ debugOutput(__FUNCTION__.':pool='.$pool);
        $GLOBALS['inc_pool'][$pool] = array();
 }
 
 // Setter for INC_POOL
 function setIncludePool ($pool, $includePool) {
-       //* DEBUG: */ print __FUNCTION__.':pool='.$pool.'<br />';
+       //* DEBUG: */ debugOutput(__FUNCTION__.':pool='.$pool);
        $GLOBALS['inc_pool'][$pool] = (array) $includePool;
 }
 
 // Getter for INC_POOL
 function getIncludePool ($pool) {
-       //* DEBUG: */ print __FUNCTION__.':pool='.$pool.'<br />';
+       //* DEBUG: */ debugOutput(__FUNCTION__.':pool='.$pool);
        if (isset($GLOBALS['inc_pool'][$pool])) {
                // Return found pool (array)
                return $GLOBALS['inc_pool'][$pool];
@@ -68,25 +68,25 @@ function getIncludePool ($pool) {
 
 // Count INC_POOL
 function countIncludePool ($pool) {
-       //* DEBUG: */ print __FUNCTION__.':pool='.$pool.'<br />';
+       //* DEBUG: */ debugOutput(__FUNCTION__.':pool='.$pool);
        return count($GLOBALS['inc_pool'][$pool]);
 }
 
 // Merge INC_POOL into given
 function mergeIncludePool ($pool, $includePool) {
-       //* DEBUG: */ print __FUNCTION__.':pool='.$pool.'<br />';
+       //* DEBUG: */ debugOutput(__FUNCTION__.':pool='.$pool);
        setIncludePool($pool, merge_array(getIncludePool($pool), $includePool));
 }
 
 // Add single include file to INC_POOL
 function addIncludeToPool ($pool, $inc) {
-       //* DEBUG: */ print __FUNCTION__.':pool='.$pool.'<br />';
+       //* DEBUG: */ debugOutput(__FUNCTION__.':pool='.$pool);
        $GLOBALS['inc_pool'][$pool][] = (string) $inc;
 }
 
 // Remove an include file from INC_POOL
 function removeIncludeFromPool ($pool, $inc) {
-       //* DEBUG: */ print __FUNCTION__.':pool='.$pool.'<br />';
+       //* DEBUG: */ debugOutput(__FUNCTION__.':pool='.$pool);
        // First look it up
        $key = array_search($inc, getIncludePool($pool));
 
@@ -102,12 +102,12 @@ function removeIncludeFromPool ($pool, $inc) {
 
 // Load the whole include pool
 function loadIncludePool ($pool) {
-       //* DEBUG: */ print __FUNCTION__.':pool='.$pool.' - START<br />';
+       //* DEBUG: */ debugOutput(__FUNCTION__.':pool='.$pool.' - START');
        foreach (getIncludePool($pool) as $inc) {
-               //* DEBUG: */ print __FUNCTION__.':inc='.$inc.'<br />';
+               //* DEBUG: */ debugOutput(__FUNCTION__.':inc='.$inc);
                loadIncludeOnce($inc);
        } // END - foreach
-       //* DEBUG: */ print __FUNCTION__.':pool='.$pool.' - END<br />';
+       //* DEBUG: */ debugOutput(__FUNCTION__.':pool='.$pool.' - END');
 
        // Remove it
        initIncludePool($pool);
index a12389d839bbd19ba0ff0980aa25051a87d11bf0..f1d7f0ac93b385c4135aae61daf3dd9828c61b5e 100644 (file)
@@ -156,7 +156,7 @@ function isLanguageIncludeReadable ($ext_name = 'none') {
 
                // Look for file if no extension name is provided
                $GLOBALS['lang_inc'][$ext_name] = isIncludeReadable($languageInclude);
-               //* DEBUG: */ print __FUNCTION__.':'.$ext_name.'='.$languageInclude.'='.intval(isIncludeReadable($languageInclude)).'<br />';
+               //* DEBUG: */ debugOutput(__FUNCTION__.':'.$ext_name.'='.$languageInclude.'='.intval(isIncludeReadable($languageInclude)));
        } // END - if
 
        // Return it
index b613105fa409c312379ffcf39ec120d603cdec30..dd8d99dcbfe8d60433c37edf015087c011192dee 100644 (file)
@@ -110,14 +110,14 @@ function adminsCheckAdminAcl ($action, $what) {
        }
 
        // Check ACL and (maybe) allow
-       //* DEBUG: */ print 'default='.$default.',acl_mode='.$acl_mode.',parent='.intval($parent).'<br />';
+       //* DEBUG: */ debugOutput('default='.$default.',acl_mode='.$acl_mode.',parent='.intval($parent));
        if (($default == 'allow') || (($default == 'deny') && ($acl_mode == 'allow')) || ($parent === true) || (($default == '***') && ($acl_mode == 'failed') && ($parent === false))) {
                // Access is granted
                $ret = true;
        } // END - if
 
        // Return value
-       //* DEBUG: */ outputHtml(__FUNCTION__."[".__LINE__."]:act={$action},wht={$whatOR},default={$default},acl_mode={$acl_mode}<br />");
+       //* DEBUG: */ debugOutput(__FUNCTION__.'['.__LINE__.']:act='.$action.',wht='.$what.',default='.$default.',acl_mode='.$acl_mode);
        return $ret;
 }
 
index acb09444c5c049133c79d66149084909a22c21c2..ae14ace7c0897695dc9832e1fa8b79271c8e31c0 100644 (file)
@@ -292,7 +292,7 @@ LIMIT 1",
                $userid = '---';
 
                // List only users with at least one ref!
-               //* DEBUG: */ print("*".$cnt.'/'.$content['userid'].'/'.$content['curr_points'].'/'.$refpoints."*<br />");
+               //* DEBUG: */ debugOutput('*'.$cnt.'/'.$content['userid'].'/'.$content['curr_points'].'/'.$refpoints.'*');
                if (($cnt > 0) && ($refpoints > $content['curr_points'])) { $userid = $content['userid']; } else { $cnt = ''; }
 
                // Save values to array
@@ -870,14 +870,14 @@ function getReferalRallyeRefsCount ($currUserid, $old = '0') {
                $cnt = '0';
                foreach ($GLOBALS['cache_array']['refsystem']['userid'] as $id => $userid) {
                        // Do we have a ref for this user?
-                       //* DEBUG: */ print("id={$id},userid={$userid},userid={$userid},old={$old},level={$GLOBALS['cache_array']['refsystem']['level'][$id]}<br />");
+                       //* DEBUG: */ debugOutput('id='.$id.',userid='.$userid.',userid='.$userid.',old='.$old.',level='.$GLOBALS['cache_array']['refsystem']['level'][$id]);
                        if (($currUserid == $userid) && ($GLOBALS['cache_array']['refsystem']['level'][$id] == 1)) {
-                               //* DEBUG: */ print("userid matches!<br />");
+                               //* DEBUG: */ debugOutput('userid matches!');
                                foreach ($GLOBALS['cache_array']['refdepths']['level'] as $level) {
                                        if (($level == $GLOBALS['cache_array']['refsystem']['level'][$id]) && ($level == 1)) {
                                                // Level does exist so abort here
                                                $cnt = $GLOBALS['cache_array']['refsystem']['counter'][$id];
-                                               //* DEBUG: */ print("*".$userid.'/'.$cnt."*<br />");
+                                               //* DEBUG: */ debugOutput('*'.$userid.'/'.$cnt.'*');
                                                break;
                                        } elseif ($level > 1) {
                                                // Not interesting here...
@@ -890,9 +890,7 @@ function getReferalRallyeRefsCount ($currUserid, $old = '0') {
                        } // END - if
                } // END - foreach
 
-               //* DEBUG: */ print("<pre>");
-               //* DEBUG: */ print(print_r($GLOBALS['cache_array']['refsystem'], true));
-               //* DEBUG: */ print("</pre>");
+               //* DEBUG: */ debugOutput('<pre>'.print_r($GLOBALS['cache_array']['refsystem'], true).'</pre>');
                //* DEBUG: */ shutdown();
 
                if ($cnt > 0) {
@@ -900,7 +898,7 @@ function getReferalRallyeRefsCount ($currUserid, $old = '0') {
                        incrementStatsEntry('cache_hits');
 
                        // Remove old refs
-                       //* DEBUG: */ print('+'.$cnt.'/'.$old."+<br />");
+                       //* DEBUG: */ debugOutput('+'.$cnt.'/'.$old.'+');
                        $cnt -= $old;
                } // END - if
        } else {
@@ -933,7 +931,7 @@ WHERE
        }
 
        // Return count
-       //* DEBUG: */ print("*".$userid.'/'.$old.'/'.$cnt."*<br />");
+       //* DEBUG: */ debugOutput('*'.$userid.'/'.$old.'/'.$cnt.'*');
        return $cnt;
 }
 
index 33a2f58ff8a270d5c8894d899d11b096a766a91d..543f145bdbe9374f5984f097273dbb63959d07ee 100644 (file)
@@ -1015,7 +1015,7 @@ function SURFBAR_CHECK_VALIDATION_CODE ($urlId, $check, $salt) {
 
 // Lockdown the userid/id combination (reload lock)
 function SURFBAR_LOCKDOWN_ID ($urlId) {
-       //* DEBUG: */ outputHtml('LOCK!');
+       //* DEBUG: */ debugOutput('LOCK!');
        ///* DEBUG: */ return;
        // Just add it to the database
        SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_locks` (`locks_userid`, `locks_url_id`) VALUES (%s, %s)",
index adffe64f9037dfa1de06c6a19035e63d76aaf0b9..83cdb59ceff0240c35c6b25cd04b60c06bea6bdc 100644 (file)
@@ -344,7 +344,7 @@ function WERNIS_LOG_TRANSFER ($wdsId, $amount, $type = 'FAILED', $message = '',
 // Take fees and factor
 function WERNIS_TAKE_FEE ($points, $mode) {
        // Payout or withdraw are allowed modes!
-       //* DEBUG: */ outputHtml("mode={$mode},points={$points}<br />");
+       //* DEBUG: */ debugOutput('mode='.$mode.',points='.$points);
        if (!in_array($mode, array('payout', 'withdraw'))) {
                // Log error and abort
                logDebugMessage(__FUNCTION__, __LINE__, "userid={getMemberId()},mode={$mode},points={$points}");
@@ -370,7 +370,7 @@ function WERNIS_TAKE_FEE ($points, $mode) {
        }
 
        // Return value
-       //* DEBUG: */ outputHtml("mode={$mode},points={$points}<br />");
+       //* DEBUG: */ debugOutput('mode='.$mode.',points='.$points);
        return $points;
 }
 
index cff7e7e2dc5139a6eaff0a4a6cf67779ed41b1b6..14d8cbb14434a691c74f0bd5586860554c61bc74 100644 (file)
@@ -124,7 +124,7 @@ function ifAdminCookiesAreValid ($adminLogin, $passHash) {
        if ($adminHash != '-1') {
                // Now, we need to encode the password in the same way the one is encoded in database
                $testHash = encodeHashForCookie($adminHash);
-               //* DEBUG: */ outputHtml('adminLogin='.$adminLogin.',<br />passHash='.$passHash.',<br />adminHash='.$adminHash.',<br />testHash='.$testHash.'<br />');
+               //* DEBUG: */ debugOutput('adminLogin=' . $adminLogin . ',passHash='.$passHash.',adminHash='.$adminHash.',testHash='.$testHash);
 
                // If they both match, the login data is valid
                if ($testHash == $passHash) {
@@ -137,7 +137,7 @@ function ifAdminCookiesAreValid ($adminLogin, $passHash) {
        } // END - if
 
        // Return status
-       //* DEBUG: */ outputHtml('ret='.$ret);
+       //* DEBUG: */ debugOutput('ret='.$ret);
        return $ret;
 }
 
@@ -146,7 +146,7 @@ function doAdminAction () {
        // Get default what
        $what = getWhat();
 
-       //* DEBUG: */ outputHtml(__LINE__.'*'.$what.'/'.getModule().'/'.getAction().'/'.getWhat().'*<br />');
+       //* DEBUG: */ debugOutput(__LINE__.'*'.$what.'/'.getModule().'/'.getAction().'/'.getWhat().'*');
 
        // Remove any spaces from variable
        if (empty($what)) {
@@ -787,14 +787,14 @@ function adminListBuilder ($listType, $IDs, $table, $columns, $filterFunctions,
                                } // END - if
 
                                // If the key matches the idColumn variable, we need to temporary remember it
-                               //* DEBUG: */ print 'key=' . $key . ',idColumn=' . $idColumn . ',value=' . $value . '<br />';
+                               //* DEBUG: */ debugOutput('key=' . $key . ',idColumn=' . $idColumn . ',value=' . $value);
                                if ($key == $idColumn) {
                                        // Found, so remember it
                                        $GLOBALS['admin_list_builder_id_value'] = $value;
                                } // END - if
 
                                // Handle the call in external function
-                               //* DEBUG: */ print 'key=' . $key . ',fucntion=' . $filterFunctions[$idx] . ',value=' . $value . '<br />';
+                               //* DEBUG: */ debugOutput('key=' . $key . ',fucntion=' . $filterFunctions[$idx] . ',value=' . $value);
                                $content[$key] = handleExtraValues($filterFunctions[$idx], $value, $extraValues[$idx]);
                        } // END - foreach
 
index b9f2da4b2866b864976a2a06f31deac814b13a08..81719aadbe6b05380daabcc7400e425ca1447bea 100644 (file)
@@ -85,10 +85,10 @@ function outputStandardOverview (&$result_tasks) {
 
                                // Get extension version
                                $ext_ver = getExtensionVersion($ext_name);
-                               //* DEBUG: */ outputHtml($ext_name."=".$ext_ver."<br />");
+                               //* DEBUG: */ debugOutput($ext_name.'='.$ext_ver);
 
                                // Update extension if extension is installed and outdated
-                               //* DEBUG: */ outputHtml('ext=' . $ext_name . ',ver=' . getThisExtensionVersion() . '/' . getExtensionVersion($ext_name)."<br />");
+                               //* DEBUG: */ debugOutput('ext=' . $ext_name . ',ver=' . getThisExtensionVersion() . '/' . getExtensionVersion($ext_name));
                                if (getThisExtensionVersion() > $ext_ver) {
                                        // Update the extension
                                        updateExtension($ext_name, $ext_ver);
index 6fb6f1c43934f521931cc5c88d1af0ae2d5f487e..11de7d3bb749c8a2020d6488a263122798bddd20 100644 (file)
@@ -106,7 +106,7 @@ LIMIT 1",
                                // No points repayed!
                                loadTemplate('admin_settings_saved', false, getMessage('ADMIN_NO_POINTS_REPAYED'));
                        } elseif (getConfig('repay_deleted_mails') != 'SHRED') {
-                               //* DEBUG: */ outputHtml($stats_id.':'.$totalPoints.'/'.$links.'/'.$price."<br />");
+                               //* DEBUG: */ debugOutput($stats_id.':'.$totalPoints.'/'.$links.'/'.$price);
                                // Shall we payback to user or jackpot?
                                if (getConfig('repay_deleted_mails') == 'JACKPOT') {
                                        // Set jackpot
@@ -114,7 +114,7 @@ LIMIT 1",
                                } // END - if
 
                                // Pay back points
-                               //* DEBUG: */ outputHtml("PAYBACK:".$sender."<br />");
+                               //* DEBUG: */ debugOutput('PAYBACK:'.$sender);
                                addPointsThroughReferalSystem('mail_deleted', $sender, $totalPoints, true, 0, false,'direct');
 
                                // Output message
index d6bb58f5f338f1f5c1801f1ed01ebdfc63a25ba6..7f6f64a1475a3a4fb647946f1155b9f3f24bb486 100644 (file)
@@ -150,12 +150,12 @@ SET
        `title`='%s',
        `descr`='%s',
        `template`='%s',
-       `start_time`='%s',
-       `end_time`='%s',
-       `min_users`='%s',
-       `min_prices`='%s'
+       `start_time`=%s,
+       `end_time`=%s,
+       `min_users`=%s,
+       `min_prices`=%s
 WHERE
-       `id`='%s'
+       `id`=%s
 LIMIT 1",
                        array(
                                $title,
@@ -224,7 +224,7 @@ LIMIT 1",
 
                        // Color switching
                        $SW = 3 - $SW;
-               }
+               } // END - foreach
 
                // Load final template
                loadTemplate('admin_edit_rallyes', false, $OUT);
@@ -234,7 +234,14 @@ LIMIT 1",
        }
 } elseif ((getRequestParameter('sub') == 'users') && (getRequestParameter('rallye') > 0)) {
        // List users and their refs before start and current
-       $result = SQL_QUERY_ESC("SELECT `userid`, `refs`, `curr_points` FROM `{?_MYSQL_PREFIX?}_rallye_users` WHERE `rallye_id`=%s ORDER BY `userid` ASC",
+       $result = SQL_QUERY_ESC("SELECT
+       `userid`, `refs`, `curr_points`
+FROM
+       `{?_MYSQL_PREFIX?}_rallye_users`
+WHERE
+       `rallye_id`=%s
+ORDER BY
+       `userid` ASC",
                array(bigintval(getRequestParameter('rallye'))), __FILE__, __LINE__);
        if (SQL_NUMROWS($result) > 0) {
                $OUT = ''; $SW = 2;
@@ -252,18 +259,17 @@ LIMIT 1",
 
                        // Get user points
                        $points = countSumTotalData($row['userid'], 'user_points', 'points', 'userid', false, " AND `ref_depth`=1 LIMIT 1");
-                       //* DEBUG: */ outputHtml(basename(__FILE__).":userid={$row['userid']},points={$points},opoints={$row['curr_points']}<br />");
+                       //* DEBUG: */ debugOutput(basename(__FILE__).':userid='.$row['userid'].',points='.$points.',opoints='.$row['curr_points']);
 
                        // Prepare content
-                       // @TODO Rewritings: opoints->curr_points,old->refs in template
                        $row = array(
                                'sw'      => $SW ,
                                'userid'  => $row['userid'],
                                'bold_l'  => $bl ,
                                'bold_r'  => $br ,
-                               'old'     => $row['refs'],
+                               'rews'    => $row['refs'],
                                'cnt'     => $cnt,
-                               'opoints' => translateComma($points - $row['curr_points']),
+                               'opoints' => ($points - $row['curr_points']),
                        );
 
                        // Load row template and switch color
@@ -287,7 +293,8 @@ LIMIT 1",
 } else {
        // Start listing rallyes
        $result = SQL_QUERY("SELECT
-       `id`, `admin_id`, `title`, `descr`, `template`, `start_time`, `end_time`, `auto_add_new_user`, `is_active`, `send_notify`, `notified`, `min_users`, `min_prices`
+       `id`, `admin_id`, `title`, `descr`, `template`, `start_time`, `end_time`,
+       `auto_add_new_user`, `is_active`, `send_notify`, `notified`, `min_users`, `min_prices`
 FROM
        `{?_MYSQL_PREFIX?}_rallye_data`
 ORDER BY
@@ -302,12 +309,12 @@ ORDER BY
                        $data['login'] = getAdminLogin($data['admin_id']);
 
                        // Count joined userids
-                       $joined = countSumTotalData($data['id'], 'rallye_users', 'id', 'rallye_id', true);
+                       $users = countSumTotalData($data['id'], 'rallye_users', 'id', 'rallye_id', true);
 
                        // Did some users joined this rallye?
-                       if ($joined > 0) {
+                       if ($users > 0) {
                                // List joined users
-                               $joined = '<a href="{%url=modules.php?module=admin&amp;what=list_rallyes&amp;sub=users&amp;rallye=' . $data['id'] . '%}" title="{--RALLYE_LIST_USERS_TITLE--}">' . $joined . '</a>';
+                               $users = '<a href="{%url=modules.php?module=admin&amp;what=list_rallyes&amp;sub=users&amp;rallye=' . $data['id'] . '%}" title="{--RALLYE_LIST_USERS_TITLE--}">' . $users . '</a>';
                        } // END - if
 
                        // Alter some variables
@@ -317,67 +324,66 @@ ORDER BY
 
                        // Transfer data into array for the template
                        $row = array(
-                               'select'     => '<input type="checkbox" name="sel[' . $data['id'] . ']" class="admin_normal" value="1" />',
-                               'admin_id'   => $data['admin_id'],
-                               'admin_link' => generateAdminLink($data['admin_id']),
-                               'login'      => $data['login'],
-                               'id'         => $data['id'],
-                               'sw'         => $SW,
-                               'title'      => $data['title'],
-                               'template'   => $data['template'],
-                               'joined'     => $joined,
-                               'start_date' => generateDateTime($data['start_time'], 2),
-                               'end_date'   => generateDateTime($data['end_time']  , 2),
-                               'active_lnk' => translateYesNo($data['is_active']),
-                               'notify_lnk' => translateYesNo($data['send_notify']),
-                               'auto_lnk'   => translateYesNo($data['auto_add_new_user']),
-                               'notified'   => translateYesNo($data['notified']),
-                               'prices_cnt' => translateComma(countSumTotalData($data['id'], 'rallye_prices', 'id', 'rallye_id', true)),
-                               'descr'      => $data['descr'],
-                               'min_users'  => $data['min_users'],
-                               'min_prices' => $data['min_prices'],
+                               'select'            => '<input type="checkbox" name="sel[' . $data['id'] . ']" class="admin_normal" value="1" />',
+                               'admin_id'          => $data['admin_id'],
+                               'login'             => $data['login'],
+                               'id'                => $data['id'],
+                               'sw'                => $SW,
+                               'title'             => $data['title'],
+                               'template'          => $data['template'],
+                               'users_content'     => $users,
+                               'start_date'        => generateDateTime($data['start_time'], 2),
+                               'end_date'          => generateDateTime($data['end_time']  , 2),
+                               'is_active'         => $data['is_active'],
+                               'send_notify'       => $data['send_notify'],
+                               'auto_add_new_user' => $data['auto_add_new_user'],
+                               'notified'          => $data['notified'],
+                               'prices_cnt'        => countSumTotalData($data['id'], 'rallye_prices', 'id', 'rallye_id', true),
+                               'descr'             => $data['descr'],
+                               'min_users'         => $data['min_users'],
+                               'min_prices'        => $data['min_prices'],
                        );
 
                        // Is the rallye active or not?
                        switch ($data['is_active']) {
                                case 'Y':
                                        // Rallye is active so do not edit it!
-                                       $row['select'] = '<div class="big">' . $row['id'] . '</div>';
+                                       $row['select']       = '<div class="big">' . $row['id'] . '</div>';
                                        $row['active_title'] = getMessage('RALLYE_DEACTIVATE_NOW');
-                                       $row['active'] = '0';
+                                       $row['active']       = '0';
                                        break;
 
                                case 'N':
                                        $row['active_title'] = getMessage('RALLYE_ACTIVATE_NOW');
-                                       $row['active'] = 1;
+                                       $row['active']       = 1;
                                        break;
-                       }
+                       } // END - switch
 
                        // Notification to members?
                        switch ($data['send_notify']) {
                                case 'Y':
                                        $row['notify_title'] = getMessage('RALLYE_STOP_NOTIFY_NOW');
-                                       $row['notify'] = '0';
+                                       $row['notify']       = '0';
                                        break;
 
                                case 'N':
                                        $row['notify_title'] = getMessage('RALLYE_START_NOTIFY_NOW');
-                                       $row['notify'] = 1;
+                                       $row['notify']       = 1;
                                        break;
-                       }
+                       } // END - switch
 
                        // Auto-add of new joined members?
                        switch ($data['auto_add_new_user']) {
                                case 'Y':
                                        $row['auto_title'] = getMessage('RALLYE_STOP_AUTO_ADD_NOW');
-                                       $row['auto'] = '0';
+                                       $row['auto']       = '0';
                                        break;
 
                                case 'N':
                                        $row['auto_title'] = getMessage('RALLYE_START_AUTO_ADD_NOW');
-                                       $row['auto'] = 1;
+                                       $row['auto']       = 1;
                                        break;
-                       }
+                       } // END - switch
 
                        // Output row
                        $OUT .= loadTemplate('admin_list_rallyes_row', true, $row);
index 5cbf29c67b42826ef4bfd73c49714e19ce31bf68..852f6870505e038c0c5f27cb8f5dfab805652e3f 100644 (file)
@@ -85,7 +85,7 @@ ORDER BY
                                        // Load all refs of this user
                                        $result_refs = SQL_QUERY_ESC("SELECT `refid` FROM `{?_MYSQL_PREFIX?}_user_refs` WHERE `userid`=%s AND `level`='%s' ORDER BY refid ASC",
                                                array($userid, $levels['level']), __FILE__, __LINE__);
-                                       //* DEBUG: */ outputHtml($userid.'/'.$levels['level'].'/'.SQL_NUMROWS($result_refs)."<br />");
+                                       //* DEBUG: */ debugOutput($userid.'/'.$levels['level'].'/'.SQL_NUMROWS($result_refs));
 
                                        // Do we have levels?
                                        if (SQL_NUMROWS($result_refs) > 0) {
index 65855155377b0d8998ea675a9359d3d815c7e20f..7bd3c02db3a930f96f9779cc44cce2502e373ce2 100644 (file)
@@ -54,7 +54,7 @@ if (!isExtensionActive('register')) {
 }
 
 // Is the form sent and all went fine?
-//* DEBUG: */ print intval(isFormSent()) . '/' . intval(isRegistrationDataComplete()) . '/' . intval(isAdmin()) . '<br />';
+//* DEBUG: */ debugOutput('isFormSent=' . intval(isFormSent()) . ',isRegistrationDataComplete=' . intval(isRegistrationDataComplete()) . ',isAdmin=' . intval(isAdmin()));
 if ((isFormSent()) && (isRegistrationDataComplete())) {
        // Do the registration here
        doRegistration();
index 5c996cea14c0f6c20ee8cb74c222ae101d37505c..499002bd0d7219d8e8d58e3af6113093efd60d53 100644 (file)
@@ -139,10 +139,10 @@ function checkModulePermissions ($module = '') {
        // Check for prefix is a extension...
        $modSplit = explode('_', $module);
        $extension = ''; $module_chk = $module;
-       //* DEBUG: */ print(__LINE__."*".count($modSplit)."*/".$module."*<br />");
+       //* DEBUG: */ debugOutput(__LINE__.'*'.count($modSplit).'/'.$module.'*');
        if (count($modSplit) == 2) {
                // Okay, there is a seperator (_) in the name so is the first part a module?
-               //* DEBUG: */ print(__LINE__."*".$modSplit[0]."*<br />");
+               //* DEBUG: */ debugOutput(__LINE__.'*'.$modSplit[0].'*');
                if (isExtensionActive($modSplit[0])) {
                        // The prefix is an extension's name, so let's set it
                        $extension = $modSplit[0]; $module = $modSplit[1];
@@ -373,9 +373,9 @@ function addMenuDescription ($accessLevel, $FQFN, $return = false) {
                $OUT = $prefix . '<strong><a class="you_are_here" href="{%url=modules.php?module=' . $modCheck . '&amp;' . $type . '=' . $search . $LINK_ADD . '%}">' . getTitleFromMenu($accessLevel, $search, $type, $ADD) . '</a></strong>';
 
                // Can we close the you-are-here navigation?
-               //* DEBUG: */ print(__LINE__."*".$type.'/'.getWhat()."*<br />");
+               //* DEBUG: */ debugOutput(__LINE__.'*'.$type.'/'.getWhat().'*');
                if (($type == 'what') || (($type == 'action') && ((!isWhatSet()) || (getWhat() == 'overview')))) {
-                       //* DEBUG: */ print(__LINE__.'+'.$type."+<br />");
+                       //* DEBUG: */ debugOutput(__LINE__.'+'.$type.'+');
                        // Add closing div and br-tag
                        $OUT .= '</div>';
                        $GLOBALS['nav_depth'] = '0';
@@ -426,13 +426,13 @@ ORDER BY
        `sort` ASC",
                array($mode), __FUNCTION__, __LINE__);
 
-       //* DEBUG: */ print(__LINE__.'/'.$main_cnt.':'.getWhat()."*<br />");
+       //* DEBUG: */ debugOutput(__LINE__.'/'.$main_cnt.':'.getWhat().'*');
        if (SQL_NUMROWS($result_main) > 0) {
                // There are menus available, so we simply display them... :)
                $GLOBALS['rows'] = '';
                while ($content = SQL_FETCHARRAY($result_main)) {
-                       //* DEBUG: */ print(__LINE__ . '/' . $main_cnt . '/' . $content['action'] . ':' . getWhat() . '*<br />');
-                       // Init/"translate" variables
+                       //* DEBUG: */ debugOutput(__LINE__ . '/' . $main_cnt . '/' . $content['action'] . ':' . getWhat() . '*');
+                       // Disable the block-mode
                        enableBlockMode(false);
 
                        // Load menu header template
@@ -469,7 +469,7 @@ ORDER BY
                                        $OUT = '';
 
                                        // Full file name for checking menu
-                                       //* DEBUG: */ print(__LINE__ . ':!!!!' . $content['sub_what'] . '!!!<br />');
+                                       //* DEBUG: */ debugOutput(__LINE__ . ':!!!!' . $content['sub_what'] . '!!!');
                                        $inc = sprintf("inc/modules/%s/what-%s.php", $mode, $content['sub_what']);
                                        if (isIncludeReadable($inc)) {
                                                // Mark currently selected menu - open
@@ -526,12 +526,12 @@ ORDER BY
                                if (isFileReadable($INC)) {
                                        // Load include file
                                        if ((!isExtensionActive($content['action'])) || ($content['action'] == 'online')) $GLOBALS['rows'] .= loadTemplate('menu_what_begin', true, $mode);
-                                       //* DEBUG: */ print(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.getWhat()."*<br />");
+                                       //* DEBUG: */ debugOutput(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.getWhat().'*');
                                        loadInclude($INC);
-                                       //* DEBUG: */ print(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.getWhat()."*<br />");
+                                       //* DEBUG: */ debugOutput(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.getWhat().'*');
                                        if ((!isExtensionActive($content['action'])) || ($content['action'] == 'online')) $GLOBALS['rows'] .= loadTemplate('menu_what_end', true, $mode);
                                }
-                               //* DEBUG: */ print(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />");
+                               //* DEBUG: */ debugOutput(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat().'*');
                        }
 
                        // Free result
@@ -540,7 +540,7 @@ ORDER BY
                        // Count one up
                        $main_cnt++;
 
-                       //* DEBUG: */ print(__LINE__.'/'.$main_cnt.':'.getWhat()."*<br />");
+                       //* DEBUG: */ debugOutput(__LINE__.'/'.$main_cnt.':'.getWhat().'*');
                        if (SQL_NUMROWS($result_main) > $main_cnt) {
                                // Add seperator
                                $GLOBALS['rows'] .= loadTemplate('menu_seperator', true, $mode);
@@ -575,7 +575,7 @@ ORDER BY
                );
 
                // Load main template
-               //* DEBUG: */ print(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />");
+               //* DEBUG: */ debugOutput(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat().'*');
                loadTemplate('menu_table', false, $content);
        } // END - if
 }
@@ -743,7 +743,7 @@ function isAdmin ($adminLogin = '') {
        $ret = false;
        $passCookie = '';
        $valPass = '';
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, $adminLogin.'<br />');
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, $adminLogin);
 
        // If admin login is not given take current from cookies...
        if ((empty($adminLogin)) && (isSessionVariableSet('admin_login')) && (isSessionVariableSet('admin_md5'))) {
@@ -751,7 +751,7 @@ function isAdmin ($adminLogin = '') {
                $adminLogin = getSession('admin_login');
                $passCookie = getSession('admin_md5');
        } // END - if
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, $adminLogin.'/'.$passCookie.'<br />');
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, $adminLogin.'/'.$passCookie);
 
        // Do we have cache?
        if (!isset($GLOBALS['is_admin'][$adminLogin])) {
@@ -877,19 +877,30 @@ function isMenuActionValid ($mode, $action, $what, $updateEntry=false) {
        $add = '';
        if ((!isAdmin()) && ($mode != 'admin')) $add = " AND `locked`='N'";
 
-       //* DEBUG: */ print(__LINE__.':'.$mode.'/'.$action.'/'.$what."*<br />");
+       //* DEBUG: */ debugOutput(__LINE__.':'.$mode.'/'.$action.'/'.$what.'*');
        if (($mode != 'admin') && ($updateEntry === true)) {
                // Update guest or member menu
                $sql = SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s_menu` SET counter=counter+1 WHERE `action`='%s' AND `what`='%s'".$add." LIMIT 1",
-                       array($mode, $action, $what), __FUNCTION__, __LINE__, false);
+                       array(
+                               $mode,
+                               $action,
+                               $what
+                       ), __FUNCTION__, __LINE__, false);
        } elseif (($what != 'overview') && (!empty($what))) {
                // Other actions
                $sql = SQL_QUERY_ESC("SELECT `id`, `what` FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE `action`='%s' AND `what`='%s'".$add." ORDER BY `action` DESC LIMIT 1",
-                       array($mode, $action, $what), __FUNCTION__, __LINE__, false);
+                       array(
+                               $mode,
+                               $action,
+                               $what
+                       ), __FUNCTION__, __LINE__, false);
        } else {
                // Admin login overview
                $sql = SQL_QUERY_ESC("SELECT `id`, `what` FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE `action`='%s' AND (`what`='' OR `what` IS NULL)".$add." ORDER BY `action` DESC LIMIT 1",
-                       array($mode, $action), __FUNCTION__, __LINE__, false);
+                       array(
+                               $mode,
+                               $action
+                       ), __FUNCTION__, __LINE__, false);
        }
 
        // Run SQL command
@@ -919,7 +930,7 @@ function getActionFromModuleWhat ($module, $what) {
        // Init status
        $data['action'] = '';
 
-       //* DEBUG: */ print(__LINE__.'='.$module.'/'.$what.'/'.getAction()."=<br />");
+       //* DEBUG: */ debugOutput(__LINE__.'='.$module.'/'.$what.'/'.getAction().'=');
        if (!isExtensionInstalledAndNewer('sql_patches', '0.0.5')) {
                // sql_patches is missing so choose depending on mode
                if (isWhatSet()) {
@@ -953,7 +964,7 @@ function getActionFromModuleWhat ($module, $what) {
                // Get it directly from URL
                return getAction();
        }
-       //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>): ret=' . $data['action'] . '<br />');
+       //* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>): ret=' . $data['action']);
 
        // Does the module have a menu?
        if (ifModuleHasMenu($module)) {
@@ -1105,7 +1116,7 @@ function countSumTotalData ($search, $tableName, $lookFor = 'id', $whereStatemen
        // Init count/sum
        $data['res'] = '0';
 
-       //* DEBUG: */ print($search.'/'.$tableName.'/'.$lookFor.'/'.$whereStatement.'/'.$add.'<br />');
+       //* DEBUG: */ debugOutput($search.'/'.$tableName.'/'.$lookFor.'/'.$whereStatement.'/'.$add);
        if ((empty($search)) && ($search != '0')) {
                // Count or sum whole table?
                if ($countRows === true) {
@@ -1119,12 +1130,12 @@ function countSumTotalData ($search, $tableName, $lookFor = 'id', $whereStatemen
                }
        } elseif (($countRows === true) || ($lookFor == 'userid')) {
                // Count rows
-               //* DEBUG: */ print("COUNT!<br />");
+               //* DEBUG: */ debugOutput('COUNT!');
                $result = SQL_QUERY_ESC("SELECT COUNT(`%s`) AS res FROM `{?_MYSQL_PREFIX?}_%s` WHERE `%s`='%s'".$add,
                        array($lookFor, $tableName, $whereStatement, $search), __FUNCTION__, __LINE__);
        } else {
                // Add all rows
-               //* DEBUG: */ print("SUM!<br />");
+               //* DEBUG: */ debugOutput('SUM!');
                $result = SQL_QUERY_ESC("SELECT SUM(`%s`) AS res FROM `{?_MYSQL_PREFIX?}_%s` WHERE `%s`='%s'".$add,
                        array($lookFor, $tableName, $whereStatement, $search), __FUNCTION__, __LINE__);
        }
@@ -1145,7 +1156,7 @@ function countSumTotalData ($search, $tableName, $lookFor = 'id', $whereStatemen
        }
 
        // Return value
-       //* DEBUG: */ print 'ret=' . $data['res'] . '<br />';
+       //* DEBUG: */ debugOutput('ret=' . $data['res']);
        return $data['res'];
 }
 // Getter fro ref level percents
@@ -1197,7 +1208,7 @@ function getReferalLevelPercents ($level) {
  *               for default value will cause no referal will get points ever!!!)
  */
 function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify = false, $rid = '0', $locked = false, $add_mode = 'ref') {
-       //* DEBUG: */ print("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
+       //* DEBUG: */ debugOutput('----------------------- <font color="#00aa00">' . __FUNCTION__ . ' - ENTRY</font> ------------------------<ul><li>');
        // Convert mode to lower-case
        $add_mode = strtolower($add_mode);
 
@@ -1226,12 +1237,12 @@ function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify
        // Count up referal depth
        if (!isset($GLOBALS['ref_level'])) {
                // Initialialize referal system
-               //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>): Referal system initialized!<br />");
+               //* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>): Referal system initialized!');
                $GLOBALS['ref_level'] = '0';
        } else {
                // Increase referal level
                $GLOBALS['ref_level']++;
-               //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>): Referal level increased. DEPTH={$GLOBALS['ref_level']}<br />");
+               //* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>): Referal level increased. DEPTH='.$GLOBALS['ref_level']);
        }
 
        // Default is 'normal' points
@@ -1241,39 +1252,39 @@ function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify
        if ($locked === true) $data = 'locked_points';
 
        // Check user account
-       //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):userid={$userid},points={$points}<br />");
+       //* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>):userid='.$userid.',points='.$points);
        if (fetchUserData($userid)) {
                // This is the user and his ref
                $GLOBALS['cache_array']['add_userid'][getUserData('refid')] = $userid;
 
                // Get percents
                $per = getReferalLevelPercents($GLOBALS['ref_level']);
-               //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):userid={$userid},points={$points},depth={$GLOBALS['ref_level']},per={$per},mode={$add_mode}<br />");
+               //* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>):userid='.$userid.',points='.$points.',depth='.$GLOBALS['ref_level'].',per='.$per.',mode='.$add_mode);
 
                // Some percents found?
                if ($per > 0) {
                        // Calculate new points
-                       //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):userid={$userid},points={$points},per={$per},depth={$GLOBALS['ref_level']}<br />");
+                       //* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>):userid='.$userid.',points='.$points.',per='.$per.',depth='.$GLOBALS['ref_level']);
                        $ref_points = $points * $per / 100;
 
                        // Pay refback here if level > 0 and in ref-mode
-                       if ((isExtensionActive('refback')) && ($GLOBALS['ref_level'] > 0) && ($per < 100) && ($add_mode == "ref") && (isset($GLOBALS['cache_array']['add_userid'][$userid]))) {
-                               //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):userid={$userid},data={$GLOBALS['cache_array']['add_userid'][$userid]},ref_points={$ref_points},depth={$GLOBALS['ref_level']} - BEFORE!<br />");
+                       if ((isExtensionActive('refback')) && ($GLOBALS['ref_level'] > 0) && ($per < 100) && ($add_mode == 'ref') && (isset($GLOBALS['cache_array']['add_userid'][$userid]))) {
+                               //* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>):userid='.$userid.',data='.$GLOBALS['cache_array']['add_userid'][$userid].',ref_points='.$ref_points.',depth='.$GLOBALS['ref_level'].' - BEFORE!');
                                $ref_points = addRefbackPoints($GLOBALS['cache_array']['add_userid'][$userid], $userid, $points, $ref_points);
-                               //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):userid={$userid},data={$GLOBALS['cache_array']['add_userid'][$userid]},ref_points={$ref_points},depth={$GLOBALS['ref_level']} - AFTER!<br />");
+                               //* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>):userid='.$userid.',data='.$GLOBALS['cache_array']['add_userid'][$userid].',ref_points='.$ref_points.',depth='.$GLOBALS['ref_level'].' - AFTER!');
                        } // END - if
 
                        // Update points...
-                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_points` SET `%s`=`%s`+%s WHERE `userid`=%s AND `ref_depth`='%s' LIMIT 1",
+                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_points` SET `%s`=`%s`+%s WHERE `userid`=%s AND `ref_depth`=%s LIMIT 1",
                                array($data, $data, $ref_points, bigintval($userid), bigintval($GLOBALS['ref_level'])), __FUNCTION__, __LINE__);
-                       //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):data={$data},ref_points={$ref_points},userid={$userid},depth={$GLOBALS['ref_level']},mode={$add_mode} - UPDATE! (".SQL_AFFECTEDROWS().")<br />");
+                       //* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>):data='.$data.',ref_points='.$ref_points.',userid='.$userid.',depth='.$GLOBALS['ref_level'].',mode='.$add_mode.' - UPDATE! ('.SQL_AFFECTEDROWS().')');
 
                        // No entry updated?
                        if (SQL_AFFECTEDROWS() < 1) {
                                // First ref in this level! :-)
-                               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_points` (`userid`,`ref_depth`,`%s`) VALUES (%s,'%s',%s)",
+                               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_points` (`userid`,`ref_depth`,`%s`) VALUES (%s,%s,%s)",
                                        array($data, bigintval($userid), bigintval($GLOBALS['ref_level']), $ref_points), __FUNCTION__, __LINE__);
-                               //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):data={$data},ref_points={$ref_points},userid={$userid},depth={$GLOBALS['ref_level']},mode={$add_mode} - INSERTED! (".SQL_AFFECTEDROWS().")<br />");
+                               //* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>):data='.$data.',ref_points='.$ref_points.',userid='.$userid.',depth='.$GLOBALS['ref_level'].',mode='.$add_mode.' - INSERTED! ('.SQL_AFFECTEDROWS().')');
                        } // END - if
 
                        // Points updated, maybe I shall send him an email?
@@ -1309,32 +1320,32 @@ function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify
                        // Maybe there's another ref?
                        if ((getUserData('refid') > 0) && ($points > 0) && (getUserData('refid') != $userid) && ($add_mode == 'ref')) {
                                // Then let's credit him here...
-                               //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):userid={$userid},ref=".getUserData('refid').",points={$points} - ADVANCE!<br />");
+                               //* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>):userid='.$userid.',ref='.getUserData('refid').',points='.$points.' - ADVANCE!');
                                addPointsThroughReferalSystem(sprintf("%s_ref:%s", $subject, $GLOBALS['ref_level']), getUserData('refid'), $points, $sendNotify, getUserData('refid'), $locked);
                        } // END - if
                } // END - if
        } // END - if
 
-       //* DEBUG: */ print("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
+       //* DEBUG: */ debugOutput('</li></ul>----------------------- <font color="#aa0000">'.__FUNCTION__.' - EXIT</font> ------------------------<br />');
 }
 
 // Updates the referal counter
 function updateReferalCounter ($userid) {
        // Make it sure referal level zero (member him-/herself) is at least selected
        if (empty($GLOBALS['cache_array']['ref_level'][$userid])) $GLOBALS['cache_array']['ref_level'][$userid] = 1;
-       //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):userid={$userid},level={$GLOBALS['cache_array']['ref_level'][$userid]}<br />");
+       //* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>):userid='.$userid.',level='.$GLOBALS['cache_array']['ref_level'][$userid]);
 
        // Update counter
        SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_refsystem` SET `counter`=`counter`+1 WHERE `userid`=%s AND `level`='%s' LIMIT 1",
                array(bigintval($userid), $GLOBALS['cache_array']['ref_level'][$userid]), __FUNCTION__, __LINE__);
 
        // When no entry was updated then we have to create it here
-       //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):updated=".SQL_AFFECTEDROWS().'<br />');
+       //* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>):updated=' . SQL_AFFECTEDROWS());
        if (SQL_AFFECTEDROWS() < 1) {
                // First count!
                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_refsystem` (`userid`, `level`, `counter`) VALUES (%s,%s,1)",
                        array(bigintval($userid), $GLOBALS['cache_array']['ref_level'][$userid]), __FUNCTION__, __LINE__);
-               //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):userid={$userid}<br />");
+               //* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>):userid='.$userid);
        } // END - if
 
        // Init referal id
@@ -1346,17 +1357,17 @@ function updateReferalCounter ($userid) {
                $ref = getUserData('refid');
        } // END - if
 
-       //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):userid={$userid},ref={$ref}<br />");
+       //* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>):userid='.$userid.',ref='.$ref);
 
        // When he has a referal...
        if (($ref > 0) && ($ref != $userid)) {
                // Move to next referal level and count his counter one up!
-               //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):ref={$ref} - ADVANCE!<br />");
+               //* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>):ref='.$ref.' - ADVANCE!');
                $GLOBALS['cache_array']['ref_level'][$userid]++;
                updateReferalCounter($ref);
        } elseif ((($ref == $userid) || ($ref == '0')) && (isExtensionInstalledAndNewer('cache', '0.1.2'))) {
                // Remove cache here
-               //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):ref={$ref} - CACHE!<br />");
+               //* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>):ref='.$ref.' - CACHE!');
                rebuildCache('refsystem', 'refsystem');
        }
 
@@ -1742,7 +1753,7 @@ function getWhatFromModule ($modCheck) {
        // Default is empty
        $what = '';
 
-       //* DEBUG: */ print(__LINE__.'!'.$modCheck."!<br />");
+       //* DEBUG: */ debugOutput(__LINE__.'!'.$modCheck.'!');
        switch ($modCheck) {
                case 'admin':
                        $what = 'overview';
@@ -2000,7 +2011,7 @@ function generateReceiverList ($cat, $receiver, $mode = '') {
 
 // "Getter" for array for user refs and points in given level
 function getUserReferalPoints ($userid, $level) {
-       //* DEBUG: */ print("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
+       //* DEBUG: */ debugOutput('----------------------- <font color="#00aa00">'.__FUNCTION__.' - ENTRY</font> ------------------------<ul><li>');
        // Default is no refs and no nickname
        $add = '';
        $refs = array();
@@ -2074,7 +2085,7 @@ ORDER BY
        SQL_FREERESULT($result);
 
        // Return result
-       //* DEBUG: */ print("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
+       //* DEBUG: */ debugOutput('</li></ul>----------------------- <font color="#aa0000">'.__FUNCTION__.' - EXIT</font> ------------------------<br />');
        return $refs;
 }
 
index 65b4e36774bc95500ad7dfcf101e77b73124f080..c213c83e659721d5a9efbbff98924be00b4d758e 100644 (file)
@@ -90,7 +90,7 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
                                // Load personal data
                                if (fetchUserData($userid)) {
                                        // The final receiver does exists so we can continue...
-                                       //* DEBUG: */ print("OK!/L:".__LINE__."<br />");
+                                       //* DEBUG: */ debugOutput('OK!/L:'.__LINE__);
 
                                        // Mark this user as "spammed" ;-) And place a line for him...
                                        if (removeReceiver($dummy, $key, $userid, $DATA['id'], $DATA['id'], true) == 'done') {
@@ -123,7 +123,7 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
                                                // Do we have send maximum mails?
                                                if (($GLOBALS['pool_cnt'] >= getConfig('max_send')) || (countSelection($dummy) == 0)) {
                                                        // Yes, we have
-                                                       //* DEBUG: */ print("*EXIT/L:".__LINE__."<br />");
+                                                       //* DEBUG: */ debugOutput('*EXIT/L:'.__LINE__);
                                                        break;
                                                } // END - if
                                        } // END - if
@@ -135,12 +135,12 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
                                // Update entry (or add missing
                                $P = $GLOBALS['pool_cnt'];
                                if (!empty($cnt2) && empty($GLOBALS['pool_cnt'])) $P = $cnt2;
-                               //* DEBUG: */ print("+MEDIA/L:".__LINE__.'/'.$P."+<br />");
+                               //* DEBUG: */ debugOutput('+MEDIA/L:'.__LINE__.'/'.$P.'+');
                                updateMediadataEntry(array('total_send', 'bonus_send'), 'add', $P);
                        } // END - if
 
                        // Close sending system
-                       //* DEBUG: */ print("-L:".__LINE__.'/'.countSelection($dummy)."-<br />");
+                       //* DEBUG: */ debugOutput('-L:'.__LINE__.'/'.countSelection($dummy).'-');
                        if (countSelection($dummy) == 0) {
                                // Queue reached!
                                SQL_QUERY_ESC("UPDATE
@@ -153,12 +153,12 @@ WHERE
        `id`=%s
 LIMIT 1",
                                        array(bigintval($DATA['id'])), __FILE__, __LINE__);
-                               //* DEBUG: */ print("*L:".__LINE__."*<br />");
+                               //* DEBUG: */ debugOutput('*L:'.__LINE__.'*');
 
                                // Update mediadata if version is 0.0.4 or higher
                                if (isExtensionInstalledAndNewer('mediadata', '0.0.4')) {
                                        // Update entry (or add missing)
-                                       //* DEBUG: */ print("*MEDIA/L:".__LINE__."*<br />");
+                                       //* DEBUG: */ debugOutput('*MEDIA/L:'.__LINE__.'*');
                                        updateMediadataEntry(array('total_orders', 'bonus_orders'), 'add', 1);
                                } // END - if
                        } elseif ($GLOBALS['pool_cnt'] >= getConfig('max_send')) {
@@ -177,9 +177,7 @@ LIMIT 1",
                                                implode(';', $dummy),
                                                bigintval($DATA['id'])
                                        ), __FILE__, __LINE__);
-                               //* DEBUG: */ print("*L:".__LINE__."<pre>");
-                               //* DEBUG: */ print(print_r($dummy, true));
-                               //* DEBUG: */ print("</pre>\n!!!<br />");
+                               //* DEBUG: */ debugOutput('*L:'.__LINE__.'<pre>'.print_r($dummy, true).'</pre>!!!');
                                break;
                        }
                } // END - while
index 744fb6b3ee47a8ed0c60597cec671d6bbf299202..d51453f469f79379b1023cfeb44dfe94ed1a23d2 100644 (file)
@@ -93,14 +93,14 @@ if (SQL_NUMROWS($result_main) > 0) {
                        // We can now send mails to them...
                        foreach ($receiverS as $key => $userid) {
                                // Lookup user id
-                               //* DEBUG: */ outputHtml("*L:".__LINE__.'/'.SQL_NUMROWS($result_user)."*<br />");
+                               //* DEBUG: */ debugOutput('*L:'.__LINE__.'/'.SQL_NUMROWS($result_user).'*');
                                if (fetchUserData($userid)) {
                                        // Do we have a stats entry?
                                        $result_stats = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `pool_id`=%s AND `userid`=%s AND timestamp_ordered='%s' LIMIT 1",
                                                array($DATA['id'], $DATA['sender'], $DATA['timestamp']), __FILE__, __LINE__);
 
                                        // If there's no stats entry add it!
-                                       //* DEBUG: */ outputHtml("!L:".__LINE__.'/'.SQL_NUMROWS($result_stats)."!<br />");
+                                       //* DEBUG: */ debugOutput('!L:'.__LINE__.'/'.SQL_NUMROWS($result_stats).'!');
                                        if (SQL_NUMROWS($result_stats) == 0) {
                                                // No entry was found, so we add him!
                                                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_stats` (`pool_id` , `userid`, `cat_id`, `payment_id`, `subject`, `url` , `max_rec` , `timestamp_ordered`, `timestamp_sstart`) VALUES ('%s','%s','%s','%s','%s','%s','%s','%s' , UNIX_TIMESTAMP())",
@@ -111,13 +111,13 @@ if (SQL_NUMROWS($result_main) > 0) {
                                                        array(bigintval($DATA['id']), bigintval($DATA['sender']), bigintval($DATA['timestamp'])), __FILE__, __LINE__);
                                        } // END - if
 
-                                       //* DEBUG: */ outputHtml("!L:".__LINE__.'/'.SQL_NUMROWS($result_stats)."!<br />");
+                                       //* DEBUG: */ debugOutput('!L:'.__LINE__.'/'.SQL_NUMROWS($result_stats).'!');
                                        if (SQL_NUMROWS($result_stats) == 1) {
                                                // We got one!
                                                list($stats_id) = SQL_FETCHROW($result_stats);
 
                                                // Mark this user as "spammed" ;-) And place a line for him...
-                                               //* DEBUG: */ outputHtml("?L:".__LINE__.'/'.$dummy.'/'.$key.'/'.$userid.'('.['sender'].")/".$DATA['id'].'/'.$stats_id."?<br />");
+                                               //* DEBUG: */ debugOutput('?L:'.__LINE__.'/'.$dummy.'/'.$key.'/'.$userid.'('.['sender'].')/'.$DATA['id'].'/'.$stats_id.'?');
                                                switch (removeReceiver($dummy, $key, bigintval($userid), bigintval($DATA['id']), bigintval($stats_id))) {
                                                        case 'done':
                                                                // Prepare the mail
@@ -151,25 +151,25 @@ if (SQL_NUMROWS($result_main) > 0) {
                                                                // Update mediadata if version is 0.0.4 or higher
                                                                if (isExtensionInstalledAndNewer('mediadata', '0.0.4')) {
                                                                        // Update entry (or add missing)
-                                                                       //* DEBUG: */ outputHtml("*MEDIA/L:".__LINE__."*<br />");
+                                                                       //* DEBUG: */ debugOutput('*MEDIA/L:'.__LINE__.'*');
                                                                        updateMediadataEntry(array('total_send', 'normal_send'), 'add', 1);
                                                                } // END - if
 
                                                                // And count up the mail
                                                                $GLOBALS['pool_cnt']++;
-                                                               //* DEBUG: */ outputHtml("*EXIT/L:".__LINE__.'/'.$GLOBALS['pool_cnt']."*<br />");
+                                                               //* DEBUG: */ debugOutput('*EXIT/L:'.__LINE__.'/'.$GLOBALS['pool_cnt'].'*');
                                                                break;
 
                                                        case 'already':
                                                                // Entry already found, but we still count one up!
                                                                $GLOBALS['pool_cnt']++;
-                                                               //* DEBUG: */ outputHtml("*EXIT/L:".__LINE__.'/'.$GLOBALS['pool_cnt']."<br />");
+                                                               //* DEBUG: */ debugOutput('*EXIT/L:'.__LINE__.'/'.$GLOBALS['pool_cnt']);
                                                                break;
                                                }
                                        }
 
                                        // Do we have reached the maximum to send mails? || (getConfig('max_send') >= $GLOBALS['pool_cnt'])
-                                       //* DEBUG: */ outputHtml("*L:".__LINE__.'/'.$GLOBALS['pool_cnt'].">=".$DATA['target_send'].'/'.getConfig('max_send').">=".$GLOBALS['pool_cnt'].'/'.$lastSentId."!=".$DATA['id']."*<br />");
+                                       //* DEBUG: */ debugOutput('*L:'.__LINE__.'/'.$GLOBALS['pool_cnt'].'>='.$DATA['target_send'].'/'.getConfig('max_send').'>='.$GLOBALS['pool_cnt'].'/'.$lastSentId.'!='.$DATA['id'].'*');
                                        if ((($GLOBALS['pool_cnt'] >= $DATA['target_send'])) && ($lastSentId != $DATA['id'])) {
                                                // Prepare content
                                                $content = array(
@@ -206,11 +206,11 @@ if (SQL_NUMROWS($result_main) > 0) {
                                                // Update mediadata if version is 0.0.4 or higher
                                                if (isExtensionInstalledAndNewer('mediadata', '0.0.4')) {
                                                        // Update entry (or add missing)
-                                                       //* DEBUG: */ outputHtml("*MEDIA/L:".__LINE__."*<br />");
+                                                       //* DEBUG: */ debugOutput('*MEDIA/L:'.__LINE__.'*');
                                                        updateMediadataEntry(array('total_orders', 'normal_orders'), 'add', 1);
                                                } // END - if
 
-                                               //* DEBUG: */ outputHtml("*EXIT/L:".__LINE__.'/'.$P."<br />");
+                                               //* DEBUG: */ debugOutput('*EXIT/L:'.__LINE__.'/'.$P);
                                                break;
                                        }
                                        // Do we have send maximum mails?
@@ -224,7 +224,7 @@ if (SQL_NUMROWS($result_main) > 0) {
                                                                bigintval($DATA['id'])
                                                        ), __FILE__, __LINE__);
 
-                                               //* DEBUG: */ outputHtml("*EXIT/L:".__LINE__."*<br />");
+                                               //* DEBUG: */ debugOutput('*EXIT/L:'.__LINE__.'*');
                                                break;
                                        }
 
index 6071b76d863d1ed6728ba8d154680bc25e963e81..2694fb51aa5532b351e96d63ef2715c27d2326e4 100644 (file)
@@ -79,14 +79,14 @@ WHERE
 ORDER BY
        `userid` ASC", __FILE__, __LINE__);
 
-//* DEBUG: */ outputHtml(basename(__FILE__).":payout=0;daily|numRows=".SQL_NUMROWS($result_daily)."<br />");
+//* DEBUG: */ debugOutput(basename(__FILE__) . ':payout=0;daily|numRows=' . SQL_NUMROWS($result_daily));
 if (SQL_NUMROWS($result_daily) > 0) {
        // Init SQLs
        initSqls();
 
        // Start checking accounts which are on 0 confirmed-to-go mails
        while ($content = SQL_FETCHARRAY($result_daily)) {
-               //* DEBUG: */ outputHtml(basename(__FILE__).":userid={$content['userid']}<br />");
+               //* DEBUG: */ debugOutput(basename(__FILE__) . ':' . $content['userid']);
                $result_points = SQL_QUERY_ESC("SELECT
        `ref_depth`,
        `locked_points`
@@ -99,14 +99,14 @@ ORDER BY
        `ref_depth` ASC",
                        array(bigintval($content['userid'])), __FILE__, __LINE__);
 
-               //* DEBUG: */ outputHtml(basename(__FILE__).":payout=0;points|numRows=".SQL_NUMROWS($result_points)."<br />");
+               //* DEBUG: */ debugOutput(basename(__FILE__) . ':payout=0;points|numRows=' . SQL_NUMROWS($result_points));
                if (SQL_NUMROWS($result_points) > 0) {
                        // Ok transfer points
                        while ($content2 = SQL_FETCHARRAY($result_points)) {
                                // Merge both arrays
                                $content = merge_array($content, $content2);
 
-                               //* DEBUG: */ outputHtml(basename(__FILE__).":userid={$content['userid']},depth={$content['ref_depth']},locked={$content['locked_points']}<br />");
+                               //* DEBUG: */ debugOutput(basename(__FILE__) . ':userid=' . $content['userid'].',depth='.$content['ref_depth'].',locked='.$content['locked_points']);
                                addSql(SQL_QUERY_ESC("UPDATE
        `{?_MYSQL_PREFIX?}_user_points`
 SET
index 2b4b74702ae21d9a8d68f0f49b271eaeb8e1e0f3..a87bfc48862b32e2ab3e7611500a70ad8a13ba8d 100644 (file)
@@ -78,7 +78,7 @@ function getActualVersion ($type = 'Revision') {
 
                                // Get array for mapping information
                                $mapper = array_flip(getSearchFor());
-                               //* DEBUG: */ print('<pre>mapper='.print_r($mapper, true).'</pre>ins_vers=<pre>'.print_r($ins_vers, true).'</pre>');
+                               //* DEBUG: */ debugOutput('<pre>mapper='.print_r($mapper, true).'</pre>ins_vers=<pre>'.print_r($ins_vers, true).'</pre>');
 
                                // Is the content valid?
                                if ((!is_array($ins_vers)) || (count($ins_vers) <= 0) || (!isset($ins_vers[$mapper[$type]])) || (trim($ins_vers[$mapper[$type]]) == '') || ($ins_vers[0]) == 'new') {
index 0d704543960b9cb4c966661ca58f9679e64b3e27..712bc1967a685d6545b95b5c0588b33ac16594ba 100644 (file)
@@ -115,7 +115,7 @@ function countSqls () {
 
 // Checks wether the SQLs array is filled
 function isSqlsValid () {
-       //* DEBUG: */ print __FUNCTION__.':'.intval(isSqlsInitialized()).'/'.countSqls().'/'.getCurrentExtensionName().'<br />';
+       //* DEBUG: */ debugOutput(__FUNCTION__.':'.intval(isSqlsInitialized()).'/'.countSqls().'/'.getCurrentExtensionName());
        return (
                (
                        isSqlsInitialized()
index 5bc89a05f366da844c18161cb7be874616a5460b..ff399cbf86e0066338a557a3293c8e1630b37751 100644 (file)
@@ -722,7 +722,7 @@ function isExtensionInstalledAndNewer ($ext_name, $version) {
        }
 
        // Return it
-       //* DEBUG: */ print __FUNCTION__.':'.$ext_name.'=&gt;'.$version.':'.intval($GLOBALS['ext_installed_newer'][$ext_name][$version]).'<br />';
+       //* DEBUG: */ debugOutput(__FUNCTION__.':'.$ext_name.'=&gt;'.$version.':'.intval($GLOBALS['ext_installed_newer'][$ext_name][$version]));
        return $GLOBALS['ext_installed_newer'][$ext_name][$version];
 }
 
@@ -737,7 +737,7 @@ function isExtensionInstalledAndOlder ($ext_name, $version) {
        }
 
        // Return it
-       //* DEBUG: */ print __FUNCTION__.':'.$ext_name.'&lt;'.$version.':'.intval($GLOBALS['ext_installed_older'][$ext_name][$version]).'<br />';
+       //* DEBUG: */ debugOutput(__FUNCTION__.':'.$ext_name.'&lt;'.$version.':'.intval($GLOBALS['ext_installed_older'][$ext_name][$version]));
        return $GLOBALS['ext_installed_older'][$ext_name][$version];
 }
 
@@ -1044,5 +1044,10 @@ function getTotalConfirmedUser () {
        return $GLOBALS['total_confirmed_users'];
 }
 
+// Wrapper for writing debug informations to the browser
+function debugOutput ($message) {
+       outputHtml('<div class="debug_message">' . $message . '</div>');
+}
+
 // [EOF]
 ?>
index dd00d82559520967699ab4eb38dedb69693b2866..de9f9d126c755c10738b5fedcd3d250a2389b4ee 100644 (file)
@@ -4,9 +4,12 @@
                href="{%url=modules.php?module=admin&amp;what=list_user&amp;userid=$content[userid]%}">$content[userid]</a>$content[bold_r]
        </td>
        <td align="center" class="switch_sw$content[sw] bottom right">
-       $content[bold_l]$content[old]$content[bold_r]</td>
+               $content[bold_l]$content[rews]$content[bold_r]
+       </td>
        <td align="center" class="switch_sw$content[sw] bottom right">
-       $content[bold_l]$content[cnt]$content[bold_r]</td>
+               $content[bold_l]$content[cnt]$content[bold_r]
+       </td>
        <td align="center" class="switch_sw$content[sw] bottom">
-       $content[bold_l]$content[opoints]$content[bold_r]</td>
+               $content[bold_l]{%pipe,translateComma=$content[opoints]%}$content[bold_r]
+       </td>
 </tr>
index abd0d8c08443568f900cdc3faa57302670016f10..c11b7d4b1b54a8b2e3c7ffb50dbd97f3927e088e 100644 (file)
@@ -10,7 +10,7 @@
        </td>
        <td align="center" class="switch_sw$content[sw] bottom right">
                <strong>{--RALLYE_ADMIN_ID--}:</strong><br />
-               $content[admin_link]
+               {%pipe,generateAdminLink=$content[admin_id]%}
        </td>
        <td align="center" class="switch_sw$content[sw] bottom right">
                <strong>{--RALLYE_TSTART--}:</strong><br />
        </td>
        <td align="center" class="switch_sw$content[sw] bottom right">
                <strong>{--RALLYE_AUTO_ADD--}:</strong><br />
-               <a href="{%url=modules.php?module=admin&amp;what=list_rallyes&amp;rallye=$content[id]&amp;auto=$content[auto]%}" title="$content[auto_title]">$content[auto_lnk]</a>
+               <a href="{%url=modules.php?module=admin&amp;what=list_rallyes&amp;rallye=$content[id]&amp;auto=$content[auto]%}" title="$content[auto_title]">{%pipe,translateYesNo=$content[auto_add_new_user]%}</a>
        </td>
        <td align="center" class="switch_sw$content[sw] bottom right">
                <strong>{--RALLYE_ACTIVE--}:</strong><br />
-               <a href="{%url=modules.php?module=admin&amp;what=list_rallyes&amp;rallye=$content[id]&amp;activate=$content[active]%}" title="$content[active_title]">$content[active_lnk]</a>
+               <a href="{%url=modules.php?module=admin&amp;what=list_rallyes&amp;rallye=$content[id]&amp;activate=$content[active]%}" title="$content[active_title]">{%pipe,translateYesNo=$content[is_active]%}</a>
        </td>
        <td align="center" class="switch_sw$content[sw] bottom right">
                <strong>{--RALLYE_NOTIFY--}:</strong><br />
-               <a ref="{%url=modules.php?module=admin&amp;what=list_rallyes&amp;rallye=$content[id]&amp;notify=$content[notify]%}" title="$content[notify_title]">$content[notify_lnk]</a>
+               <a ref="{%url=modules.php?module=admin&amp;what=list_rallyes&amp;rallye=$content[id]&amp;notify=$content[notify]%}" title="$content[notify_title]">{%pipe,translateYesNo=$content[send_notify]%}</a>
        </td>
        <td align="center" class="switch_sw$content[sw] bottom">
                <strong>{--RALLYE_NOTIFIED--}:</strong><br />
-               $content[notified]
+               {%pipe,translateYesNo=$content[notified]%}
        </td>
 </tr>
 <tr>
        <td align="center" class="switch_sw$content[sw] bottom right" colspan="3">
                <strong>{--RALLYE_ASSIGNED_PRICES--}:</strong><br />
-               <a href="{%url=modules.php?module=admin&amp;what=config_rallye_prices&amp;rallye=$content[id]%}">$content[prices_cnt]</a>
+               <a href="{%url=modules.php?module=admin&amp;what=config_rallye_prices&amp;rallye=$content[id]%}">{%pipe,translateComma=$content[prices_cnt]%}</a>
        </td>
        <td align="center" class="switch_sw$content[sw] bottom" colspan="2">
                <strong>{--RALLYE_ASSIGNED_USERS--}:</strong><br />
-               $content[joined]
+               $content[users_content]
        </td>
 </tr>
 <tr>