]> git.mxchange.org Git - mailer.git/commitdiff
Inconsistency between echo and print() fixed to OUTPUT_HTML() (not all)
authorRoland Häder <roland@mxchange.org>
Tue, 6 Oct 2009 20:04:31 +0000 (20:04 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 6 Oct 2009 20:04:31 +0000 (20:04 +0000)
39 files changed:
birthday_confirm.php
inc/config-functions.php
inc/db/lib-mysql3.php
inc/extensions.php
inc/filters.php
inc/functions.php
inc/gen_refback.php
inc/libs/admins_functions.php
inc/libs/cache_functions.php
inc/libs/rallye_functions.php
inc/libs/refback_functions.php
inc/libs/surfbar_functions.php
inc/libs/wernis_functions.php
inc/libs/yoomedia_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/admin/what-logs.php
inc/modules/guest/action-themes.php
inc/modules/member/action-themes.php
inc/monthly/monthly_beg.php
inc/monthly/monthly_bonus.php
inc/monthly/monthly_newsletter.php
inc/monthly/monthly_surfbar.php
inc/mysql-connect.php
inc/mysql-manager.php
inc/pool/pool-bonus.php
inc/pool/pool-user.php
inc/reset/reset_beg.php
inc/reset/reset_bonus.php
inc/reset/reset_daily.php
inc/reset/reset_engine.php
inc/reset/reset_holiday.php
inc/reset/reset_surfbar.php
inc/security.php
inc/session-functions.php
inc/weekly/weekly_surfbar.php

index 70332e33f76b089126513652de93ad298407de55..f72b7a7195edd20c61a75ee27ce82232fc4e6271 100644 (file)
@@ -76,7 +76,7 @@ WHERE
        b.userid=%s AND b.chk_value='%s'
 LIMIT 1",
        array($uid, $chk), __FILE__, __LINE__);
-//* DEBUG: */ echo "uid=".$uid.",chk=".$chk." (".strlen($chk).'/'.strlen(REQUEST_GET('check')).'/'.SQL_NUMROWS($result).")<br />\n";
+//* DEBUG: */ OUTPUT_HTML("uid=".$uid.",chk=".$chk." (".strlen($chk).'/'.strlen(REQUEST_GET('check')).'/'.SQL_NUMROWS($result).")<br />");
 
 // Prepare content
 $content = array();
index d261faecaa7a200c538dacbb876dfcc4098b5c29..c70857e9af77a6b39957d952af2335b5cb34ab74 100644 (file)
@@ -113,7 +113,7 @@ function loadConfiguration ($no = '0') {
        // Check for cache extension, cache-array and if the requested configuration is in cache
        if ((isset($GLOBALS['cache_array'])) && (is_array($GLOBALS['cache_array'])) && (isset($GLOBALS['cache_array']['config'][$no])) && (is_array($GLOBALS['cache_array']['config'][$no]))) {
                // Load config from cache
-               //* DEBUG: */ echo gettype($GLOBALS['cache_array']['config'][$no])."<br />\n";
+               //* DEBUG: */ OUTPUT_HTML(gettype($GLOBALS['cache_array']['config'][$no])."<br />");
                foreach ($GLOBALS['cache_array']['config'][$no] as $key => $value) {
                        setConfigEntry($key, $value);
                } // END - foreach
@@ -216,7 +216,7 @@ function updateOldConfigFile () {
                        // Is the line found?
                        if ((substr($line, 0, strlen($old)) == $old) && (!isset($done[$old]))) {
                                // Entry found!
-                               //* DEBUG: */ print htmlentities($line) . " - FOUND!<br />\n";
+                               //* DEBUG: */ OUTPUT_HTML(htmlentities($line) . " - FOUND!<br />");
 
                                // Eval the line...
                                eval($line);
@@ -247,9 +247,9 @@ function updateOldConfigFile () {
                                } // END - if
 
                                /// ... and write it to the new config
-                               //* DEBUG: */ print 'function=' . $function . ',new=' . $new . ',comment=' . $comment . "<br />\n";
+                               //* DEBUG: */ OUTPUT_HTML('function=' . $function . ',new=' . $new . ',comment=' . $comment . "<br />");
                                changeDataInFile(constant('PATH') . 'inc/cache/config-local.php', $comment, $function . "('" . $oldNew . "', \"", "\");", constant($new), 0);
-                               //* DEBUG: */ print "CHANGED!<br />\n";
+                               //* DEBUG: */ OUTPUT_HTML("CHANGED!<br />");
 
                                // Mark it as done
                                $done[$old] = 1;
@@ -280,7 +280,7 @@ function updateOldConfigFile () {
                        }
 
                        // Debug output only
-                       //* DEBUG: */ print htmlentities($line) . " - MySQL!<br />\n";
+                       //* DEBUG: */ OUTPUT_HTML(htmlentities($line) . " - MySQL!<br />");
 
                        // Split parts so we can check them and prepare them
                        $parts = explode('=>', $line);
index 0d97094c82d13cc01ddc966b90450e57e7fd62cf..bb43adeba8f2a3ed8142c5862bb582938c6f6642 100644 (file)
@@ -70,12 +70,12 @@ function SQL_QUERY ($sql_string, $F, $L) {
        $querytimeBefore = array_sum(explode(' ', microtime()));
 
        // Run SQL command
-       //* DEBUG: */ print $sql_string."<br />\n";
+       //* DEBUG: */ OUTPUT_HTML($sql_string."<br />");
        $result = mysql_query($sql_string, SQL_GET_LINK())
                or addFatalMessage(__FUNCTION__, __LINE__, $F." (".$L."):".mysql_error()."<br />
 Query string:<br />
 ".$sql_string);
-       //* DEBUG: */ print __LINE__ . ': numRows=' . SQL_NUMROWS($result) . ',affected=' . SQL_AFFECTEDROWS() . "<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__LINE__ . ': numRows=' . SQL_NUMROWS($result) . ',affected=' . SQL_AFFECTEDROWS() . "<br />");
 
        // Ending time
        $querytimeAfter = array_sum(explode(' ', microtime()));
@@ -90,7 +90,7 @@ Query string:<br />
        incrementConfigEntry('sql_count');
 
        // Debug output
-       //* DEBUG: */ print "Query=<pre>".$sql_string."</pre>, affected=<strong>".SQL_AFFECTEDROWS()."</strong>, numrows=<strong>".SQL_NUMROWS($result)."</strong><br />\n";
+       //* DEBUG: */ OUTPUT_HTML("Query=<pre>".$sql_string."</pre>, affected=<strong>".SQL_AFFECTEDROWS()."</strong>, numrows=<strong>".SQL_NUMROWS($result)."</strong><br />");
        if ((getOutputMode() != '1') && (getOutputMode() != '-1') && (isDebugModeEnabled()) && (getConfig('DEBUG_SQL') == 'Y')) {
                //
                // Debugging stuff...
@@ -222,7 +222,7 @@ function SQL_CLOSE ($F, $L) {
        } // END - if
 
        // Do we need to update cache/db counter?
-       //* DEBUG: */ echo "DB=".getConfig('db_hits').",CACHE=".getConfig('cache_hits')."<br />\n";
+       //* DEBUG: */ OUTPUT_HTML("DB=".getConfig('db_hits').",CACHE=".getConfig('cache_hits')."<br />");
        if ((GET_EXT_VERSION('cache') >= '0.0.7') && (getConfig('db_hits') > 0) && (getConfig('cache_hits') > 0) && (isCacheInstanceValid())) {
                // Add new hits
                incrementConfigEntry('db_hits', getConfig('db_hits_run'));
@@ -326,7 +326,7 @@ function SQL_ESCAPE ($str, $secureString=true, $strip=true) {
                return smartAddSlashes($str);
        } elseif (function_exists('mysql_real_escape_string')) {
                // The new and improved version
-               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):str={$str}<br />\n";
+               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):str={$str}<br />");
                return mysql_real_escape_string($str, SQL_GET_LINK());
        } elseif (function_exists('mysql_escape_string')) {
                // The obsolete function
@@ -391,7 +391,7 @@ function SQL_ALTER_TABLE ($sql, $F, $L) {
                // 123           4       4     3    3      4           4          32    23           4       4     3    3      4            4          321
                if (((SQL_NUMROWS($result) == 0) && (strpos($sql, 'ADD') !== false)) || ((SQL_NUMROWS($result) == 1) && (strpos($sql, 'DROP') !== false))) {
                        // Do the query
-                       //* DEBUG: */ print __LINE__.':'.$sql."<br />\n";
+                       //* DEBUG: */ OUTPUT_HTML(__LINE__.':'.$sql."<br />");
                        $result = SQL_QUERY($sql, $F, $L, false);
                } // END - if
        } elseif ((getConfig('_TABLE_TYPE') == 'InnoDB') && (strpos($sql, 'FULLTEXT') !== false)) {
@@ -408,11 +408,11 @@ function SQL_ALTER_TABLE ($sql, $F, $L) {
                        while (strpos($columnName, ',') !== false) {
                                // Use last
                                $columnName = str_replace('`', '', $tableArray[count($tableArray) - $begin]);
-                               //* DEBUG: */ print __LINE__.':'.$columnName."----------------".$begin."<br />\n";
+                               //* DEBUG: */ OUTPUT_HTML(__LINE__.':'.$columnName."----------------".$begin."<br />");
 
                                // Remove brackes
                                $columnName = str_replace('(', '', str_replace(')', '', $columnName));
-                               //* DEBUG: */ print __LINE__.':'.$columnName."----------------".$begin."<br />\n";
+                               //* DEBUG: */ OUTPUT_HTML(__LINE__.':'.$columnName."----------------".$begin."<br />");
 
                                // Continue
                                $begin++;
@@ -427,7 +427,7 @@ function SQL_ALTER_TABLE ($sql, $F, $L) {
                $skip = false;
                while ($content = SQL_FETCHARRAY($result)) {
                        // Is it found?
-                       //* DEBUG: */ print "<pre>".print_r($content, true)."</pre>";
+                       //* DEBUG: */ OUTPUT_HTML("<pre>".print_r($content, true)."</pre>");
                        if (($content['Column_name'] == $columnName) || ($content['Key_name'] == $columnName)) {
                                // Skip this query!
                                //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Skiped: %s", $sql));
@@ -442,12 +442,12 @@ function SQL_ALTER_TABLE ($sql, $F, $L) {
                // Shall we run it?
                if (!$skip) {
                        // Send it to the SQL_QUERY() function
-                       //* DEBUG: */ print __LINE__.':'.$sql."<br />\n";
+                       //* DEBUG: */ OUTPUT_HTML(__LINE__.':'.$sql."<br />");
                        $result = SQL_QUERY($sql, $F, $L, false);
                } // END - if
        } else {
                // Other ALTER TABLE query
-               //* DEBUG: */ print __LINE__.':'.$sql."<br />\n";
+               //* DEBUG: */ OUTPUT_HTML(__LINE__.':'.$sql."<br />");
                $result = SQL_QUERY($sql, $F, $L, false);
        }
 
index 22f218150d7cfc16d48aa0c5c416eb67d3827d7a..c9865d7f835f205cabfbd4de8e9f5b91232eae5e 100644 (file)
@@ -148,7 +148,7 @@ function REGISTER_EXTENSION ($ext_name, $task_id, $dry_run = false, $logout = tr
        // Set current extension name
        EXT_SET_CURR_NAME($ext_name);
 
-       //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME()." - ENTERED!<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME()." - ENTERED!<br />");
        // This shall never do a non-admin user or if the extension is active (already installed)
        if ((!IS_ADMIN()) || (EXT_IS_ACTIVE($ext_name))) {
                return false;
@@ -157,7 +157,7 @@ function REGISTER_EXTENSION ($ext_name, $task_id, $dry_run = false, $logout = tr
        // When this extension is already in install/update phase, all is fine
        if (EXT_IS_REGISTER_RUNNING($ext_name)) {
                // Then abort here which is fine
-               //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME()." - ALREADY!<br />\n";
+               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME()." - ALREADY!<br />");
                return true;
        } // END - if
 
@@ -236,12 +236,12 @@ function REGISTER_EXTENSION ($ext_name, $task_id, $dry_run = false, $logout = tr
                                        // Entry found?
                                        if ($task > 0) {
                                                // Try to register the extension
-                                               //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME().":ext_update=".$ext_update.",taskId=".$task."<br />\n";
+                                               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME().":ext_update=".$ext_update.",taskId=".$task."<br />");
                                                $test = REGISTER_EXTENSION($ext_update, $task, $dry_run, false);
 
                                                // Reset extension name
                                                EXT_SET_CURR_NAME($ext_name);
-                                               //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME().':'; var_dump($test);
+                                               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME().':'); var_dump($test);
                                        } // END - if
                                } elseif ($ext_ver != EXT_GET_VERSION()) {
                                        // Ok, update this extension now
@@ -273,9 +273,9 @@ function REGISTER_EXTENSION ($ext_name, $task_id, $dry_run = false, $logout = tr
                $EXT_LOAD_MODE = 'register';
 
                // Remains true if extension registration reports no failures
-               //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME().':'; var_dump($test);
+               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME().':'); var_dump($test);
                $test = (($test === true) && (EXT_GET_REPORTS_FAILURE() === false));
-               //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME().':'; var_dump($test);
+               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME().':'); var_dump($test);
 
                // Does everthing before wents ok?
                if ($test === true) {
@@ -290,7 +290,7 @@ function REGISTER_EXTENSION ($ext_name, $task_id, $dry_run = false, $logout = tr
                                runFilterChain('pre_extension_installed', array('dry_run' => $dry_run));
 
                                // Register extension
-                               //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:insert=".EXT_GET_CURR_NAME().'/'.EXT_GET_VERSION()." - INSERT!<br />\n";
+                               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."[".__LINE__."]:insert=".EXT_GET_CURR_NAME().'/'.EXT_GET_VERSION()." - INSERT!<br />");
                                SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_extensions` (ext_name, ext_active, ext_version) VALUES ('%s','%s','%s')",
                                        array(EXT_GET_CURR_NAME(), EXT_GET_ALWAYS_ACTIVE(), EXT_GET_VERSION()), __FUNCTION__, __LINE__);
 
@@ -328,7 +328,7 @@ function REGISTER_EXTENSION ($ext_name, $task_id, $dry_run = false, $logout = tr
                        $ret = false;
                }
        } elseif (($task_id > 0) && (EXT_GET_CURR_NAME() != '')) {
-               //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME()."<br />\n";
+               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME()."<br />");
                // Remove task from system when id and extension's name is valid
                SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_task_system` WHERE `id`=%s AND `status`='NEW' LIMIT 1",
                        array(bigintval($task_id)), __FUNCTION__, __LINE__);
@@ -349,7 +349,7 @@ function REGISTER_EXTENSION ($ext_name, $task_id, $dry_run = false, $logout = tr
        } // END - if
 
        // Return status code
-       //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME()." - LEFT!<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME()." - LEFT!<br />");
        //* DEBUG: */ var_dump($ret);
        return $ret;
 }
@@ -549,7 +549,7 @@ function EXTENSION_UPDATE ($ext_name, $ext_ver, $dry_run = false) {
                // And load SQL queries in order of version history
                for ($idx = ($start + 1); $idx < count($history); $idx++) {
                        // Set current extension name
-                       //* DEBUG: */ print __FUNCTION__.'['.__LINE__.':] ext_name='.$ext_name."<br />\n";
+                       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__.'['.__LINE__.':] ext_name='.$ext_name."<br />");
                        EXT_SET_CURR_NAME($ext_name);
 
                        // Set extension version
@@ -875,7 +875,7 @@ function MODULE_HAS_MENU ($mod, $forceDb = false) {
        }
 
        // Return status
-       //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME().':'; var_dump($ret);
+       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME().':'; var_dump($ret));
        return $ret;
 }
 
index a0988c9539578bc6251ec4bf6600827225cf2dcc..b282543425c85333cd4794093c7ad4d4c2385bc4 100644 (file)
@@ -359,7 +359,7 @@ function FILTER_CALL_HANDLER_LOGIN_FAILTURES ($data) {
        $content = $data;
 
        // Handle failed logins here if not in guest
-       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):type={$data['type']},action={getAction()},what={getWhat()},lvl={$data['access_level']}<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):type={$data['type']},action={getAction()},what={getWhat()},lvl={$data['access_level']}<br />");
        if ((($data['type'] == 'what') || ($data['type'] == 'action') && ((!isWhatSet()) || (getWhat() == 'overview') || (getWhat() == getConfig('index_home')))) && ($data['access_level'] != 'guest') && ((GET_EXT_VERSION('sql_patches') >= '0.4.7') || (GET_EXT_VERSION('admins') >= '0.7.0'))) {
                // Handle failure
                $content['content'] .= HANDLE_LOGIN_FAILTURES($data['access_level']);
@@ -389,7 +389,7 @@ function FILTER_AUTO_ACTIVATE_EXTENSION ($data) {
        // Is this extension always activated?
        if (EXT_GET_ALWAYS_ACTIVE() == 'Y') {
                // Then activate the extension
-               //* DEBUG: */ echo __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ext_name={$data['ext_name']}<br />\n";
+               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ext_name={$data['ext_name']}<br />");
                ACTIVATE_EXTENSION($data['ext_name']);
        } // END - if
 
index db721a542e5b3e9aaa02ab60781e010421b0aeb1..508112789ff98c0d85f315728fd3e445c60a5aea 100644 (file)
@@ -58,7 +58,7 @@ function OUTPUT_HTML ($HTML, $newLine = true) {
                                        outputRawCode($HTML);
 
                                        // That's why you don't need any \n at the end of your HTML code... :-)
-                                       if ($newLine) echo "\n";
+                                       if ($newLine) print("\n");
                                } else {
                                        // Render mode for old or lame servers...
                                        $OUTPUT .= $HTML;
@@ -74,7 +74,7 @@ function OUTPUT_HTML ($HTML, $newLine = true) {
 
                                // The same as above... ^
                                outputRawCode($HTML);
-                               if ($newLine) echo "\n";
+                               if ($newLine) print("\n");
                                break;
 
                        default:
@@ -158,7 +158,7 @@ function OUTPUT_HTML ($HTML, $newLine = true) {
 // Output the raw HTML code
 function outputRawCode ($HTML) {
        // Output stripped HTML code to avoid broken JavaScript code, etc.
-       echo stripslashes(stripslashes($HTML));
+       print(stripslashes(stripslashes($HTML)));
 
        // Flush the output if only constant('_OB_CACHING') is not 'on'
        if (constant('_OB_CACHING') != 'on') {
@@ -386,7 +386,7 @@ function LOAD_TEMPLATE ($template, $return=false, $content=array()) {
 
 // Send mail out to an email address
 function sendEmail ($toEmail, $subject, $message, $HTML = 'N', $mailHeader = '') {
-       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):TO={$toEmail},SUBJECT={$subject}<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):TO={$toEmail},SUBJECT={$subject}<br />");
 
        // Compile subject line (for POINTS constant etc.)
        $eval = "\$subject = decodeEntities(\"".COMPILE_CODE(smartAddSlashes($subject))."\");";
@@ -403,7 +403,7 @@ function sendEmail ($toEmail, $subject, $message, $HTML = 'N', $mailHeader = '')
                        // Load email address
                        $result_email = SQL_QUERY_ESC("SELECT `email` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1",
                                array(bigintval($toEmail)), __FUNCTION__, __LINE__);
-                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):numRows=".SQL_NUMROWS($result_email)."<br />\n";
+                       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):numRows=".SQL_NUMROWS($result_email)."<br />");
 
                        // Does the user exist?
                        if (SQL_NUMROWS($result_email)) {
@@ -421,7 +421,7 @@ function sendEmail ($toEmail, $subject, $message, $HTML = 'N', $mailHeader = '')
                // Is the webmaster!
                $toEmail = constant('WEBMASTER');
        }
-       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):TO={$toEmail}<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):TO={$toEmail}<br />");
 
        // Check for PHPMailer or debug-mode
        if (!checkPhpMailerUsage()) {
@@ -793,25 +793,25 @@ function LOAD_EMAIL_TEMPLATE ($template, $content = array(), $UID = '0') {
        } // END - if
 
        // Load user's data
-       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):UID={$UID},template={$template},content[]=".gettype($content)."<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):UID={$UID},template={$template},content[]=".gettype($content)."<br />");
        if (($UID > 0) && (is_array($content))) {
                // If nickname extension is installed, fetch nickname as well
                if (EXT_IS_ACTIVE('nickname')) {
-                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):NICKNAME!<br />\n";
+                       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):NICKNAME!<br />");
                        // Load nickname
                        $result = SQL_QUERY_ESC("SELECT `surname`, `family`, `gender`, `email`, `nickname` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1",
                                array(bigintval($UID)), __FUNCTION__, __LINE__);
                } else {
-                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):NO-NICK!<br />\n";
+                       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):NO-NICK!<br />");
                        /// Load normal data
                        $result = SQL_QUERY_ESC("SELECT `surname`, `family`, `gender`, `email` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1",
                                array(bigintval($UID)), __FUNCTION__, __LINE__);
                }
 
                // Fetch and merge data
-               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):content()=".count($content)." - PRE<br />\n";
+               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):content()=".count($content)." - PRE<br />");
                $content = merge_array($content, SQL_FETCHARRAY($result));
-               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):content()=".count($content)." - AFTER<br />\n";
+               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):content()=".count($content)." - AFTER<br />");
 
                // Free result
                SQL_FREERESULT($result);
@@ -1031,10 +1031,10 @@ function COMPILE_CODE ($code, $simple = false, $constants = true, $full = true)
                                $test = substr($found, 0, strlen($match));
 
                                // Does this entry exist?
-                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):found={$found},match={$match},set={$set}<br />\n";
+                               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):found={$found},match={$match},set={$set}<br />");
                                if ($test == $match) {
                                        // Match found!
-                                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):fuzzyFound!<br />\n";
+                                       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):fuzzyFound!<br />");
                                        $fuzzyFound = true;
                                        break;
                                } // END - if
@@ -1046,14 +1046,14 @@ function COMPILE_CODE ($code, $simple = false, $constants = true, $full = true)
                        // Take all string elements
                        if ((is_string($matches[4][$key])) && (!isset($matchesFound[$match])) && (!isset($matchesFound[$key."_" . $matches[4][$key]]))) {
                                // Replace it in the code
-                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):key={$key},match={$match}<br />\n";
+                               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):key={$key},match={$match}<br />");
                                $newMatch = str_replace("[" . $matches[4][$key]."]", "['" . $matches[4][$key]."']", $match);
                                $code = str_replace($match, "\"." . $newMatch.".\"", $code);
                                $matchesFound[$key."_" . $matches[4][$key]] = 1;
                                $matchesFound[$match] = 1;
                        } elseif (!isset($matchesFound[$match])) {
                                // Not yet replaced!
-                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):match={$match}<br />\n";
+                               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):match={$match}<br />");
                                $code = str_replace($match, "\"." . $match.".\"", $code);
                                $matchesFound[$match] = 1;
                        }
@@ -1373,25 +1373,25 @@ function createTimeSelections ($timestamp, $prefix = '', $display = '', $align =
 
        // First of all years...
        $Y = abs(floor($timestamp / (31536000 + $SWITCH)));
-       //* DEBUG: */ print("Y={$Y}<br />\n");
+       //* DEBUG: */ print("Y={$Y}<br />");
        // Next months...
        $M = abs(floor($timestamp / 2628000 - $Y * 12));
-       //* DEBUG: */ print("M={$M}<br />\n");
+       //* DEBUG: */ print("M={$M}<br />");
        // 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 />\n");
+       //* DEBUG: */ print("W={$W}<br />");
        // 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 />\n");
+       //* DEBUG: */ print("D={$D}<br />");
        // 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 />\n");
+       //* DEBUG: */ print("h={$h}<br />");
        // 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 />\n");
+       //* DEBUG: */ print("m={$m}<br />");
        // 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 />\n");
+       //* DEBUG: */ print("s={$s}<br />");
 
        // Is seconds zero and time is < 60 seconds?
        if (($s == 0) && ($timestamp < 60)) {
@@ -1745,7 +1745,7 @@ function extractHostnameFromUrl (&$script) {
        if (ereg('/', $host)) $host = substr($host, 0, strpos($host, '/'));
 
        // Generate relative URL
-       //* DEBUG: */ print("SCRIPT=" . $script."<br />\n");
+       //* DEBUG: */ print("SCRIPT=" . $script."<br />");
        if (substr(strtolower($script), 0, 7) == 'http://') {
                // But only if http:// is in front!
                $script = substr($script, (strlen($url) + 7));
@@ -1754,7 +1754,7 @@ function extractHostnameFromUrl (&$script) {
                $script = substr($script, (strlen($url) + 8));
        }
 
-       //* DEBUG: */ print("SCRIPT=" . $script."<br />\n");
+       //* DEBUG: */ print("SCRIPT=" . $script."<br />");
        if (substr($script, 0, 1) == '/') $script = substr($script, 1);
 
        // Return host name
@@ -1843,7 +1843,7 @@ function sendRawRequest ($host, $request) {
        } // END - if
 
        // Open connection
-       //* DEBUG: */ die("SCRIPT=" . $script."<br />\n");
+       //* DEBUG: */ die("SCRIPT=" . $script."<br />");
        if ($useProxy === true) {
                // Connect to host through proxy connection
                $fp = @fsockopen(COMPILE_CODE(getConfig('proxy_host')), bigintval(getConfig('proxy_port')), $errno, $errdesc, 30);
@@ -1961,11 +1961,11 @@ function isEmailValid ($email) {
 function isUrlValid ($URL, $compile=true) {
        // Trim URL a little
        $URL = trim(urldecode($URL));
-       //* DEBUG: */ echo $URL."<br />";
+       //* DEBUG: */ OUTPUT_HTML($URL."<br />");
 
        // Compile some chars out...
        if ($compile === true) $URL = compileUriCode($URL, false, false, false);
-       //* DEBUG: */ echo $URL."<br />";
+       //* DEBUG: */ OUTPUT_HTML($URL."<br />");
 
        // Check for the extension filter
        if (EXT_IS_ACTIVE('filter')) {
@@ -1988,7 +1988,7 @@ function generateMemberAdminActionLinks ($uid, $status = '') {
 
        foreach ($TARGETS as $tar) {
                $eval .= "<span class=\\\"admin_user_link\\\"><a href=\\\"{!URL!}/modules.php?module=admin&amp;what=" . $tar."&amp;uid=" . $uid."\\\" title=\\\"{--ADMIN_LINK_";
-               //* DEBUG: */ echo "*" . $tar.'/' . $status."*<br />\n";
+               //* DEBUG: */ OUTPUT_HTML("*" . $tar.'/' . $status."*<br />");
                if (($tar == "lock_user") && ($status == 'LOCKED')) {
                        // Locked accounts shall be unlocked
                        $eval .= "UNLOCK_USER";
@@ -2069,19 +2069,19 @@ function generateHash ($plainText, $salt = '') {
 
                // 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: */ echo "SHA1=" . $sha1." (".strlen($sha1).")<br />";
+               //* DEBUG: */ OUTPUT_HTML("SHA1=" . $sha1." (".strlen($sha1).")<br />");
                $sha1 = scrambleString($sha1);
-               //* DEBUG: */ echo "Scrambled=" . $sha1." (".strlen($sha1).")<br />";
+               //* DEBUG: */ OUTPUT_HTML("Scrambled=" . $sha1." (".strlen($sha1).")<br />");
                //* DEBUG: */ $sha1b = descrambleString($sha1);
-               //* DEBUG: */ echo "Descrambled=" . $sha1b." (".strlen($sha1b).")<br />";
+               //* DEBUG: */ OUTPUT_HTML("Descrambled=" . $sha1b." (".strlen($sha1b).")<br />");
 
                // Generate the password salt string
                $salt = substr($sha1, 0, getConfig('salt_length'));
-               //* DEBUG: */ echo $salt." (".strlen($salt).")<br />";
+               //* DEBUG: */ OUTPUT_HTML($salt." (".strlen($salt).")<br />");
        } else {
                // Use given salt
                $salt = substr($salt, 0, getConfig('salt_length'));
-               //* DEBUG: */ echo "GIVEN={$salt}<br />\n";
+               //* DEBUG: */ OUTPUT_HTML("GIVEN={$salt}<br />");
        }
 
        // Return hash
@@ -2106,7 +2106,7 @@ function scrambleString($str) {
        }
 
        // Scramble string here
-       //* DEBUG: */ echo "***Original=" . $str."***<br />";
+       //* DEBUG: */ OUTPUT_HTML("***Original=" . $str."***<br />");
        for ($idx = 0; $idx < strlen($str); $idx++) {
                // Get char on scrambled position
                $char = substr($str, $scrambleNums[$idx], 1);
@@ -2116,7 +2116,7 @@ function scrambleString($str) {
        } // END - for
 
        // Return scrambled string
-       //* DEBUG: */ echo "***Scrambled=" . $scrambled."***<br />";
+       //* DEBUG: */ OUTPUT_HTML("***Scrambled=" . $scrambled."***<br />");
        return $scrambled;
 }
 
@@ -2132,15 +2132,15 @@ function descrambleString($str) {
        if (count($scrambleNums) != 40) return $str;
 
        // Begin descrambling
-       $orig = str_repeat(" ", 40);
-       //* DEBUG: */ echo "+++Scrambled=" . $str."+++<br />";
+       $orig = str_repeat(' ', 40);
+       //* DEBUG: */ OUTPUT_HTML("+++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: */ echo "+++Original=" . $orig."+++<br />";
+       //* DEBUG: */ OUTPUT_HTML("+++Original=" . $orig."+++<br />");
        return $orig;
 }
 
@@ -2188,19 +2188,19 @@ function generatePassString ($passHash) {
                        }
                        $mod = substr(round($mod), 0, 4);
                        $mod = str_repeat('0', 4-strlen($mod)) . $mod;
-                       //* DEBUG: */ echo "*" . $start.'=' . $mod."*<br />";
+                       //* DEBUG: */ OUTPUT_HTML("*" . $start.'=' . $mod."*<br />");
                        $start += 4;
                        $newHash .= $mod;
                } // END - for
 
                //* DEBUG: */ print($passHash."<br />" . $newHash." (".strlen($newHash).')');
                $ret = generateHash($newHash, getConfig('master_salt'));
-               //* DEBUG: */ print($ret."<br />\n");
+               //* DEBUG: */ print($ret."<br />");
        } else {
                // Hash it simple
-               //* DEBUG: */ echo "--" . $passHash."--<br />\n";
+               //* DEBUG: */ OUTPUT_HTML("--" . $passHash."--<br />");
                $ret = md5($passHash);
-               //* DEBUG: */ echo "++" . $ret."++<br />\n";
+               //* DEBUG: */ OUTPUT_HTML("++" . $ret."++<br />");
        }
 
        // Return result
@@ -2286,14 +2286,14 @@ function isBooleanConstantAndTrue ($constName) { // : Boolean
        // In cache?
        if (isset($GLOBALS['cache_array']['const'][$constName])) {
                // Use cache
-               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): " . $constName."-CACHE!<br />\n";
+               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): " . $constName."-CACHE!<br />");
                $res = ($GLOBALS['cache_array']['const'][$constName] === true);
        } else {
                // Check constant
-               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): " . $constName."-RESOLVE!<br />\n";
+               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): " . $constName."-RESOLVE!<br />");
                if (defined($constName)) {
                        // Found!
-                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): " . $constName."-FOUND!<br />\n";
+                       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): " . $constName."-FOUND!<br />");
                        $res = (constant($constName) === true);
                } // END - if
 
@@ -2430,12 +2430,12 @@ function generateErrorCodeFromUserStatus ($status) {
 // Function to search for the last modifified file
 function searchDirsRecursive ($dir, &$last_changed) {
        // Get dir as array
-       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):dir=" . $dir."<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):dir=" . $dir."<br />");
        // Does it match what we are looking for? (We skip a lot files already!)
        // RegexPattern to exclude  ., .., .revision,  .svn, debug.log or .cache in the filenames
        $excludePattern = '@(\.revision|debug\.log|\.cache|config\.php)$@';
        $ds = getArrayFromDirectory($dir, '', true, false, array(), '.php', $excludePattern);
-       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):ds[]=".count($ds)."<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):ds[]=".count($ds)."<br />");
 
        // Walk through all entries
        foreach ($ds as $d) {
@@ -2443,20 +2443,20 @@ function searchDirsRecursive ($dir, &$last_changed) {
                $FQFN = str_replace('//', '/', constant('PATH') . $dir. '/'. $d);
 
                // Is it a file and readable?
-               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):FQFN={$FQFN}<br />\n";
+               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):FQFN={$FQFN}<br />");
                if (isDirectory($FQFN)) {
                        // $FQFN is a directory so also crawl into this directory
                        $newDir = $d;
                        if (!empty($dir)) $newDir = $dir . '/'. $d;
-                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):DESCENT: " . $newDir."<br />\n";
+                       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):DESCENT: " . $newDir."<br />");
                        searchDirsRecursive($newDir, $last_changed);
                } elseif (isFileReadable($FQFN)) {
                        // $FQFN is a filename and no directory
                        $time = filemtime($FQFN);
-                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):File: " . $d." found. (".($last_changed['time'] - $time).")<br />\n";
+                       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):File: " . $d." found. (".($last_changed['time'] - $time).")<br />");
                        if ($last_changed['time'] < $time) {
                                // This file is newer as the file before
-                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>) - NEWER!<br />\n";
+                               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>) - NEWER!<br />");
                                $last_changed['path_name'] = $FQFN;
                                $last_changed['time'] = $time;
                        } // END - if
@@ -2829,7 +2829,7 @@ function isUrlValidSimple ($url) {
                        // @TODO Are these convertions still required?
                        $pat = str_replace('.', "&#92;&#46;", $pat);
                        $pat = str_replace('@', "&#92;&#64;", $pat);
-                       echo $key."=&nbsp;" . $pat . "<br />";
+                       //* DEBUG: */ OUTPUT_HTML($key."=&nbsp;" . $pat . "<br />");
                } // END - if
 
                // Check if expression matches
@@ -3085,7 +3085,7 @@ function HANDLE_LOGIN_FAILTURES ($accessLevel) {
                // Ignore zero values
                if (getSession('mxchange_' . $accessLevel.'_failures') > 0) {
                        // Non-guest has login failures found, get both data and prepare it for template
-                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):accessLevel={$accessLevel}<br />\n";
+                       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):accessLevel={$accessLevel}<br />");
                        $content = array(
                                'login_failures' => getSession('mxchange_' . $accessLevel.'_failures'),
                                'last_failure'   => generateDateTime(getSession('mxchange_' . $accessLevel.'_last_fail'), '2')
@@ -3122,7 +3122,7 @@ function rebuildCacheFiles ($cache, $inc = '') {
                        // Is the include there?
                        if (isIncludeReadable($INC)) {
                                // And rebuild it from scratch
-                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): inc={$inc} - LOADED!<br />\n";
+                               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): inc={$inc} - LOADED!<br />");
                                loadInclude($INC);
                        } else {
                                // Include not found!
@@ -3430,7 +3430,7 @@ function getArrayFromDirectory ($baseDir, $prefix, $fileIncludeDirs = false, $ad
                // Exclude '.', '..' and entries in $excludeArray automatically
                if (in_array($baseFile, $excludeArray, true))  {
                        // Exclude them
-                       //* DEBUG: */ print 'excluded=' . $baseFile . "<br />\n";
+                       //* DEBUG: */ OUTPUT_HTML('excluded=' . $baseFile . "<br />");
                        continue;
                } // END - if
 
@@ -3444,9 +3444,9 @@ function getArrayFromDirectory ($baseDir, $prefix, $fileIncludeDirs = false, $ad
                // Check if the base filename 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: */ print 'baseDir:' . $baseDir . "<br />\n";
-                       //* DEBUG: */ print 'baseFile:' . $baseFile . "<br />\n";
-                       //* DEBUG: */ print 'FQFN:' . $FQFN . "<br />\n";
+                       //* DEBUG: */ OUTPUT_HTML('baseDir:' . $baseDir . "<br />");
+                       //* DEBUG: */ OUTPUT_HTML('baseFile:' . $baseFile . "<br />");
+                       //* DEBUG: */ OUTPUT_HTML('FQFN:' . $FQFN . "<br />");
 
                        // Exclude this one
                        continue;
index aa7f4f420fe1809fd53cb62d6148c55de387831f..421bcbdde32c4b7e13306794d59aad7ed8f602ae 100644 (file)
@@ -81,7 +81,7 @@ if (SQL_NUMROWS($result_direct) > 0) {
                $GLOBALS['cache_array']['back_level'] = 1;
 
                // Update refback table
-               //* DEBUG: */ echo "uid={$content['userid']}<br />\n";
+               //* DEBUG: */ OUTPUT_HTML("uid={$content['userid']}<br />");
                updateRefbackTable($content['userid']);
        } // END - while
 } // END - if
index 77835dbec4f1cef40590e33665df4259046d9e73..548affde1ec5a24c62c803ef398fadf083992e38 100644 (file)
@@ -115,7 +115,7 @@ function adminsCheckAdminAcl ($act, $wht) {
        } // END - if
 
        // Return value
-       //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:act={$act},wht={$wht},default={$default},acl_mode={$acl_mode}<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."[".__LINE__."]:act={$act},wht={$wht},default={$default},acl_mode={$acl_mode}<br />");
        return $ret;
 }
 
index a34313d1eb37053b5b06f6e32856b185d86909ad..53e4847e901fb0526959b214b132ba8674e953d0 100644 (file)
@@ -176,7 +176,7 @@ class CacheSystem {
 
                        // Remove pointer
                        $this->pointer = false;
-                       //* DEBUG: */ print __METHOD__."(<font color=\"#0000aa\">".__LINE__."</font>): {$this->name} - FINALIZED!<br />\n";
+                       //* DEBUG: */ OUTPUT_HTML(__METHOD__."(<font color=\"#0000aa\">".__LINE__."</font>): {$this->name} - FINALIZED!<br />");
                } // END - if
        }
 
@@ -381,7 +381,7 @@ class CacheSystem {
 
                        // Add the extension version to object (DO NOT REMOVE IT! Endless loop...)
                        $this->version[$this->name][$ext_name] = $ext_ver;
-                       //* DEBUG: */ print __METHOD__."(<font color=\"#0000aa\">".__LINE__."</font>): {$this->name} - {$ext_name}={$ext_ver}<br />\n";
+                       //* DEBUG: */ OUTPUT_HTML(__METHOD__."(<font color=\"#0000aa\">".__LINE__."</font>): {$this->name} - {$ext_name}={$ext_ver}<br />");
                } else {
                        // Cannot create file
                        addFatalMessage(__METHOD__, __LINE__, "(<font color=\"#0000aa\">".__LINE__."</font>): ".getMessage('CACHE_PROBLEMS_DETECTED'));
@@ -398,7 +398,7 @@ class CacheSystem {
 
                // Debug messages
                if (isset($this->version[$this->name][$ext_name])) {
-                       //* DEBUG: */ print __METHOD__."(<font color=\"#0000aa\">".__LINE__."</font>): cache={$this->name},ext_name={$ext_name} - {$ext_ver}/{$this->version[$this->name][$ext_name]}<br />\n";
+                       //* DEBUG: */ OUTPUT_HTML(__METHOD__."(<font color=\"#0000aa\">".__LINE__."</font>): cache={$this->name},ext_name={$ext_name} - {$ext_ver}/{$this->version[$this->name][$ext_name]}<br />");
                } else {
                        // No cache version found!
                        DEBUG_LOG(__METHOD__, __LINE__, "Cache {$this->name} has missing version entry for extension {$ext_name}!");
index 998427c95fa76373a82ebf26db773e41c4edca54..9a7fac9ebe04a3a4c412ce10dffc2980cdf1888d 100644 (file)
@@ -207,7 +207,7 @@ LIMIT 1", array(bigintval($content['userid']), getConfig('ref_payout')), __FUNCT
                // Init userid for list
                $_uid = '---';
                // List only users with at least one ref!
-               //* DEBUG: */ echo "*".$cnt.'/'.$content['userid'].'/'.$content['curr_points'].'/'.$refpoints."*<br />\n";
+               //* DEBUG: */ OUTPUT_HTML("*".$cnt.'/'.$content['userid'].'/'.$content['curr_points'].'/'.$refpoints."*<br />");
                if (($cnt > 0) && ($refpoints > $content['curr_points'])) { $_uid = $content['userid']; } else { $cnt = ''; }
 
                // Save values to array
@@ -223,7 +223,7 @@ LIMIT 1", array(bigintval($content['userid']), getConfig('ref_payout')), __FUNCT
        array_pk_sort($DATA, array('ref', 'cpoints'), 0, 1, true);
 
        // Generate table
-       $OUT = LOAD_TEMPLATE("guest_rallye_header", true);
+       $OUT = LOAD_TEMPLATE('guest_rallye_header', true);
        $SW = 2;
        for ($idx = 0; $idx < $prices; $idx++) {
                if (empty($DATA['uid'][$idx])) $DATA['uid'][$idx] = '---';
@@ -716,14 +716,14 @@ function RALLYE_GET_REFCOUNT ($uid, $old = 0) {
                $cnt = 0;
                foreach ($GLOBALS['cache_array']['refsystem']['userid'] as $id => $uid) {
                        // Do we have a ref for this user?
-                       //* DEBUG: */ echo "id={$id},uid={$uid},uid={$uid},old={$old},level={$GLOBALS['cache_array']['refsystem']['level'][$id]}<br />\n";
+                       //* DEBUG: */ OUTPUT_HTML("id={$id},uid={$uid},uid={$uid},old={$old},level={$GLOBALS['cache_array']['refsystem']['level'][$id]}<br />");
                        if (($uid == $uid) && ($GLOBALS['cache_array']['refsystem']['level'][$id] == 1)) {
-                               //* DEBUG: */ echo "uid matches!<br />\n";
+                               //* DEBUG: */ OUTPUT_HTML("uid matches!<br />");
                                foreach ($GLOBALS['cache_array']['ref_depths']['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: */ echo "*".$uid.'/'.$cnt."*<br />";
+                                               //* DEBUG: */ OUTPUT_HTML("*".$uid.'/'.$cnt."*<br />");
                                                break;
                                        } elseif ($level > 1) {
                                                // Not interesting here...
@@ -736,17 +736,17 @@ function RALLYE_GET_REFCOUNT ($uid, $old = 0) {
                        } // END - if
                } // END - foreach
 
-               //* DEBUG: */ echo "<pre>";
-               //* DEBUG: */ print_r($GLOBALS['cache_array']['refsystem']);
-               //* DEBUG: */ echo "</pre>";
-               //* DEBUG: */ die();
+               //* DEBUG: */ OUTPUT_HTML("<pre>");
+               //* DEBUG: */ OUTPUT_HTML(print_r($GLOBALS['cache_array']['refsystem'], true));
+               //* DEBUG: */ OUTPUT_HTML("</pre>");
+               //* DEBUG: */ shutdown();
 
                if ($cnt > 0) {
                        // Count cache hits
                        incrementConfigEntry('cache_hits');
 
                        // Remove old refs
-                       //* DEBUG: */ echo '+'.$cnt.'/'.$old."+<br />";
+                       //* DEBUG: */ OUTPUT_HTML('+'.$cnt.'/'.$old."+<br />");
                        $cnt -= $old;
                } // END - if
        } else {
@@ -766,7 +766,7 @@ WHERE s.userid=%s AND s.level=1", array(bigintval($uid)), __FUNCTION__, __LINE__
        }
 
        // Return count
-       //* DEBUG: */ echo "*".$uid.'/'.$old.'/'.$cnt."*<br />";
+       //* DEBUG: */ OUTPUT_HTML("*".$uid.'/'.$old.'/'.$cnt."*<br />");
        return $cnt;
 }
 
index 1ec422b90733aaf9dfa51f9e8471bdb787d1f729..d8fc49e0adfe3813e7f9d72fb05209c1c87615ab 100644 (file)
@@ -44,7 +44,7 @@ if (!defined('__SECURITY')) {
 
 // Payback refback for refid and reduce it for current user
 function ADD_REFBACK_POINTS ($uid, $ref, $points, $ref_points) {
-       //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
+       //* DEBUG: */ OUTPUT_HTML("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
        // Back ref depths
        $GLOBALS['cache_array']['depth'][$uid][$ref] = $GLOBALS['ref_level'];
 
@@ -61,35 +61,35 @@ function ADD_REFBACK_POINTS ($uid, $ref, $points, $ref_points) {
                unset($GLOBALS['ref_level']);
 
                // "Walk" through all refids
-               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref},level={$content['level']},points={$points}<br />\n";
+               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref},level={$content['level']},points={$points}<br />");
                foreach (GET_REFBACK_USERID_ARRAY($uid, $content['level']) as $refid) {
                        // Skip level zero or if both are the same
                        if ($uid == $refid) continue;
 
                        // Get refback percents
                        $percents = GET_REFBACK_PERCENTS($uid, $refid);
-                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref},refid={$refid},points={$points},percents={$percents}<br />\n";
+                       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref},refid={$refid},points={$points},percents={$percents}<br />");
 
                        // Some percents given?
                        if ($percents > 0) {
-                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):points={$points},perc={$content['percents']},percents={$percents},level={$content['level']}<br />\n";
+                               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):points={$points},perc={$content['percents']},percents={$percents},level={$content['level']}<br />");
                                // Calculate points for refback
                                $refback = $points * ($content['percents'] / 100) * ($percents / 100);
 
                                // Update refback table ("refid" and "uid" must be exchanged!)
                                SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_refs` SET points=points+%s WHERE `userid`=%s AND refid=%s LIMIT 1",
                                array($refback, $refid, $uid), __FUNCTION__, __LINE__);
-                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):refback={$refback},uid={$uid},refid={$refid} - UPDATE! (".SQL_AFFECTEDROWS().")<br />\n";
+                               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):refback={$refback},uid={$uid},refid={$refid} - UPDATE! (".SQL_AFFECTEDROWS().")<br />");
 
                                // Add points again, but only directly
-                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):refback={$refback}<br />\n";
+                               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):refback={$refback}<br />");
                                ADD_POINTS_REFSYSTEM_DIRECT(sprintf("refback:%s", $refid), $uid, $refback);
 
                                // Reduce points if refid is found
                                if ($refid == $ref) {
                                        // Reduce points here!
                                        $return = $points * ($content['percents'] / 100) - $refback;
-                                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):points={$return} - REDUCED<br />\n";
+                                       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):points={$return} - REDUCED<br />");
                                } // END - if
                        } // END - if
                } // END foreach
@@ -102,14 +102,14 @@ function ADD_REFBACK_POINTS ($uid, $ref, $points, $ref_points) {
        $GLOBALS['ref_level'] = $GLOBALS['cache_array']['depth'][$uid][$ref];
 
        // Return them
-       //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+       //* DEBUG: */ OUTPUT_HTML("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
        return $return;
 }
 
 // "Getter" for refback percents
 function GET_REFBACK_PERCENTS ($uid, $ref) {
-       //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
-       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref}<br />\n";
+       //* DEBUG: */ OUTPUT_HTML("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
+       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref}<br />");
        // Skip identical ids
        if ($uid == $ref) return 0;
 
@@ -124,10 +124,10 @@ function GET_REFBACK_PERCENTS ($uid, $ref) {
        if (SQL_NUMROWS($result) == 1) {
                // Fetch percents
                list($percents) = SQL_FETCHROW($result);
-               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):percents={$percents}<br />\n";
+               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):percents={$percents}<br />");
        } else {
                // Debug log
-               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): NO ENTRY FOUND! :-(<br />\n";
+               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): NO ENTRY FOUND! :-(<br />");
                DEBUG_LOG(__FUNCTION__, __LINE__, "uid={$uid},ref={$ref} - No entry found! :-(");
        }
 
@@ -135,14 +135,14 @@ function GET_REFBACK_PERCENTS ($uid, $ref) {
        SQL_FREERESULT($result);
 
        // Return percents
-       //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+       //* DEBUG: */ OUTPUT_HTML("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
        return $percents;
 }
 
 // "Getter" for userid array which will return only one entry
 function GET_REFBACK_USERID_ARRAY ($rid, $level) {
-       //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
-       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):rid={$rid},level={$level}<br />\n";
+       //* DEBUG: */ OUTPUT_HTML("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
+       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):rid={$rid},level={$level}<br />");
        // Init userids
        $userIds = array();
 
@@ -158,11 +158,11 @@ ORDER BY
                array($rid,$level), __FUNCTION__, __LINE__);
 
        // Entries found?
-       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):numRows=".SQL_NUMROWS($result)."<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):numRows=".SQL_NUMROWS($result)."<br />");
        if (SQL_NUMROWS($result) > 0) {
                // Add all
                while ($content = SQL_FETCHARRAY($result)) {
-                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):rid={$rid},level={$level},userid={$content['userid']}<br />\n";
+                       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):rid={$rid},level={$level},userid={$content['userid']}<br />");
                        $userIds[] = $content['userid'];
                } // END - while
        } // END - if
@@ -171,17 +171,17 @@ ORDER BY
        SQL_FREERESULT($result);
 
        // Return array
-       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):rid={$rid},count()=".count($userIds)."<br />\n";
-       //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):rid={$rid},count()=".count($userIds)."<br />");
+       //* DEBUG: */ OUTPUT_HTML("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
        return $userIds;
 }
 
 // Update "refback table"
 function updateRefbackTable ($uid) {
-       //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
+       //* DEBUG: */ OUTPUT_HTML("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
        // Make it sure referal level zero (member him-/herself) is at least selected
        if (empty($GLOBALS['cache_array']['back_level'])) $GLOBALS['cache_array']['back_level'] = 1;
-       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['back_level']}<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['back_level']}<br />");
 
        // Init refid
        $GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']] = 0;
@@ -192,15 +192,15 @@ function updateRefbackTable ($uid) {
                array(bigintval($uid)), __FUNCTION__, __LINE__);
 
        // When no entry was updated then we have to create it here
-       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):found=".SQL_NUMROWS($result_refid)."<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):found=".SQL_NUMROWS($result_refid)."<br />");
        if (SQL_NUMROWS($result_refid) > 0) {
                // Load all refids
                while (list($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]) = SQL_FETCHROW($result_refid)) {
                        // Remmber userid
                        $GLOBALS['cache_array']['up_userid'][$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]] = $uid;
 
-                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]}<br />\n";
                        // Refid set?
+                       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]}<br />");
                        if (($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']] > 0) && ($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']] != $uid) && (isset($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]))) {
                                // New userid?
                                if ((isset($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']-1])) && (isset($GLOBALS['cache_array']['up_userid'][$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']-1]]))) {
@@ -208,7 +208,7 @@ function updateRefbackTable ($uid) {
                                        $old = $uid;
                                        $uid = $GLOBALS['cache_array']['up_userid'][$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']-1]];
                                        $minus = 1;
-                                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},old={$old},level={$GLOBALS['cache_array']['back_level']},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - NEW UID!<br />\n";
+                                       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},old={$old},level={$GLOBALS['cache_array']['back_level']},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - NEW UID!<br />");
                                } // END - if
 
                                // Check existence
@@ -216,10 +216,10 @@ function updateRefbackTable ($uid) {
                                        array(bigintval($uid), $GLOBALS['cache_array']['back_level'], bigintval($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']])), __FUNCTION__, __LINE__);
 
                                // Do we have no entry?
-                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['back_level']},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]},minus={$minus},numRows=".SQL_NUMROWS($result)." - FOUND!<br />\n";
+                               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['back_level']},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]},minus={$minus},numRows=".SQL_NUMROWS($result)." - FOUND!<br />");
                                if (SQL_NUMROWS($result) == 0) {
                                        // Insert this level
-                                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['back_level']},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - ADD!<br />\n";
+                                       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['back_level']},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - ADD!<br />");
                                        SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_refs` (`userid`,`level`,`refid`) VALUES (%s,%s,%s)",
                                                array(bigintval($uid), $GLOBALS['cache_array']['back_level'], bigintval($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']])), __FUNCTION__, __LINE__);
 
@@ -237,12 +237,12 @@ function updateRefbackTable ($uid) {
                                                array(bigintval($uid), ($GLOBALS['cache_array']['back_level']-$minus), bigintval($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']])), __FUNCTION__, __LINE__);
 
                                        // Do we have no entry?
-                                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level=".($GLOBALS['cache_array']['back_level']-$minus).",ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]},numRows=".SQL_NUMROWS($result)." - BACK!<br />\n";
+                                       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level=".($GLOBALS['cache_array']['back_level']-$minus).",ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]},numRows=".SQL_NUMROWS($result)." - BACK!<br />");
                                        if (SQL_NUMROWS($result) == 0) {
                                                // Insert this level
                                                SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_refs` (`userid`,`level`,`refid`) VALUES (%s,%s,%s)",
                                                        array(bigintval($uid), ($GLOBALS['cache_array']['back_level']-$minus), bigintval($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']])), __FUNCTION__, __LINE__);
-                                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level=".($GLOBALS['cache_array']['back_level']-$minus).",ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - RETURNED!<br />\n";
+                                               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level=".($GLOBALS['cache_array']['back_level']-$minus).",ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - RETURNED!<br />");
                                        } // END - if
                                } // END - if
                        } // END - if
@@ -255,24 +255,24 @@ function updateRefbackTable ($uid) {
        // When he has a referal...
        if ((($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']] == $uid) || ($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']] == 0)) && (GET_EXT_VERSION('cache') >= '0.1.2') && (!isset($GLOBALS['cache_array']['back_cached']))) {
                // Remove cache here
-               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - CACHE!<br />\n";
+               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - CACHE!<br />");
                if ($GLOBALS['cache_instance']->loadCacheFile('refback')) $GLOBALS['cache_instance']->destroyCacheFile();
                $GLOBALS['cache_array']['back_cached'] = 1;
        } // END - if
 
        // "Walk" back here
        $GLOBALS['cache_array']['back_level']--;
-       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['back_level']} - LEVEL!<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['back_level']} - LEVEL!<br />");
 
        // Fix empty refid
        if (!isset($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']-1])) $GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']-1] = 0;
-       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['back_level']},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']-1]} - BACK!<br />\n";
-       //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['back_level']},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']-1]} - BACK!<br />");
+       //* DEBUG: */ OUTPUT_HTML("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
 }
 
 // "Getter" for array for user refs in given level
 function GET_USER_REFS ($uid, $level) {
-       //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
+       //* DEBUG: */ OUTPUT_HTML("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
        // Default is no refs and no nickname
        $add = '';
        $refs = array();
@@ -314,13 +314,13 @@ ORDER BY
        SQL_FREERESULT($result);
 
        // Return result
-       //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+       //* DEBUG: */ OUTPUT_HTML("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
        return $refs;
 }
 
 // "Getter" for refback entry
 function GET_USER_REF_ENTRY ($id) {
-       //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
+       //* DEBUG: */ OUTPUT_HTML("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
        // Default data is nothing
        $data = array();
 
@@ -341,13 +341,13 @@ function GET_USER_REF_ENTRY ($id) {
        SQL_FREERESULT($result);
 
        // Return entry
-       //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+       //* DEBUG: */ OUTPUT_HTML("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
        return $data;
 }
 
 // Update refback percents (but with some sanity-checks!
 function REFBACK_CHANGE_MEMBER_PERCENTS ($id, $percents) {
-       //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
+       //* DEBUG: */ OUTPUT_HTML("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
        // Default status is failed
        $status['message'] = getMessage('MEMBER_REFBACK_ERROR_GENERAL');
 
@@ -356,7 +356,7 @@ function REFBACK_CHANGE_MEMBER_PERCENTS ($id, $percents) {
                // No member!
                $status['message'] = getMessage('MEMBER_REFBACK_ERROR_NO_MEMBER');
                return $status;
-       } elseif ("".$id."" != ''.($id + 0)."") {
+       } elseif (''.$id.'' != ''.($id + 0).'') {
                // No number!
                $status['message'] = getMessage('MEMBER_REFBACK_ERROR_INVALID_ID_NUMBER');
                return $status;
@@ -380,8 +380,8 @@ function REFBACK_CHANGE_MEMBER_PERCENTS ($id, $percents) {
        $percents = convertCommaToDot($percents);
 
        // Update entry
-       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_refs` SET refback='%s' WHERE `id`=%s AND `userid`=%s LIMIT 1",
-       array($percents, $id, getUserId()), __FUNCTION__, __LINE__);
+       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_refs` SET `refback`='%s' WHERE `id`=%s AND `userid`=%s LIMIT 1",
+               array($percents, $id, getUserId()), __FUNCTION__, __LINE__);
 
        // Entry updated?
        if (SQL_AFFECTEDROWS() < 1) {
@@ -398,19 +398,19 @@ function REFBACK_CHANGE_MEMBER_PERCENTS ($id, $percents) {
        );
 
        // Load member email template
-       $mail = LOAD_EMAIL_TEMPLATE("member_refback", $content, getUserId());
+       $mail = LOAD_EMAIL_TEMPLATE('member_refback', $content, getUserId());
 
        // Send email to user
        sendEmail($dummy['refid'], getMessage('MEMBER_REFBACK_SUBJECT'), $mail);
 
        // Send admin notification
-       sendAdminNotification(getMessage('ADMIN_REFBACK_SUBJECT'), "admin_refback", $content, getUserId());
+       sendAdminNotification(getMessage('ADMIN_REFBACK_SUBJECT'), 'admin_refback', $content, getUserId());
 
        // All fine!
        $status['ok'] = true;
 
        // Return status array
-       //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+       //* DEBUG: */ OUTPUT_HTML("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
        return $status;
 }
 //
index 932259cc4087a93641850e22ff85c106936f8a77..08b2bd164518dbaae9c65e8f268e7ba0383e97cf 100644 (file)
@@ -1001,7 +1001,7 @@ function SURFBAR_CHECK_VALIDATION_CODE ($urlId, $check, $salt) {
 
 // Lockdown the userid/id combination (reload lock)
 function SURFBAR_LOCKDOWN_ID ($urlId) {
-       //* DEBUG: */ print "LOCK!";
+       //* DEBUG: */ OUTPUT_HTML("LOCK!");
        ///* DEBUG: */ return;
        // Just add it to the database
        SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_locks` (`userid`, `url_id`) VALUES (%s, %s)",
index 7c89782e871897aa927df8c0a76b2e2b19457299..a7ff74f1dedc4e5abd04a42ccd44811fa390ce47 100644 (file)
@@ -339,7 +339,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: */ echo "mode={$mode},points={$points}<br />\n";
+       //* DEBUG: */ OUTPUT_HTML("mode={$mode},points={$points}<br />");
        if (!in_array($mode, array('payout', 'withdraw'))) {
                // Log error and abort
                DEBUG_LOG(__FUNCTION__, __LINE__, "uid={getUserId()},mode={$mode},points={$points}");
@@ -365,7 +365,7 @@ function WERNIS_TAKE_FEE ($points, $mode) {
        }
 
        // Return value
-       //* DEBUG: */ echo "mode={$mode},points={$points}<br />\n";
+       //* DEBUG: */ OUTPUT_HTML("mode={$mode},points={$points}<br />");
        return $points;
 }
 
index 1e218be4c858e6a188280b62f87353adc73d3475..4ed0f57bbd2df9291e94156ebce33c2ba97c2452 100644 (file)
@@ -304,10 +304,10 @@ function yoomediaTranslateError ($errorCode) {
                $return = $GLOBALS['translation_tables']['yoomedia']['error_codes'][$errorCode];
        } else {
                // Log missing entries
-               print '<pre>';
+               DEBUG_LOG(__FUNCTION__, __LINE__, "errorCode={$errorCode}");
+               print('<pre>');
                debug_print_backtrace();
                die('</pre>');
-               DEBUG_LOG(__FUNCTION__, __LINE__, "errorCode={$errorCode}");
        }
 
        // Return value
@@ -321,7 +321,7 @@ function YOOMEDIA_CHECK_RELOAD ($id, $reload, $type) {
 
        // Query database
        $result = SQL_QUERY_ESC("SELECT `id`, UNIX_TIMESTAMP(`inserted`) AS inserted FROM `{!_MYSQL_PREFIX!}_yoomedia_reload` WHERE `type`='%s' AND `y_id`=%s LIMIT 1",
-       array($type, bigintval($id)), __FUNCTION__, __LINE__);
+               array($type, bigintval($id)), __FUNCTION__, __LINE__);
 
        // Entry found?
        if (SQL_NUMROWS($result) == 1) {
index 1353ad3d10da2d8b9c733016b2c1dc9fdac96d65..151cc2e5782948550f506d848f7086f574049fd2 100644 (file)
@@ -111,7 +111,7 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password) {
                SQL_FREERESULT($result);
        }
 
-       //* DEBUG: */ echo "*".$data['password'].'/'.md5($password).'/'.$ret."<br />";
+       //* DEBUG: */ OUTPUT_HTML("*".$data['password'].'/'.md5($password).'/'.$ret."<br />");
        if ((isset($data['password'])) && (strlen($data['password']) == 32) && ($data['password'] == md5($password))) {
                // Generate new hash
                $data['password'] = generateHash($password);
@@ -131,7 +131,7 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password) {
        $salt = __SALT;
 
        // Check if password is same
-       //* DEBUG: */ echo "*".$ret.','.$data['password'].','.$password.','.$salt."*<br >\n";
+       //* DEBUG: */ OUTPUT_HTML("*".$ret.','.$data['password'].','.$password.','.$salt."*<br />");
        if (($ret == 'pass') && ($data['password'] == generateHash($password, $salt)) && ((!empty($salt))) || ($data['password'] == $password)) {
                // Re-hash the plain passord with new random salt
                $data['password'] = generateHash($password);
@@ -223,7 +223,7 @@ function CHECK_ADMIN_COOKIES ($admin_login, $password) {
        $pass = GET_ADMIN_HASH(GET_ADMIN_ID($admin_login));
        if ($pass != '-1') $ret = 'pass';
 
-       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):".generatePassString($pass).'('.strlen($pass).")/".$password.'('.strlen($password).")<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):".generatePassString($pass).'('.strlen($pass).")/".$password.'('.strlen($password).")<br />");
 
        // Check if password matches
        if (($ret == 'pass') && ((generatePassString($pass) == $password) || ($pass == $password) || ((strlen($pass) == 32) && (md5($password) == $pass)))) {
@@ -238,7 +238,7 @@ function CHECK_ADMIN_COOKIES ($admin_login, $password) {
 //
 function ADMIN_DO_ACTION ($wht) {
        global $DATA;
-       //* DEBUG: */ echo __LINE__."*".$wht.'/'.getModule().'/'.getAction().'/'.getWhat()."*<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__LINE__."*".$wht.'/'.getModule().'/'.getAction().'/'.getWhat()."*<br />");
 
        // Remove any spaces from variable
        if (empty($wht)) {
@@ -688,19 +688,19 @@ function ADMIN_MAKE_MENU_SELECTION ($menu, $type, $name, $default = '') {
 }
 
 // Creates a user-profile link for the admin. This function can also be used for many other purposes
-function generateUserProfileLink ($uid, $title = '', $wht="list_user") {
+function generateUserProfileLink ($uid, $title = '', $wht = 'list_user') {
        if (($title == '') && ($title != '0')) {
                // Set userid as title
                $title = $uid;
        } // END - if
 
-       if (($title == '0') && ($wht == "list_refs")) {
+       if (($title == '0') && ($wht == 'list_refs')) {
                // Return title again
                return $title;
        } // END - if
 
-       //* DEBUG: */ echo "a:".$title."<br />";
        // Return link
+       //* DEBUG: */ OUTPUT_HTML("a:".$title."<br />");
        return "<a href=\"{!URL!}/modules.php?module=admin&amp;what=".$wht."&amp;uid=".$uid."\" title=\"{--ADMIN_USER_PROFILE_TITLE--}\">".$title."</a>";
 }
 
index 2eb662816b8dbcfa11d716b4acbd2da75c178ad8..152c73e0b4841f4f1b28410e6d48f90ebb19150a 100644 (file)
@@ -67,7 +67,7 @@ function OUTPUT_STANDARD_OVERVIEW (&$result_tasks) {
 
                        // Check if extension is installed or not
                        $ext_ver = GET_EXT_VERSION($ext_name);
-                       //* DEBUG: */ echo $ext_name."=".$ext_ver."<br />\n";
+                       //* DEBUG: */ OUTPUT_HTML($ext_name."=".$ext_ver."<br />");
 
                        // Is the extension not yet installed?
                        if (empty($ext_ver)) {
@@ -84,7 +84,7 @@ function OUTPUT_STANDARD_OVERVIEW (&$result_tasks) {
                                require(sprintf("%sinc/extensions/ext-%s.php", constant('PATH'), $ext_name));
 
                                // Update extension if extension is installed and outdated
-                               //* DEBUG: */ print "ext={$ext_name},ver={EXT_GET_VERSION()}/".GET_EXT_VERSION($ext_name)."<br />\n";
+                               //* DEBUG: */ OUTPUT_HTML("ext={$ext_name},ver={EXT_GET_VERSION()}/".GET_EXT_VERSION($ext_name)."<br />");
                                if (EXT_GET_VERSION() > $ext_ver) {
                                        // Update the extension
                                        EXTENSION_UPDATE($ext_name, $ext_ver);
index 0307be89ea1bd30c7ac321a3a772616aefa90a9d..d41efd86b8137e01de12bc765d52dbdc19f33b74 100644 (file)
@@ -105,7 +105,7 @@ LIMIT 1",
 
                        // Shall we pay the points back to the user?
                        if (getConfig('repay_deleted_mails') != 'SHRED') {
-                               //* DEBUG: */ echo $stats_id.':'.$totalPoints.'/'.$links.'/'.$price."<br />\n";
+                               //* DEBUG: */ OUTPUT_HTML($stats_id.':'.$totalPoints.'/'.$links.'/'.$price."<br />");
                                if ($totalPoints > 0) {
                                        // Shall we payback to user or jackpot?
                                        if (getConfig('repay_deleted_mails') == 'JACKPOT') {
@@ -114,7 +114,7 @@ LIMIT 1",
                                        } // END - if
 
                                        // Pay back points
-                                       //* DEBUG: */ echo "PAYBACK:".$sender."<br />\n";
+                                       //* DEBUG: */ OUTPUT_HTML("PAYBACK:".$sender."<br />");
                                        ADD_POINTS_REFSYSTEM('mail_deleted', $sender, $totalPoints, true, '0', false,'direct');
 
                                        // Output message
index c2ed620c93e438ec6ca053ea9f5cd086b230592b..de4927986138b11c4e69ced7a42083628d437719 100644 (file)
@@ -242,14 +242,14 @@ LIMIT 1",
                        if (($content['curr_points'] > 0) && ($cnt > 0)) { $bl = "<strong>"; $br = "</strong>"; }
                        if (($content['refs'] > 0) || ($cnt > 0)) {
                                // Insert link to referal list
-                               //* DEBUG: */ echo '-'.$content['userid'].'/'.$cnt.'/'.$content['refs']."-<br />";
+                               //* DEBUG: */ OUTPUT_HTML('-'.$content['userid'].'/'.$cnt.'/'.$content['refs']."-<br />");
                                $cnt = generateUserProfileLink($content['userid'], $cnt, 'list_refs');
                                $content['refs'] = generateUserProfileLink($content['userid'], $content['refs'], 'list_refs');
                        } // END - if
 
                        // Get user points
                        $points = GET_TOTAL_DATA($content['userid'], 'user_points', 'points', 'userid', false, " AND `ref_depth`=1 LIMIT 1");
-                       //* DEBUG: */ echo basename(__FILE__).":uid={$content['userid']},points={$points},opoints={$content['curr_points']}<br />\n";
+                       //* DEBUG: */ OUTPUT_HTML(basename(__FILE__).":uid={$content['userid']},points={$points},opoints={$content['curr_points']}<br />");
 
                        // Prepare content
                        // @TODO Rewritings: uid->userid,opoints->curr_points,old->refs in template
index 8bfb68fe4b984454da7325f1ecb73ba0563a59f2..08cc89941d32eca4b1dd891e6f04e0ca9af0af57 100644 (file)
@@ -89,7 +89,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($uid, $levels['level']), __FILE__, __LINE__);
-                                       //* DEBUG: */ echo $uid.'/'.$levels['level'].'/'.SQL_NUMROWS($result_refs)."<br />\n";
+                                       //* DEBUG: */ OUTPUT_HTML($uid.'/'.$levels['level'].'/'.SQL_NUMROWS($result_refs)."<br />");
 
                                        // Do we have levels?
                                        if (SQL_NUMROWS($result_refs) > 0) {
index 49b9553395e5463bd783678d69ff69f6f34ad743..9af39581e6650fe458c2e4618d88603683ee522f 100644 (file)
@@ -101,7 +101,7 @@ if (REQUEST_ISSET_GET('access')) {
                        // Cut dirname away
                        $file = basename($file);
 
-                       // Okay, let us print it out
+                       // Okay, add it
                        OUTPUT_HTML("<li><a href=\"{!URL!}/modules.php?module=admin&amp;what=".getWhat()."&amp;access=".urlencode($file)."\">".$file."</a></li>");
                } // END - foreach
 
index 52e22c9fd9967b6b13d18b63ba9ec9eb1e2b87a4..06fba85c3a546a8a8228d69bd404909e0a1e373c 100644 (file)
@@ -45,11 +45,14 @@ if (!defined('__SECURITY')) {
        return;
 }
 
-// Load all active designs (or all if admin)
-$whereStatement = ''; $OUT = '';
-if (!IS_ADMIN()) $whereStatement = " WHERE theme_active='Y'";
-$result_themes = SQL_QUERY("SELECT theme_path FROM `{!_MYSQL_PREFIX!}_themes`".$whereStatement, __FILE__, __LINE__);
-$num_themes = SQL_NUMROWS($result_themes);
+// Get total num
+if (IS_ADMIN()) {
+       // Load only active designs for user
+       $num_themes = GET_TOTAL_DATA('Y', 'themes', 'id', 'theme_active', true);
+} else {
+       // Load all themes for admin
+       $num_themes = GET_TOTAL_DATA('', 'themes', 'id', '', true);
+}
 
 if ($num_themes > 1) {
        // If more than 1 is installed output selection box
@@ -57,9 +60,9 @@ if ($num_themes > 1) {
        if (isActionSet()) $act = getAction();
        $OUT = generateThemeSelectionBox('index', $act, getWhat(), $result_themes);
 } elseif (($num_themes == 1) || ((!IS_ADMIN()) && ($num_themes == 0))) {
-       // If there's only one just print it's name
+       // If there's only one just output it's name
        define('__THEME_NAME', getCurrentThemeName());
-       $OUT = LOAD_TEMPLATE("theme_one", true);
+       $OUT = LOAD_TEMPLATE('theme_one', true);
 } elseif (IS_ADMIN()) {
        // If there is no theme installed and there's an admin notify him!
        $OUT = LOAD_TEMPLATE('admin_settings_saved', true, "<div class=\"admin_note\">{--ADMIN_NO_THEME_INSTALLED_WARNING--}</div>");
@@ -69,7 +72,7 @@ if ($num_themes > 1) {
 SQL_FREERESULT($result_themes);
 
 // Load final box template
-LOAD_TEMPLATE("theme_select_box", false, $OUT);
+LOAD_TEMPLATE('theme_select_box', false, $OUT);
 
 //
 ?>
index 46acae9c4ecc6fe9072605a09780f7c64b7c97a0..b4cdecf9654432536bb1da1a6003f5b858873cf8 100644 (file)
@@ -47,11 +47,14 @@ if (!defined('__SECURITY')) {
        return;
 }
 
-// Load all active designs (or all if admin)
-$whereStatement = ''; $OUT = '';
-if (!IS_ADMIN()) $whereStatement = " WHERE theme_active='Y'";
-$result_themes = SQL_QUERY("SELECT theme_path FROM `{!_MYSQL_PREFIX!}_themes`".$whereStatement, __FILE__, __LINE__);
-$num_themes = SQL_NUMROWS($result_themes);
+// Get total num
+if (IS_ADMIN()) {
+       // Load only active designs for user
+       $num_themes = GET_TOTAL_DATA('Y', 'themes', 'id', 'theme_active', true);
+} else {
+       // Load all themes for admin
+       $num_themes = GET_TOTAL_DATA('', 'themes', 'id', '', true);
+}
 
 if ($num_themes > 1) {
        // If more than 1 is installed output selection box
@@ -60,7 +63,7 @@ if ($num_themes > 1) {
        if (isWhatSet())   $wht = getWhat();
        $OUT = generateThemeSelectionBox('login', $act, $wht, $result_themes);
 } elseif (($num_themes == 1) || ((!IS_ADMIN()) && ($num_themes == 0))) {
-       // If there's only one just print it's name
+       // If there's only one just output it's name
        define('__THEME_NAME', getCurrentThemeName());
        $OUT = LOAD_TEMPLATE('theme_one', true);
 } elseif (IS_ADMIN()) {
index 3d5396e36c804b6ca6cd993f3edee6d1af911ad3..628986e0b910bb12c3819ca3c80b227357a300da 100644 (file)
@@ -46,7 +46,7 @@ if (!defined('__SECURITY')) {
 
 // Do not execute when script is in CSS mode or no daily reset
 if ((getOutputMode() == 1) || (!isResetModeEnabled()) || (getConfig('beg_rallye') != 'Y')) return;
-//* DEBUG: */ echo basename(__FILE__)."<br />\n";
+//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."<br />");
 
 // Get current month (2 digits)
 $curr = date('m', time());
index d18b95c6cd7502f437945d6d7bc4b663d7809dd7..cfd712948bff155d267d0a0da54be383c3aa4f54 100644 (file)
@@ -46,7 +46,7 @@ if (!defined('__SECURITY')) {
 
 // Do not execute when script is in CSS mode or no daily reset
 if ((getOutputMode() == 1) || (!isResetModeEnabled())) return;
-//* DEBUG: */ echo basename(__FILE__)."<br />\n";
+//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."<br />");
 
 // Get current month (2 digits)
 $curr = date('m', time());
index c1108be6af88c35bc6a840ec905268e03e5a090c..ca8e2baf420f24cebafe7f71aae41d2ab4eea9ec 100644 (file)
@@ -46,7 +46,7 @@ if (!defined('__SECURITY')) {
 
 // Do not execute when script is in CSS mode or no daily reset
 if ((getOutputMode() == 1) || (!isResetModeEnabled())) return;
-//* DEBUG: */ echo basename(__FILE__)."<br />\n";
+//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."<br />");
 
 // Get current month (2 digits)
 $curr = date('m', time());
@@ -62,11 +62,11 @@ if (getConfig('last_month') != $curr) {
                                array(bigintval($content['userid'])), __FILE__, __LINE__);
 
                        // Send email to him
-                       $message = LOAD_EMAIL_TEMPLATE("member_newsletter_reset", true, bigintval($content['userid']));
+                       $message = LOAD_EMAIL_TEMPLATE('member_newsletter_reset', true, bigintval($content['userid']));
                        sendEmail($content['email'], getMessage('NL_MEMBER_RESET_SUBJECT'), $message);
 
                        // Send email to admin
-                       sendAdminNotification(getMessage('NL_ADMIN_SUBJECT'), "admin_newsletter_reset", array(), getUserId());
+                       sendAdminNotification(getMessage('NL_ADMIN_SUBJECT'), 'admin_newsletter_reset', array(), getUserId());
                } // END - if
 
                // Free memory
index 842c23bd9540c61c026e953dc20eb5d98ce11eb2..02a35f38c75e81093a1969a7f41f7e38ab27a4e3 100644 (file)
@@ -46,7 +46,7 @@ if (!defined('__SECURITY')) {
 
 // Do not execute when script is in CSS mode or no daily reset
 if ((getOutputMode() == 1) || (!isResetModeEnabled())) return;
-//* DEBUG: */ echo basename(__FILE__)."<br />\n";
+//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."<br />");
 
 // Reset surfbar counter
 updateConfiguration('surfbar_monthly_counter', '0');
index a31a7879a771721428e0be637e964fa6a8854d27..ba583c1cc1202bcac266ba2692f7814ed66d6b60 100644 (file)
@@ -176,7 +176,7 @@ if ((!isInstalling()) && (isInstalled())) {
                                // Is the extension sql_patches installed and at least 0.3.6?
                                if (GET_EXT_VERSION('sql_patches') >= '0.3.6') {
                                        // Generate random number
-                                       define('RAND_NUMBER', generateRandomCode(10, mt_rand(10000,32766), getUserId(), ''));
+                                       define('RAND_NUMBER', generateRandomCode(10, mt_rand(10000, 32766), getUserId(), ''));
                                } else {
                                        // Generate weak (!!!) code
                                        define('RAND_NUMBER', mt_rand(1000000, 9999999));
index 23f4621a6df002b9b2f957d673a0403d093596d6..49962859a1e1f5f053af6b143002057b016671f1 100644 (file)
@@ -117,10 +117,10 @@ function checkModulePermissions ($mod) {
        // Check for prefix is a extension...
        $modSplit = explode("_", $mod);
        $extension = ''; $mod_chk = $mod;
-       //* DEBUG: */ echo __LINE__."*".count($modSplit)."*/".$mod."*<br />";
+       //* DEBUG: */ OUTPUT_HTML(__LINE__."*".count($modSplit)."*/".$mod."*<br />");
        if (count($modSplit) == 2) {
                // Okay, there is a seperator (_) in the name so is the first part a module?
-               //* DEBUG: */ echo __LINE__."*".$modSplit[0]."*<br />";
+               //* DEBUG: */ OUTPUT_HTML(__LINE__."*".$modSplit[0]."*<br />");
                if (EXT_IS_ACTIVE($modSplit[0])) {
                        // The prefix is an extension's name, so let's set it
                        $extension = $modSplit[0]; $mod = $modSplit[1];
@@ -370,9 +370,9 @@ function ADD_DESCR ($accessLevel, $FQFN, $return = false, $output = true) {
                        $OUT = $prefix . "<strong><a class=\"you_are_here\" href=\"{!URL!}/modules.php?module=" . $modCheck . '&amp;' . $type . '=' . $search.$LINK_ADD . "\">" . $ret . "</a></strong>\n";
 
                        // Can we close the you-are-here navigation?
-                       //* DEBUG: */ echo __LINE__."*".$type.'/'.getWhat()."*<br />\n";
+                       //* DEBUG: */ OUTPUT_HTML(__LINE__."*".$type.'/'.getWhat()."*<br />");
                        if (($type == 'what') || (($type == 'action') && ((!isWhatSet()) || (getWhat() == 'overview')))) {
-                               //* DEBUG: */ echo __LINE__.'+'.$type."+<br />\n";
+                               //* DEBUG: */ OUTPUT_HTML(__LINE__.'+'.$type."+<br />");
                                // Add closing div and br-tag
                                $OUT .= "</div><br />\n";
                                $GLOBALS['nav_depth'] = '0';
@@ -418,12 +418,12 @@ function ADD_MENU ($mode, $act, $wht) {
        // Load SQL data and add the menu to the output stream...
        $result_main = SQL_QUERY_ESC("SELECT `title`, `action` FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE (`what`='' OR `what` IS NULL)".$AND." ORDER BY `sort` ASC",
                array($mode), __FUNCTION__, __LINE__);
-       //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$main_action.'/'.$sub_what.':'.getWhat()."*<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__LINE__.'/'.$main_cnt.'/'.$main_action.'/'.$sub_what.':'.getWhat()."*<br />");
        if (SQL_NUMROWS($result_main) > 0) {
                OUTPUT_HTML("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"".$mode."_menu\">");
                // There are menus available, so we simply display them... :)
                while ($content = SQL_FETCHARRAY($result_main)) {
-                       //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$sub_what.':'.getWhat()."*<br />\n";
+                       //* DEBUG: */ OUTPUT_HTML(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$sub_what.':'.getWhat()."*<br />");
                        // Init variables
                        enableBlockMode(false);
                        $act = $content['action'];
@@ -452,7 +452,7 @@ function ADD_MENU ($mode, $act, $wht) {
                                        $OUT = '';
 
                                        // Full file name for checking menu
-                                       //* DEBUG: */ echo __LINE__.":!!!!".$content['sub_what']."!!!<br />\n";
+                                       //* DEBUG: */ OUTPUT_HTML(__LINE__.":!!!!".$content['sub_what']."!!!<br />");
                                        $INC = sprintf("inc/modules/%s/what-%s.php", $mode, $content['sub_what']);
                                        if (isIncludeReadable($INC)) {
                                                if ((!empty($wht)) && (($wht == $content['sub_what']))) {
@@ -505,16 +505,16 @@ function ADD_MENU ($mode, $act, $wht) {
                                        if ((!EXT_IS_ACTIVE($content['action'])) || ($content['action'] == 'online')) OUTPUT_HTML("<tr>
 
   <td class=\"".$mode."_menu_whats\">");
-                                       //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />\n";
+                                       //* DEBUG: */ OUTPUT_HTML(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />");
                                        loadInclude($INC_BLOCK);
-                                       //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />\n";
+                                       //* DEBUG: */ OUTPUT_HTML(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />");
                                        if ((!EXT_IS_ACTIVE($content['action'])) || ($content['action'] == 'online')) OUTPUT_HTML("  </td>
 </tr>");
                                }
-                               //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />\n";
+                               //* DEBUG: */ OUTPUT_HTML(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />");
                        }
                        $main_cnt++;
-                       //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />\n";
+                       //* DEBUG: */ OUTPUT_HTML(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />");
                        if (SQL_NUMROWS($result_main) > $main_cnt) {
                                OUTPUT_HTML("<tr><td class=\"".$mode."_menu_seperator\"></td></tr>");
                        } // END - if
@@ -524,7 +524,7 @@ function ADD_MENU ($mode, $act, $wht) {
                SQL_FREERESULT($result_main);
 
                // Close table
-               //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />\n";
+               //* DEBUG: */ OUTPUT_HTML(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />");
                OUTPUT_HTML("</table>");
        } // END - if
 }
@@ -575,12 +575,12 @@ function IS_MEMBER () {
                                $ret = true;
                        } else {
                                // Maybe got locked etc.
-                               //* DEBUG: */ echo __LINE__."!!!<br />";
+                               //* DEBUG: */ OUTPUT_HTML(__LINE__."!!!<br />");
                                destroyUserSession();
                        }
                } else {
                        // Cookie data is invalid!
-                       //* DEBUG: */ echo __LINE__."***<br />";
+                       //* DEBUG: */ OUTPUT_HTML(__LINE__."***<br />");
                        destroyUserSession();
                }
 
@@ -588,7 +588,7 @@ function IS_MEMBER () {
                SQL_FREERESULT($result);
        } else {
                // Cookie data is invalid!
-               //* DEBUG: */ echo __LINE__."///<br />";
+               //* DEBUG: */ OUTPUT_HTML(__LINE__."///<br />");
                destroyUserSession();
        }
 
@@ -603,7 +603,7 @@ function IS_MEMBER () {
 function IS_ADMIN ($admin = '') {
        // Init variables
        $ret = false; $passCookie = ''; $valPass = '';
-       //* DEBUG: */ echo __LINE__."ADMIN:".$admin."<br />";
+       //* DEBUG: */ OUTPUT_HTML(__LINE__."ADMIN:".$admin."<br />");
 
        // If admin login is not given take current from cookies...
        if ((empty($admin)) && (isSessionVariableSet('admin_login')) && (isSessionVariableSet('admin_md5'))) {
@@ -611,7 +611,7 @@ function IS_ADMIN ($admin = '') {
                $admin = getSession('admin_login');
                $passCookie = getSession('admin_md5');
        }
-       //* DEBUG: */ echo __LINE__."ADMIN:".$admin.'/'.$passCookie."<br />";
+       //* DEBUG: */ OUTPUT_HTML(__LINE__."ADMIN:".$admin.'/'.$passCookie."<br />");
 
        // Search in array for entry
        if (isset($GLOBALS['cache_array']['admin_hash'])) {
@@ -650,12 +650,12 @@ function IS_ADMIN ($admin = '') {
 
        if (!empty($valPass)) {
                // Check if password is valid
-               //* DEBUG: */ print __FUNCTION__."*".$valPass.'/'.$passCookie."*<br />\n";
+               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."*".$valPass.'/'.$passCookie."*<br />");
                $ret = (($valPass == $passCookie) || ((strlen($valPass) == 32) && ($valPass == md5($passCookie))) || (($valPass == "*FAILED*") && (!EXT_IS_ACTIVE('cache'))));
        } // END - if
 
        // Return result of comparision
-       //* DEBUG: */ if (!$ret) echo __LINE__."OK!<br />";
+       //* DEBUG: */ if (!$ret) OUTPUT_HTML(__LINE__."OK!<br />");
        return $ret;
 }
 
@@ -747,7 +747,7 @@ function isMenuActionValid ($mode, $act, $wht, $UPDATE=false) {
        $add = '';
        if ((!IS_ADMIN()) && ($mode != 'admin')) $add = " AND `locked`='N'";
 
-       //* DEBUG: */ echo __LINE__.':'.$mode.'/'.$act.'/'.$wht."*<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__LINE__.':'.$mode.'/'.$act.'/'.$wht."*<br />");
        if (($mode != 'admin') && ($UPDATE === 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",
@@ -921,7 +921,7 @@ function getModeAction ($mode, $wht) {
        // Init status
        $ret = '';
 
-       //* DEBUG: */ echo __LINE__.'='.$mode.'/'.$wht.'/'.getAction()."=<br />";
+       //* DEBUG: */ OUTPUT_HTML(__LINE__.'='.$mode.'/'.$wht.'/'.getAction()."=<br />");
        if ((empty($wht)) && ($mode != 'admin')) {
                $wht = 'welcome';
                if (getConfig('index_home') != '') $wht = getConfig('index_home');
@@ -943,7 +943,7 @@ function getModeAction ($mode, $wht) {
                // Get it directly from URL
                return getAction();
        }
-       //* DEBUG: */ echo __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ret=".$ret."<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ret=".$ret."<br />");
 
        // Does the module have a menu?
        if (MODULE_HAS_MENU($mode)) {
@@ -1097,7 +1097,7 @@ function removeReceiver (&$receivers, $key, $uid, $pool_id, $stats_id = '', $bon
 // Calculate sum (default) or count records of given criteria
 function GET_TOTAL_DATA ($search, $tableName, $lookFor = 'id', $whereStatement = 'userid', $countRows = false, $add = '') {
        $ret = 0;
-       //* DEBUG: */ echo $search.'/'.$tableName.'/'.$lookFor.'/'.$whereStatement.'/'.$add.'<br />\n';
+       //* DEBUG: */ OUTPUT_HTML($search.'/'.$tableName.'/'.$lookFor.'/'.$whereStatement.'/'.$add.'<br />');
        if ((empty($search)) && ($search != '0')) {
                // Count or sum whole table?
                if ($countRows === true) {
@@ -1111,12 +1111,12 @@ function GET_TOTAL_DATA ($search, $tableName, $lookFor = 'id', $whereStatement =
                }
        } elseif (($countRows === true) || ($lookFor == 'userid')) {
                // Count rows
-               //* DEBUG: */ echo "COUNT!<br />\n";
+               //* DEBUG: */ OUTPUT_HTML("COUNT!<br />");
                $result = SQL_QUERY_ESC("SELECT COUNT(`%s`) FROM `{!_MYSQL_PREFIX!}_%s` WHERE `%s`='%s'".$add,
                        array($lookFor, $tableName, $whereStatement, $search), __FUNCTION__, __LINE__);
        } else {
                // Add all rows
-               //* DEBUG: */ echo "SUM!<br />\n";
+               //* DEBUG: */ OUTPUT_HTML("SUM!<br />");
                $result = SQL_QUERY_ESC("SELECT SUM(`%s`) FROM `{!_MYSQL_PREFIX!}_%s` WHERE `%s`='%s'".$add,
                        array($lookFor, $tableName, $whereStatement, $search), __FUNCTION__, __LINE__);
        }
@@ -1188,7 +1188,7 @@ function getReferalLevelPercents ($level) {
  *               for default value will cause no referal will get points ever!!!)
  */
 function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify = false, $rid = '0', $locked = false, $add_mode = 'ref') {
-       //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
+       //* DEBUG: */ OUTPUT_HTML("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
        global $DATA;
 
        // Convert mode to lower-case
@@ -1210,12 +1210,12 @@ function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify = false, $r
        // Count up referal depth
        if (!isset($GLOBALS['ref_level'])) {
                // Initialialize referal system
-               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): Referal system initialized!<br />\n";
+               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): Referal system initialized!<br />");
                $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 />\n";
+               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): Referal level increased. DEPTH={$GLOBALS['ref_level']}<br />");
        }
 
        // Default is 'normal' points
@@ -1226,9 +1226,9 @@ function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify = false, $r
 
        // Check user account
        $result_user = SQL_QUERY_ESC("SELECT refid, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s AND `status`='CONFIRMED' LIMIT 1",
-       array(bigintval($uid)), __FUNCTION__, __LINE__);
+               array(bigintval($uid)), __FUNCTION__, __LINE__);
 
-       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},numRows=".SQL_NUMROWS($result_user).",points={$points}<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},numRows=".SQL_NUMROWS($result_user).",points={$points}<br />");
        if (SQL_NUMROWS($result_user) == 1) {
                // This is the user and his ref
                list($ref, $email) = SQL_FETCHROW($result_user);
@@ -1236,32 +1236,32 @@ function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify = false, $r
 
                // Get percents
                $per = getReferalLevelPercents($GLOBALS['ref_level']);
-               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},points={$points},depth={$GLOBALS['ref_level']},per={$per},mode={$add_mode}<br />\n";
+               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},points={$points},depth={$GLOBALS['ref_level']},per={$per},mode={$add_mode}<br />");
 
                // Some percents found?
                if ($per > 0) {
                        // Calculate new points
-                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},points={$points},per={$per},depth={$GLOBALS['ref_level']}<br />\n";
+                       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},points={$points},per={$per},depth={$GLOBALS['ref_level']}<br />");
                        $ref_points = $points * $per / 100;
 
                        // Pay refback here if level > 0 and in ref-mode
                        if ((EXT_IS_ACTIVE('refback')) && ($GLOBALS['ref_level'] > 0) && ($per < 100) && ($add_mode == "ref") && (isset($GLOBALS['cache_array']['add_uid'][$uid]))) {
-                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},data={$GLOBALS['cache_array']['add_uid'][$uid]},ref_points={$ref_points},depth={$GLOBALS['ref_level']} - BEFORE!<br />\n";
+                               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},data={$GLOBALS['cache_array']['add_uid'][$uid]},ref_points={$ref_points},depth={$GLOBALS['ref_level']} - BEFORE!<br />");
                                $ref_points = ADD_REFBACK_POINTS($GLOBALS['cache_array']['add_uid'][$uid], $uid, $points, $ref_points);
-                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},data={$GLOBALS['cache_array']['add_uid'][$uid]},ref_points={$ref_points},depth={$GLOBALS['ref_level']} - AFTER!<br />\n";
+                               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},data={$GLOBALS['cache_array']['add_uid'][$uid]},ref_points={$ref_points},depth={$GLOBALS['ref_level']} - AFTER!<br />");
                        } // 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",
                        array($data, $data, $ref_points, bigintval($uid), bigintval($GLOBALS['ref_level'])), __FUNCTION__, __LINE__);
-                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):data={$data},ref_points={$ref_points},uid={$uid},depth={$GLOBALS['ref_level']},mode={$add_mode} - UPDATE! (".SQL_AFFECTEDROWS().")<br />\n";
+                       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):data={$data},ref_points={$ref_points},uid={$uid},depth={$GLOBALS['ref_level']},mode={$add_mode} - UPDATE! (".SQL_AFFECTEDROWS().")<br />");
 
                        // 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)",
                                array($data, bigintval($uid), bigintval($GLOBALS['ref_level']), $ref_points), __FUNCTION__, __LINE__);
-                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):data={$data},ref_points={$ref_points},uid={$uid},depth={$GLOBALS['ref_level']},mode={$add_mode} - INSERTED! (".SQL_AFFECTEDROWS().")<br />\n";
+                               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):data={$data},ref_points={$ref_points},uid={$uid},depth={$GLOBALS['ref_level']},mode={$add_mode} - INSERTED! (".SQL_AFFECTEDROWS().")<br />");
                        } // END - if
 
                        // Update mediadata as well
@@ -1305,7 +1305,7 @@ function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify = false, $r
                        // Maybe there's another ref?
                        if (($ref > 0) && ($points > 0) && ($ref != $uid) && ($add_mode == 'ref')) {
                                // Then let's credit him here...
-                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref},points={$points} - ADVANCE!<br />\n";
+                               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref},points={$points} - ADVANCE!<br />");
                                ADD_POINTS_REFSYSTEM(sprintf("%s_ref:%s", $subject, $GLOBALS['ref_level']), $ref, $points, $send_notify, $ref, $locked);
                        } // END - if
                } // END - if
@@ -1313,7 +1313,7 @@ function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify = false, $r
 
        // Free result
        SQL_FREERESULT($result_user);
-       //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+       //* DEBUG: */ OUTPUT_HTML("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
 }
 
 // Wrapper function for ADD_POINTS_REFSYSTEM()
@@ -1325,19 +1325,19 @@ function ADD_POINTS_REFSYSTEM_DIRECT ($subject, $uid, $points) {
 function updateReferalCounter ($uid) {
        // Make it sure referal level zero (member him-/herself) is at least selected
        if (empty($GLOBALS['cache_array']['ref_level'][$uid])) $GLOBALS['cache_array']['ref_level'][$uid] = 1;
-       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['ref_level'][$uid]}<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['ref_level'][$uid]}<br />");
 
        // Update counter
        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_refsystem` SET `counter`=`counter`+1 WHERE `userid`=%s AND `level`='%s' LIMIT 1",
                array(bigintval($uid), $GLOBALS['cache_array']['ref_level'][$uid]), __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 />\n";
+       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):updated=".SQL_AFFECTEDROWS()."<br />");
        if (SQL_AFFECTEDROWS() < 1) {
                // First count!
                SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_refsystem` (`userid`, `level`, `counter`) VALUES (%s,%s,1)",
                        array(bigintval($uid), $GLOBALS['cache_array']['ref_level'][$uid]), __FUNCTION__, __LINE__);
-               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid}<br />\n";
+               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid}<br />");
        } // END - if
 
        // Check for his referal
@@ -1349,16 +1349,16 @@ function updateReferalCounter ($uid) {
 
        // Free memory
        SQL_FREERESULT($result);
-       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref}<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref}<br />");
 
        // When he has a referal...
        if (($ref > 0) && ($ref != $uid)) {
                // Move to next referal level and count his counter one up!
-               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):ref={$ref} - ADVANCE!<br />\n";
+               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):ref={$ref} - ADVANCE!<br />");
                $GLOBALS['cache_array']['ref_level'][$uid]++; updateReferalCounter($ref);
        } elseif ((($ref == $uid) || ($ref == 0)) && (GET_EXT_VERSION('cache') >= '0.1.2')) {
                // Remove cache here
-               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):ref={$ref} - CACHE!<br />\n";
+               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):ref={$ref} - CACHE!<br />");
                rebuildCacheFiles('refsystem', 'refsystem');
        }
 
@@ -1739,7 +1739,7 @@ function getWhatFromModule ($modCheck) {
        // Default is empty
        $wht = '';
 
-       //* DEBUG: */ echo __LINE__.'!'.$modCheck."!<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__LINE__.'!'.$modCheck."!<br />");
        switch ($modCheck) {
                case 'admin':
                        $wht = 'overview';
@@ -1835,7 +1835,7 @@ function updateConfiguration ($entries, $values, $updateMode='') {
 
        // Get affected rows
        $affectedRows = SQL_AFFECTEDROWS();
-       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):entries={$entries},affectedRows={$affectedRows}<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):entries={$entries},affectedRows={$affectedRows}<br />");
 
        // Rebuild cache
        rebuildCacheFiles('config', 'config');
@@ -2131,7 +2131,7 @@ function insertUserStatsRecord ($uid, $type, $data) {
 
 // "Getter" for array for user refs and points in given level
 function getUserReferalPoints ($uid, $level) {
-       //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
+       //* DEBUG: */ OUTPUT_HTML("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
        // Default is no refs and no nickname
        $add = '';
        $refs = array();
@@ -2194,7 +2194,7 @@ ORDER BY ur.refid ASC",
        SQL_FREERESULT($result);
 
        // Return result
-       //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+       //* DEBUG: */ OUTPUT_HTML("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
        return $refs;
 }
 
index 1bc67ec2aa436caad11d90dc837e6f54ca88cfdd..6793f63f4bcdeb6fba7df1ea9e50b92be191b017 100644 (file)
@@ -91,7 +91,7 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
                        // We can now send mails to them...
                        foreach ($RECEIVERS as $key => $uid) {
                                // Load personal data
-                               //* DEBUG: */ echo "*L:".__LINE__.'/'.$uid."*<br />";
+                               //* DEBUG: */ OUTPUT_HTML("*L:".__LINE__.'/'.$uid."*<br />");
                                $result_user = SQL_QUERY_ESC("SELECT `surname`, `family`, `email` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1",
                                        array(bigintval($uid)), __FILE__, __LINE__);
 
@@ -99,7 +99,7 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
                                if (SQL_NUMROWS($result_user) == 1) {
                                        // The final receiver does exists so we can continue...
                                        list($sname, $fname, $email) = SQL_FETCHROW($result_user);
-                                       //* DEBUG: */ echo "OK!/L:".__LINE__."<br />";
+                                       //* DEBUG: */ OUTPUT_HTML("OK!/L:".__LINE__."<br />");
 
                                        // Mark this user as "spammed" ;-) And place a line for him...
                                        if (removeReceiver($dummy, $key, $uid, $DATA['id'], $DATA['id'], true) == 'done') {
@@ -142,7 +142,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: */ echo "*EXIT/L:".__LINE__."<br />";
+                                                       //* DEBUG: */ OUTPUT_HTML("*EXIT/L:".__LINE__."<br />");
                                                        break;
                                                } // END - if
                                        } // END - if
@@ -157,31 +157,31 @@ 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: */ echo "+MEDIA/L:".__LINE__.'/'.$P."+<br />";
+                               //* DEBUG: */ OUTPUT_HTML("+MEDIA/L:".__LINE__.'/'.$P."+<br />");
                                MEDIA_UPDATE_ENTRY(array("total_send", "bonus_send"), 'add', $P);
                        } // END - if
 
                        // Close sending system
-                       //* DEBUG: */ echo "-L:".__LINE__.'/'.countSelection($dummy)."-<br />";
+                       //* DEBUG: */ OUTPUT_HTML("-L:".__LINE__.'/'.countSelection($dummy)."-<br />");
                        if (countSelection($dummy) == 0) {
                                // Queue reached!
                                SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_bonus` SET `data_type`='SEND', `target_send`=0, `receivers`='' WHERE `id`=%s LIMIT 1",
                                array(bigintval($DATA['id'])), __FILE__, __LINE__);
-                               //* DEBUG: */ echo "*L:".__LINE__."*<br />";
+                               //* DEBUG: */ OUTPUT_HTML("*L:".__LINE__."*<br />");
 
                                // Update mediadata if version is 0.0.4 or higher
                                if (GET_EXT_VERSION('mediadata') >= '0.0.4') {
                                        // Update entry (or add missing)
-                                       //* DEBUG: */ echo "*MEDIA/L:".__LINE__."*<br />";
+                                       //* DEBUG: */ OUTPUT_HTML("*MEDIA/L:".__LINE__."*<br />");
                                        MEDIA_UPDATE_ENTRY(array("total_orders", "bonus_orders"), 'add', 1);
                                } // END - if
                        } elseif ($GLOBALS['pool_cnt'] >= getConfig('max_send')) {
                                // Update bonus pool
                                SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_bonus` SET `data_type`='NEW', `target_send`=%s, `receivers`='%s' WHERE `id`=%s LIMIT 1",
                                array(countSelection($dummy), implode(';', $dummy), bigintval($DATA['id'])), __FILE__, __LINE__);
-                               //* DEBUG: */ echo "*L:".__LINE__."<pre>";
-                               //* DEBUG: */ print_r($dummy);
-                               //* DEBUG: */ echo "</pre>\n!!!<br />";
+                               //* DEBUG: */ OUTPUT_HTML("*L:".__LINE__."<pre>");
+                               //* DEBUG: */ OUTPUT_HTML(print_r($dummy, true));
+                               //* DEBUG: */ OUTPUT_HTML("</pre>\n!!!<br />");
                                break;
                        }
                }
index 83bd61e43536951338dddcf3c6256da307b9e64d..c10638afb4048489e672ffca143f21db8aae57c2 100644 (file)
@@ -99,7 +99,7 @@ if (SQL_NUMROWS($result_main) > 0) {
                                        array(bigintval($uid)), __FILE__, __LINE__);
 
                                // Is his data available?
-                               //* DEBUG: */ echo "*L:".__LINE__.'/'.SQL_NUMROWS($result_user)."*<br />";
+                               //* DEBUG: */ OUTPUT_HTML("*L:".__LINE__.'/'.SQL_NUMROWS($result_user)."*<br />");
                                if (SQL_NUMROWS($result_user) == 1) {
                                        // The final receiver does exists so we can continue...
                                        list($gender, $sname, $fname, $email) = SQL_FETCHROW($result_user);
@@ -112,7 +112,7 @@ if (SQL_NUMROWS($result_main) > 0) {
                                                array($DATA[0], $DATA[1], $DATA[6]), __FILE__, __LINE__);
 
                                        // If there's no stats entry add it!
-                                       //* DEBUG: */ echo "!L:".__LINE__.'/'.SQL_NUMROWS($result_stats)."!<br />";
+                                       //* DEBUG: */ OUTPUT_HTML("!L:".__LINE__.'/'.SQL_NUMROWS($result_stats)."!<br />");
                                        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())",
@@ -123,15 +123,14 @@ if (SQL_NUMROWS($result_main) > 0) {
                                                        array(bigintval($DATA[0]), bigintval($DATA[1]), bigintval($DATA[6])), __FILE__, __LINE__);
                                        } // END - if
 
-                                       //* DEBUG: */ echo "!L:".__LINE__.'/'.SQL_NUMROWS($result_stats)."!<br />";
+                                       //* DEBUG: */ OUTPUT_HTML("!L:".__LINE__.'/'.SQL_NUMROWS($result_stats)."!<br />");
                                        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: */ echo "?L:".__LINE__.'/'.$dummy.'/'.$key.'/'.$uid.'('.$DATA[1].")/".$DATA[0].'/'.$stats_id."?<br />";
-                                               switch (removeReceiver($dummy, $key, bigintval($uid), bigintval($DATA[0]), bigintval($stats_id)))
-                                               {
+                                               //* DEBUG: */ OUTPUT_HTML("?L:".__LINE__.'/'.$dummy.'/'.$key.'/'.$uid.'('.$DATA[1].")/".$DATA[0].'/'.$stats_id."?<br />");
+                                               switch (removeReceiver($dummy, $key, bigintval($uid), bigintval($DATA[0]), bigintval($stats_id))) {
                                                        case 'done':
                                                                // Prepare the mail
                                                                $DATA[11] = bigintval($stats_id);
@@ -174,25 +173,25 @@ if (SQL_NUMROWS($result_main) > 0) {
                                                                // Update mediadata if version is 0.0.4 or higher
                                                                if (GET_EXT_VERSION('mediadata') >= '0.0.4') {
                                                                        // Update entry (or add missing)
-                                                                       //* DEBUG: */ echo "*MEDIA/L:".__LINE__."*<br />";
+                                                                       //* DEBUG: */ OUTPUT_HTML("*MEDIA/L:".__LINE__."*<br />");
                                                                        MEDIA_UPDATE_ENTRY(array("total_send", "normal_send"), 'add', 1);
                                                                } // END - if
 
                                                                // And count up the mail
                                                                $GLOBALS['pool_cnt']++;
-                                                               //* DEBUG: */ echo"*EXIT/L:".__LINE__.'/'.$GLOBALS['pool_cnt']."*<br />";
+                                                               //* DEBUG: */ OUTPUT_HTML("*EXIT/L:".__LINE__.'/'.$GLOBALS['pool_cnt']."*<br />");
                                                                break;
 
                                                        case 'already':
                                                                // Entry already found, but we still count one up!
                                                                $GLOBALS['pool_cnt']++;
-                                                               //* DEBUG: */ echo"*EXIT/L:".__LINE__.'/'.$GLOBALS['pool_cnt']."<br />";
+                                                               //* DEBUG: */ OUTPUT_HTML("*EXIT/L:".__LINE__.'/'.$GLOBALS['pool_cnt']."<br />");
                                                                break;
                                                }
                                        }
 
                                        // Do we have reached the maximum to send mails? || (getConfig('max_send') >= $GLOBALS['pool_cnt'])
-                                       //* DEBUG: */ echo "*L:".__LINE__.'/'.$GLOBALS['pool_cnt'].">=".$DATA[8].'/'.getConfig('max_send').">=".$GLOBALS['pool_cnt'].'/'.$lastSentId."!=".$DATA[0]."*<br />";
+                                       //* DEBUG: */ OUTPUT_HTML("*L:".__LINE__.'/'.$GLOBALS['pool_cnt'].">=".$DATA[8].'/'.getConfig('max_send').">=".$GLOBALS['pool_cnt'].'/'.$lastSentId."!=".$DATA[0]."*<br />");
                                        if ((($GLOBALS['pool_cnt'] >= $DATA[8])) && ($lastSentId != $DATA[0])) {
                                                // Prepare content
                                                $content = array(
@@ -239,11 +238,11 @@ if (SQL_NUMROWS($result_main) > 0) {
                                                // Update mediadata if version is 0.0.4 or higher
                                                if (GET_EXT_VERSION('mediadata') >= '0.0.4') {
                                                        // Update entry (or add missing)
-                                                       //* DEBUG: */ echo "*MEDIA/L:".__LINE__."*<br />";
+                                                       //* DEBUG: */ OUTPUT_HTML("*MEDIA/L:".__LINE__."*<br />");
                                                        MEDIA_UPDATE_ENTRY(array("total_orders", "normal_orders"), 'add', 1);
                                                } // END - if
 
-                                               //* DEBUG: */ echo"*EXIT/L:".__LINE__.'/'.$P."<br />";
+                                               //* DEBUG: */ OUTPUT_HTML("*EXIT/L:".__LINE__.'/'.$P."<br />");
                                                break;
                                        }
                                        // Do we have send maximum mails?
@@ -254,7 +253,7 @@ if (SQL_NUMROWS($result_main) > 0) {
                                                SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET `data_type`='NEW', receivers='%s'".$add." WHERE `id`=%s LIMIT 1",
                                                        array(implode(';', $dummy), bigintval($DATA[0])), __FILE__, __LINE__);
 
-                                               //* DEBUG: */ echo"*EXIT/L:".__LINE__."*<br />";
+                                               //* DEBUG: */ OUTPUT_HTML("*EXIT/L:".__LINE__."*<br />");
                                                break;
                                        }
 
index bd04234ba5a79293ae197c4f38fbf33c03fba327..e14cf05433a4834b7b1db5d9f2ed30e5fe19bca6 100644 (file)
@@ -46,7 +46,7 @@ if (!defined('__SECURITY')) {
 
 // Do not execute when script is in CSS mode or no daily reset
 if ((getOutputMode() == 1) || (!isResetModeEnabled()) || (getConfig('beg_rallye') == 'Y')) return;
-//* DEBUG: */ echo basename(__FILE__)."<br />\n";
+//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."<br />");
 
 // Reset accounts
 $result = SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET beg_points=0.00000 WHERE beg_points > 0",
index 03fabd84c89e52eca0433c6d216b7c079fb85308..2d2cb237bd6a477f1540cf1e8fb1ff6f730dfee8 100644 (file)
@@ -46,7 +46,7 @@ if (!defined('__SECURITY')) {
 
 // Do not execute when script is in CSS mode or no daily reset
 if ((getOutputMode() == 1) || (!isResetModeEnabled())) return;
-//* DEBUG: */ echo basename(__FILE__)."<br />\n";
+//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."<br />");
 
 // Purge expired entries in _bonus_turbo
 BONUS_PURGE_EXPIRED_TURBO_BONUS();
index 87a9a10a63016917005d92ea1d0a65e8e9e59f2d..47ae3478de61dfb9194da322b639fe0603535c50 100644 (file)
@@ -46,7 +46,7 @@ if (!defined('__SECURITY')) {
 
 // Do not execute when script is in CSS mode or no daily reset
 if ((getOutputMode() == 1) || (!isResetModeEnabled())) return;
-//* DEBUG: */ echo basename(__FILE__)."<br />\n";
+//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."<br />");
 
 // Update user profiles
 if (GET_EXT_VERSION('order') >= '0.1.1') {
@@ -60,26 +60,26 @@ if (GET_EXT_VERSION('order') >= '0.1.1') {
 // Transfer points from locked_points to points
 $result_daily = SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE ref_payout=0 AND `status`='CONFIRMED' ORDER BY `userid` ASC", __FILE__, __LINE__);
 
-//* DEBUG: */ echo basename(__FILE__).":payout=0;daily|numRows=".SQL_NUMROWS($result_daily)."<br />\n";
+//* DEBUG: */ OUTPUT_HTML(basename(__FILE__).":payout=0;daily|numRows=".SQL_NUMROWS($result_daily)."<br />");
 if (SQL_NUMROWS($result_daily) > 0) {
        // Init SQLs
        INIT_SQLS();
 
        // Start checking accounts which are on 0 confirmed-to-go mails
        while ($content = SQL_FETCHARRAY($result_daily)) {
-               //* DEBUG: */ echo basename(__FILE__).":uid={$content['userid']}<br />\n";
+               //* DEBUG: */ OUTPUT_HTML(basename(__FILE__).":uid={$content['userid']}<br />");
                $result_points = SQL_QUERY_ESC("SELECT ref_depth, locked_points FROM `{!_MYSQL_PREFIX!}_user_points`
 WHERE userid=%s AND locked_points != 0.00000 ORDER BY ref_depth",
                array(bigintval($content['userid'])), __FILE__, __LINE__);
 
-               //* DEBUG: */ echo basename(__FILE__).":payout=0;points|numRows=".SQL_NUMROWS($result_points)."<br />\n";
+               //* DEBUG: */ OUTPUT_HTML(basename(__FILE__).":payout=0;points|numRows=".SQL_NUMROWS($result_points)."<br />");
                if (SQL_NUMROWS($result_points) > 0) {
                        // Ok transfer points
                        while ($content2 = SQL_FETCHARRAY($result_points)) {
                                // Merge both arrays
                                $content = merge_array($content, $content2);
 
-                               //* DEBUG: */ echo basename(__FILE__).":uid={$content['userid']},depth={$content['ref_depth']},locked={$content['locked_points']}<br />\n";
+                               //* DEBUG: */ OUTPUT_HTML(basename(__FILE__).":uid={$content['userid']},depth={$content['ref_depth']},locked={$content['locked_points']}<br />");
                                ADD_SQL(SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_points` SET points=points+%s, locked_points=0.00000
 WHERE userid=%s AND ref_depth=%d
 LIMIT 1",
index 0b815c9b2044d038b61631c9cf8ef8a754849481..0c1b2f8820991449b5aa94a59b603bf6a088831d 100644 (file)
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
-} elseif (!EXT_IS_ACTIVE("engine")) {
+} elseif (!EXT_IS_ACTIVE('engine')) {
        return;
 }
 
 // Do not execute when script is in CSS mode or no daily reset
 if ((getOutputMode() == 1) || (!isResetModeEnabled())) return;
-//* DEBUG: */ echo basename(__FILE__)."<br />\n";
+//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."<br />");
 
 //
 ?>
index ce3762b754d96883e0209ceb0df2487999c98587..3fd392a602239b191e5d3b48956a4a9eb821fe43 100644 (file)
@@ -46,7 +46,7 @@ if (!defined('__SECURITY')) {
 
 // Do not execute when script is in CSS mode or no daily reset
 if ((getOutputMode() == 1) || ((!isResetModeEnabled()) && (getConfig('holiday_mode') == 'RESET'))) return;
-//* DEBUG: */ echo basename(__FILE__)."<br />\n";
+//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."<br />");
 
 // Check for holidays we need to enable and send email to user
 $result_main = SQL_QUERY("SELECT userid, holiday_activated
index fd5b6527abe4f7c78e794e9a4bb5fc49c54c4c49..d44a6f60a76a008d37016751e680aefeac1b99d1 100644 (file)
@@ -46,7 +46,7 @@ if (!defined('__SECURITY')) {
 
 // Do not execute when script is in CSS mode or no daily reset
 if ((getOutputMode() == 1) || (!isResetModeEnabled())) return;
-//* DEBUG: */ echo basename(__FILE__)."<br />\n";
+//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."<br />");
 
 // Reset surfbar counter
 updateConfiguration(array("surfbar_daily_counter", "surfbar_yester_counter"), array(0, getConfig('surfbar_daily_counter')));
index 1c2245aebb494810d5cd5231a7fa633fc2d5f15f..19cff33338db66478d0042712ebc2039109aa3bd 100644 (file)
  * MA  02110-1301  USA                                                  *
  ************************************************************************/
 
-print "<pre>";
+print("<pre>");
 debug_print_backtrace();
 die("</pre>");
 
-echo "<html>
+print("<html>
 <head>
 <title>Protected file ".basename($_SERVER['PHP_SELF'])." - ACCESS DENIED!</title>
 </head>
@@ -65,7 +65,7 @@ echo "<html>
 </table>
 </div>
 </body>
-</html>\n";
+</html>\n");
 shutdown();
 //
 ?>
index 495c36625f5aebd49d607012538dc3847f472a5a..6a47b648dde0e024bcb220ae38435e208f991e47 100644 (file)
@@ -53,29 +53,29 @@ function setSession ($var, $value) {
        // Is the session variable set?
        if (("".$value."" == '') && (isSessionVariableSet($var))) {
                // Remove the session
-               //* DEBUG: */ echo "UNSET:".$var.'='.getSession($var)."<br />\n";
+               //* DEBUG: */ OUTPUT_HTML("UNSET:".$var.'='.getSession($var)."<br />");
                unset($_SESSION[$var]);
                return session_unregister($var);
        } elseif (("".$value."" != '') && (!isSessionVariableSet($var))) {
                // Set session
-               //* DEBUG: */ echo "SET:".$var.'='.$value."<br />\n";
+               //* DEBUG: */ OUTPUT_HTML("SET:".$var.'='.$value."<br />");
                $_SESSION[$var] =  $value;
                return session_register($var);
        } elseif (!empty($value)) {
                // Update session
-               //* DEBUG: */ echo "UPDATE:".$var.'='.$value."<br />\n";
+               //* DEBUG: */ OUTPUT_HTML("UPDATE:".$var.'='.$value."<br />");
                $_SESSION[$var] = $value;
                return true;
        }
 
        // Ignored (but valid)
-       //* DEBUG: */ echo "IGNORED:".$var.'='.$value."<br />\n";
+       //* DEBUG: */ OUTPUT_HTML("IGNORED:".$var.'='.$value."<br />");
        return true;
 }
 
 // Check wether a session variable is set
 function isSessionVariableSet ($var) {
-       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):var={$var}<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):var={$var}<br />");
        return (isset($_SESSION[$var]));
 }
 
@@ -87,11 +87,11 @@ function getSession ($var) {
        // Is the variable there or cached values?
        if (isset($GLOBALS['cache_array']['session'][$var])) {
                // Get cached value (skips a lot SQL_ESCAPE() calles!
-               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ".$var."-CACHE!<br />\n";
+               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ".$var."-CACHE!<br />");
                $value = $GLOBALS['cache_array']['session'][$var];
        } elseif (isSessionVariableSet($var)) {
                // Then  get it secured!
-               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ".$var."-RESOLVE!<br />\n";
+               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ".$var."-RESOLVE!<br />");
                $value = SQL_ESCAPE($_SESSION[$var]);
 
                // Cache the value
index 7527451607c17e68993f0aa7fc0d4cdee1bca312..305de9010b06e77307bf7124bd3fe9a6d45969f6 100644 (file)
@@ -46,7 +46,7 @@ if (!defined('__SECURITY')) {
 
 // Do not execute when script is in CSS mode or no daily reset
 if ((getOutputMode() == 1) || (!isResetModeEnabled())) return;
-//* DEBUG: */ echo basename(__FILE__)."<br />\n";
+//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."<br />");
 
 // Reset the surfbar counter
 updateConfiguration('surfbar_weekly_counter', '0');