From 36c3c8b749a88ce05ad0fda81e00047f9cb5433f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 6 Oct 2009 20:04:31 +0000 Subject: [PATCH] Inconsistency between echo and print() fixed to OUTPUT_HTML() (not all) --- birthday_confirm.php | 2 +- inc/config-functions.php | 10 +- inc/db/lib-mysql3.php | 22 ++--- inc/extensions.php | 22 ++--- inc/filters.php | 4 +- inc/functions.php | 116 ++++++++++++------------ inc/gen_refback.php | 2 +- inc/libs/admins_functions.php | 2 +- inc/libs/cache_functions.php | 6 +- inc/libs/rallye_functions.php | 22 ++--- inc/libs/refback_functions.php | 86 +++++++++--------- inc/libs/surfbar_functions.php | 2 +- inc/libs/wernis_functions.php | 4 +- inc/libs/yoomedia_functions.php | 6 +- inc/modules/admin/admin-inc.php | 14 +-- inc/modules/admin/overview-inc.php | 4 +- inc/modules/admin/what-del_email.php | 4 +- inc/modules/admin/what-list_rallyes.php | 4 +- inc/modules/admin/what-list_refs.php | 2 +- inc/modules/admin/what-logs.php | 2 +- inc/modules/guest/action-themes.php | 19 ++-- inc/modules/member/action-themes.php | 15 +-- inc/monthly/monthly_beg.php | 2 +- inc/monthly/monthly_bonus.php | 2 +- inc/monthly/monthly_newsletter.php | 6 +- inc/monthly/monthly_surfbar.php | 2 +- inc/mysql-connect.php | 2 +- inc/mysql-manager.php | 96 ++++++++++---------- inc/pool/pool-bonus.php | 20 ++-- inc/pool/pool-user.php | 25 +++-- inc/reset/reset_beg.php | 2 +- inc/reset/reset_bonus.php | 2 +- inc/reset/reset_daily.php | 10 +- inc/reset/reset_engine.php | 4 +- inc/reset/reset_holiday.php | 2 +- inc/reset/reset_surfbar.php | 2 +- inc/security.php | 6 +- inc/session-functions.php | 14 +-- inc/weekly/weekly_surfbar.php | 2 +- 39 files changed, 287 insertions(+), 282 deletions(-) diff --git a/birthday_confirm.php b/birthday_confirm.php index 70332e33f7..f72b7a7195 100644 --- a/birthday_confirm.php +++ b/birthday_confirm.php @@ -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).")
\n"; +//* DEBUG: */ OUTPUT_HTML("uid=".$uid.",chk=".$chk." (".strlen($chk).'/'.strlen(REQUEST_GET('check')).'/'.SQL_NUMROWS($result).")
"); // Prepare content $content = array(); diff --git a/inc/config-functions.php b/inc/config-functions.php index d261faecaa..c70857e9af 100644 --- a/inc/config-functions.php +++ b/inc/config-functions.php @@ -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])."
\n"; + //* DEBUG: */ OUTPUT_HTML(gettype($GLOBALS['cache_array']['config'][$no])."
"); 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!
\n"; + //* DEBUG: */ OUTPUT_HTML(htmlentities($line) . " - FOUND!
"); // 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 . "
\n"; + //* DEBUG: */ OUTPUT_HTML('function=' . $function . ',new=' . $new . ',comment=' . $comment . "
"); changeDataInFile(constant('PATH') . 'inc/cache/config-local.php', $comment, $function . "('" . $oldNew . "', \"", "\");", constant($new), 0); - //* DEBUG: */ print "CHANGED!
\n"; + //* DEBUG: */ OUTPUT_HTML("CHANGED!
"); // Mark it as done $done[$old] = 1; @@ -280,7 +280,7 @@ function updateOldConfigFile () { } // Debug output only - //* DEBUG: */ print htmlentities($line) . " - MySQL!
\n"; + //* DEBUG: */ OUTPUT_HTML(htmlentities($line) . " - MySQL!
"); // Split parts so we can check them and prepare them $parts = explode('=>', $line); diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php index 0d97094c82..bb43adeba8 100644 --- a/inc/db/lib-mysql3.php +++ b/inc/db/lib-mysql3.php @@ -70,12 +70,12 @@ function SQL_QUERY ($sql_string, $F, $L) { $querytimeBefore = array_sum(explode(' ', microtime())); // Run SQL command - //* DEBUG: */ print $sql_string."
\n"; + //* DEBUG: */ OUTPUT_HTML($sql_string."
"); $result = mysql_query($sql_string, SQL_GET_LINK()) or addFatalMessage(__FUNCTION__, __LINE__, $F." (".$L."):".mysql_error()."
Query string:
".$sql_string); - //* DEBUG: */ print __LINE__ . ': numRows=' . SQL_NUMROWS($result) . ',affected=' . SQL_AFFECTEDROWS() . "
\n"; + //* DEBUG: */ OUTPUT_HTML(__LINE__ . ': numRows=' . SQL_NUMROWS($result) . ',affected=' . SQL_AFFECTEDROWS() . "
"); // Ending time $querytimeAfter = array_sum(explode(' ', microtime())); @@ -90,7 +90,7 @@ Query string:
incrementConfigEntry('sql_count'); // Debug output - //* DEBUG: */ print "Query=
".$sql_string."
, affected=".SQL_AFFECTEDROWS().", numrows=".SQL_NUMROWS($result)."
\n"; + //* DEBUG: */ OUTPUT_HTML("Query=
".$sql_string."
, affected=".SQL_AFFECTEDROWS().", numrows=".SQL_NUMROWS($result)."
"); 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')."
\n"; + //* DEBUG: */ OUTPUT_HTML("DB=".getConfig('db_hits').",CACHE=".getConfig('cache_hits')."
"); 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__."(".__LINE__."):str={$str}
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):str={$str}
"); 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."
\n"; + //* DEBUG: */ OUTPUT_HTML(__LINE__.':'.$sql."
"); $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."
\n"; + //* DEBUG: */ OUTPUT_HTML(__LINE__.':'.$columnName."----------------".$begin."
"); // Remove brackes $columnName = str_replace('(', '', str_replace(')', '', $columnName)); - //* DEBUG: */ print __LINE__.':'.$columnName."----------------".$begin."
\n"; + //* DEBUG: */ OUTPUT_HTML(__LINE__.':'.$columnName."----------------".$begin."
"); // 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 "
".print_r($content, true)."
"; + //* DEBUG: */ OUTPUT_HTML("
".print_r($content, true)."
"); 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."
\n"; + //* DEBUG: */ OUTPUT_HTML(__LINE__.':'.$sql."
"); $result = SQL_QUERY($sql, $F, $L, false); } // END - if } else { // Other ALTER TABLE query - //* DEBUG: */ print __LINE__.':'.$sql."
\n"; + //* DEBUG: */ OUTPUT_HTML(__LINE__.':'.$sql."
"); $result = SQL_QUERY($sql, $F, $L, false); } diff --git a/inc/extensions.php b/inc/extensions.php index 22f218150d..c9865d7f83 100644 --- a/inc/extensions.php +++ b/inc/extensions.php @@ -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!
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME()." - ENTERED!
"); // 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!
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME()." - ALREADY!
"); 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."
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME().":ext_update=".$ext_update.",taskId=".$task."
"); $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!
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."[".__LINE__."]:insert=".EXT_GET_CURR_NAME().'/'.EXT_GET_VERSION()." - INSERT!
"); 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()."
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME()."
"); // 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!
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME()." - LEFT!
"); //* 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."
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__.'['.__LINE__.':] ext_name='.$ext_name."
"); 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; } diff --git a/inc/filters.php b/inc/filters.php index a0988c9539..b282543425 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -359,7 +359,7 @@ function FILTER_CALL_HANDLER_LOGIN_FAILTURES ($data) { $content = $data; // Handle failed logins here if not in guest - //* DEBUG: */ print __FUNCTION__."(".__LINE__."):type={$data['type']},action={getAction()},what={getWhat()},lvl={$data['access_level']}
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):type={$data['type']},action={getAction()},what={getWhat()},lvl={$data['access_level']}
"); 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__."(".__LINE__."): ext_name={$data['ext_name']}
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."): ext_name={$data['ext_name']}
"); ACTIVATE_EXTENSION($data['ext_name']); } // END - if diff --git a/inc/functions.php b/inc/functions.php index db721a542e..508112789f 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -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__."(".__LINE__."):TO={$toEmail},SUBJECT={$subject}
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):TO={$toEmail},SUBJECT={$subject}
"); // 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__."(".__LINE__."):numRows=".SQL_NUMROWS($result_email)."
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):numRows=".SQL_NUMROWS($result_email)."
"); // 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__."(".__LINE__."):TO={$toEmail}
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):TO={$toEmail}
"); // 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__."(".__LINE__."):UID={$UID},template={$template},content[]=".gettype($content)."
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):UID={$UID},template={$template},content[]=".gettype($content)."
"); if (($UID > 0) && (is_array($content))) { // If nickname extension is installed, fetch nickname as well if (EXT_IS_ACTIVE('nickname')) { - //* DEBUG: */ print __FUNCTION__."(".__LINE__."):NICKNAME!
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):NICKNAME!
"); // 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__."(".__LINE__."):NO-NICK!
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):NO-NICK!
"); /// 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__."(".__LINE__."):content()=".count($content)." - PRE
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):content()=".count($content)." - PRE
"); $content = merge_array($content, SQL_FETCHARRAY($result)); - //* DEBUG: */ print __FUNCTION__."(".__LINE__."):content()=".count($content)." - AFTER
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):content()=".count($content)." - AFTER
"); // 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__."(".__LINE__."):found={$found},match={$match},set={$set}
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):found={$found},match={$match},set={$set}
"); if ($test == $match) { // Match found! - //* DEBUG: */ print __FUNCTION__."(".__LINE__."):fuzzyFound!
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):fuzzyFound!
"); $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__."(".__LINE__."):key={$key},match={$match}
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):key={$key},match={$match}
"); $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__."(".__LINE__."):match={$match}
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):match={$match}
"); $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}
\n"); + //* DEBUG: */ print("Y={$Y}
"); // Next months... $M = abs(floor($timestamp / 2628000 - $Y * 12)); - //* DEBUG: */ print("M={$M}
\n"); + //* DEBUG: */ print("M={$M}
"); // Next weeks $W = abs(floor($timestamp / 604800 - $Y * ((365 + $SWITCH / getConfig('one_day')) / 7) - ($M / 12 * (365 + $SWITCH / getConfig('one_day')) / 7))); - //* DEBUG: */ print("W={$W}
\n"); + //* DEBUG: */ print("W={$W}
"); // Next days... $D = abs(floor($timestamp / 86400 - $Y * (365 + $SWITCH / getConfig('one_day')) - ($M / 12 * (365 + $SWITCH / getConfig('one_day'))) - $W * 7)); - //* DEBUG: */ print("D={$D}
\n"); + //* DEBUG: */ print("D={$D}
"); // Next hours... $h = abs(floor($timestamp / 3600 - $Y * (365 + $SWITCH / getConfig('one_day')) * 24 - ($M / 12 * (365 + $SWITCH / getConfig('one_day')) * 24) - $W * 7 * 24 - $D * 24)); - //* DEBUG: */ print("h={$h}
\n"); + //* DEBUG: */ print("h={$h}
"); // Next minutes.. $m = abs(floor($timestamp / 60 - $Y * (365 + $SWITCH / getConfig('one_day')) * 24 * 60 - ($M / 12 * (365 + $SWITCH / getConfig('one_day')) * 24 * 60) - $W * 7 * 24 * 60 - $D * 24 * 60 - $h * 60)); - //* DEBUG: */ print("m={$m}
\n"); + //* DEBUG: */ print("m={$m}
"); // And at last seconds... $s = abs(floor($timestamp - $Y * (365 + $SWITCH / getConfig('one_day')) * 24 * 3600 - ($M / 12 * (365 + $SWITCH / getConfig('one_day')) * 24 * 3600) - $W * 7 * 24 * 3600 - $D * 24 * 3600 - $h * 3600 - $m * 60)); - //* DEBUG: */ print("s={$s}
\n"); + //* DEBUG: */ print("s={$s}
"); // 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."
\n"); + //* DEBUG: */ print("SCRIPT=" . $script."
"); 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."
\n"); + //* DEBUG: */ print("SCRIPT=" . $script."
"); 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."
\n"); + //* DEBUG: */ die("SCRIPT=" . $script."
"); 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."
"; + //* DEBUG: */ OUTPUT_HTML($URL."
"); // Compile some chars out... if ($compile === true) $URL = compileUriCode($URL, false, false, false); - //* DEBUG: */ echo $URL."
"; + //* DEBUG: */ OUTPUT_HTML($URL."
"); // Check for the extension filter if (EXT_IS_ACTIVE('filter')) { @@ -1988,7 +1988,7 @@ function generateMemberAdminActionLinks ($uid, $status = '') { foreach ($TARGETS as $tar) { $eval .= "\n"; + //* DEBUG: */ OUTPUT_HTML("*" . $tar.'/' . $status."*
"); 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).")
"; + //* DEBUG: */ OUTPUT_HTML("SHA1=" . $sha1." (".strlen($sha1).")
"); $sha1 = scrambleString($sha1); - //* DEBUG: */ echo "Scrambled=" . $sha1." (".strlen($sha1).")
"; + //* DEBUG: */ OUTPUT_HTML("Scrambled=" . $sha1." (".strlen($sha1).")
"); //* DEBUG: */ $sha1b = descrambleString($sha1); - //* DEBUG: */ echo "Descrambled=" . $sha1b." (".strlen($sha1b).")
"; + //* DEBUG: */ OUTPUT_HTML("Descrambled=" . $sha1b." (".strlen($sha1b).")
"); // Generate the password salt string $salt = substr($sha1, 0, getConfig('salt_length')); - //* DEBUG: */ echo $salt." (".strlen($salt).")
"; + //* DEBUG: */ OUTPUT_HTML($salt." (".strlen($salt).")
"); } else { // Use given salt $salt = substr($salt, 0, getConfig('salt_length')); - //* DEBUG: */ echo "GIVEN={$salt}
\n"; + //* DEBUG: */ OUTPUT_HTML("GIVEN={$salt}
"); } // Return hash @@ -2106,7 +2106,7 @@ function scrambleString($str) { } // Scramble string here - //* DEBUG: */ echo "***Original=" . $str."***
"; + //* DEBUG: */ OUTPUT_HTML("***Original=" . $str."***
"); 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."***
"; + //* DEBUG: */ OUTPUT_HTML("***Scrambled=" . $scrambled."***
"); 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."+++
"; + $orig = str_repeat(' ', 40); + //* DEBUG: */ OUTPUT_HTML("+++Scrambled=" . $str."+++
"); 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."+++
"; + //* DEBUG: */ OUTPUT_HTML("+++Original=" . $orig."+++
"); 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."*
"; + //* DEBUG: */ OUTPUT_HTML("*" . $start.'=' . $mod."*
"); $start += 4; $newHash .= $mod; } // END - for //* DEBUG: */ print($passHash."
" . $newHash." (".strlen($newHash).')'); $ret = generateHash($newHash, getConfig('master_salt')); - //* DEBUG: */ print($ret."
\n"); + //* DEBUG: */ print($ret."
"); } else { // Hash it simple - //* DEBUG: */ echo "--" . $passHash."--
\n"; + //* DEBUG: */ OUTPUT_HTML("--" . $passHash."--
"); $ret = md5($passHash); - //* DEBUG: */ echo "++" . $ret."++
\n"; + //* DEBUG: */ OUTPUT_HTML("++" . $ret."++
"); } // Return result @@ -2286,14 +2286,14 @@ function isBooleanConstantAndTrue ($constName) { // : Boolean // In cache? if (isset($GLOBALS['cache_array']['const'][$constName])) { // Use cache - //* DEBUG: */ print __FUNCTION__."(".__LINE__."): " . $constName."-CACHE!
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."): " . $constName."-CACHE!
"); $res = ($GLOBALS['cache_array']['const'][$constName] === true); } else { // Check constant - //* DEBUG: */ print __FUNCTION__."(".__LINE__."): " . $constName."-RESOLVE!
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."): " . $constName."-RESOLVE!
"); if (defined($constName)) { // Found! - //* DEBUG: */ print __FUNCTION__."(".__LINE__."): " . $constName."-FOUND!
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."): " . $constName."-FOUND!
"); $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__."(".__LINE__."):dir=" . $dir."
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):dir=" . $dir."
"); // 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__."(".__LINE__."):ds[]=".count($ds)."
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):ds[]=".count($ds)."
"); // 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__."(".__LINE__."):FQFN={$FQFN}
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):FQFN={$FQFN}
"); if (isDirectory($FQFN)) { // $FQFN is a directory so also crawl into this directory $newDir = $d; if (!empty($dir)) $newDir = $dir . '/'. $d; - //* DEBUG: */ print __FUNCTION__."(".__LINE__."):DESCENT: " . $newDir."
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):DESCENT: " . $newDir."
"); searchDirsRecursive($newDir, $last_changed); } elseif (isFileReadable($FQFN)) { // $FQFN is a filename and no directory $time = filemtime($FQFN); - //* DEBUG: */ print __FUNCTION__."(".__LINE__."):File: " . $d." found. (".($last_changed['time'] - $time).")
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):File: " . $d." found. (".($last_changed['time'] - $time).")
"); if ($last_changed['time'] < $time) { // This file is newer as the file before - //* DEBUG: */ print __FUNCTION__."(".__LINE__.") - NEWER!
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__.") - NEWER!
"); $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('.', "\.", $pat); $pat = str_replace('@', "\@", $pat); - echo $key."= " . $pat . "
"; + //* DEBUG: */ OUTPUT_HTML($key."= " . $pat . "
"); } // 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__."(".__LINE__."):accessLevel={$accessLevel}
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):accessLevel={$accessLevel}
"); $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__."(".__LINE__."): inc={$inc} - LOADED!
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."): inc={$inc} - LOADED!
"); 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 . "
\n"; + //* DEBUG: */ OUTPUT_HTML('excluded=' . $baseFile . "
"); 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 . "
\n"; - //* DEBUG: */ print 'baseFile:' . $baseFile . "
\n"; - //* DEBUG: */ print 'FQFN:' . $FQFN . "
\n"; + //* DEBUG: */ OUTPUT_HTML('baseDir:' . $baseDir . "
"); + //* DEBUG: */ OUTPUT_HTML('baseFile:' . $baseFile . "
"); + //* DEBUG: */ OUTPUT_HTML('FQFN:' . $FQFN . "
"); // Exclude this one continue; diff --git a/inc/gen_refback.php b/inc/gen_refback.php index aa7f4f420f..421bcbdde3 100644 --- a/inc/gen_refback.php +++ b/inc/gen_refback.php @@ -81,7 +81,7 @@ if (SQL_NUMROWS($result_direct) > 0) { $GLOBALS['cache_array']['back_level'] = 1; // Update refback table - //* DEBUG: */ echo "uid={$content['userid']}
\n"; + //* DEBUG: */ OUTPUT_HTML("uid={$content['userid']}
"); updateRefbackTable($content['userid']); } // END - while } // END - if diff --git a/inc/libs/admins_functions.php b/inc/libs/admins_functions.php index 77835dbec4..548affde1e 100644 --- a/inc/libs/admins_functions.php +++ b/inc/libs/admins_functions.php @@ -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}
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."[".__LINE__."]:act={$act},wht={$wht},default={$default},acl_mode={$acl_mode}
"); return $ret; } diff --git a/inc/libs/cache_functions.php b/inc/libs/cache_functions.php index a34313d1eb..53e4847e90 100644 --- a/inc/libs/cache_functions.php +++ b/inc/libs/cache_functions.php @@ -176,7 +176,7 @@ class CacheSystem { // Remove pointer $this->pointer = false; - //* DEBUG: */ print __METHOD__."(".__LINE__."): {$this->name} - FINALIZED!
\n"; + //* DEBUG: */ OUTPUT_HTML(__METHOD__."(".__LINE__."): {$this->name} - FINALIZED!
"); } // 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__."(".__LINE__."): {$this->name} - {$ext_name}={$ext_ver}
\n"; + //* DEBUG: */ OUTPUT_HTML(__METHOD__."(".__LINE__."): {$this->name} - {$ext_name}={$ext_ver}
"); } else { // Cannot create file addFatalMessage(__METHOD__, __LINE__, "(".__LINE__."): ".getMessage('CACHE_PROBLEMS_DETECTED')); @@ -398,7 +398,7 @@ class CacheSystem { // Debug messages if (isset($this->version[$this->name][$ext_name])) { - //* DEBUG: */ print __METHOD__."(".__LINE__."): cache={$this->name},ext_name={$ext_name} - {$ext_ver}/{$this->version[$this->name][$ext_name]}
\n"; + //* DEBUG: */ OUTPUT_HTML(__METHOD__."(".__LINE__."): cache={$this->name},ext_name={$ext_name} - {$ext_ver}/{$this->version[$this->name][$ext_name]}
"); } else { // No cache version found! DEBUG_LOG(__METHOD__, __LINE__, "Cache {$this->name} has missing version entry for extension {$ext_name}!"); diff --git a/inc/libs/rallye_functions.php b/inc/libs/rallye_functions.php index 998427c95f..9a7fac9ebe 100644 --- a/inc/libs/rallye_functions.php +++ b/inc/libs/rallye_functions.php @@ -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."*
\n"; + //* DEBUG: */ OUTPUT_HTML("*".$cnt.'/'.$content['userid'].'/'.$content['curr_points'].'/'.$refpoints."*
"); 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]}
\n"; + //* DEBUG: */ OUTPUT_HTML("id={$id},uid={$uid},uid={$uid},old={$old},level={$GLOBALS['cache_array']['refsystem']['level'][$id]}
"); if (($uid == $uid) && ($GLOBALS['cache_array']['refsystem']['level'][$id] == 1)) { - //* DEBUG: */ echo "uid matches!
\n"; + //* DEBUG: */ OUTPUT_HTML("uid matches!
"); 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."*
"; + //* DEBUG: */ OUTPUT_HTML("*".$uid.'/'.$cnt."*
"); break; } elseif ($level > 1) { // Not interesting here... @@ -736,17 +736,17 @@ function RALLYE_GET_REFCOUNT ($uid, $old = 0) { } // END - if } // END - foreach - //* DEBUG: */ echo "
";
-		//* DEBUG: */ print_r($GLOBALS['cache_array']['refsystem']);
-		//* DEBUG: */ echo "
"; - //* DEBUG: */ die(); + //* DEBUG: */ OUTPUT_HTML("
");
+		//* DEBUG: */ OUTPUT_HTML(print_r($GLOBALS['cache_array']['refsystem'], true));
+		//* DEBUG: */ OUTPUT_HTML("
"); + //* DEBUG: */ shutdown(); if ($cnt > 0) { // Count cache hits incrementConfigEntry('cache_hits'); // Remove old refs - //* DEBUG: */ echo '+'.$cnt.'/'.$old."+
"; + //* DEBUG: */ OUTPUT_HTML('+'.$cnt.'/'.$old."+
"); $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."*
"; + //* DEBUG: */ OUTPUT_HTML("*".$uid.'/'.$old.'/'.$cnt."*
"); return $cnt; } diff --git a/inc/libs/refback_functions.php b/inc/libs/refback_functions.php index 1ec422b907..d8fc49e0ad 100644 --- a/inc/libs/refback_functions.php +++ b/inc/libs/refback_functions.php @@ -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 "----------------------- ".__FUNCTION__." - ENTRY ------------------------
  • \n"; + //* DEBUG: */ OUTPUT_HTML("----------------------- ".__FUNCTION__." - ENTRY ------------------------
    • \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__."(".__LINE__."):uid={$uid},ref={$ref},level={$content['level']},points={$points}
      \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):uid={$uid},ref={$ref},level={$content['level']},points={$points}
      "); 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__."(".__LINE__."):uid={$uid},ref={$ref},refid={$refid},points={$points},percents={$percents}
      \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):uid={$uid},ref={$ref},refid={$refid},points={$points},percents={$percents}
      "); // Some percents given? if ($percents > 0) { - //* DEBUG: */ print __FUNCTION__."(".__LINE__."):points={$points},perc={$content['percents']},percents={$percents},level={$content['level']}
      \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):points={$points},perc={$content['percents']},percents={$percents},level={$content['level']}
      "); // 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__."(".__LINE__."):refback={$refback},uid={$uid},refid={$refid} - UPDATE! (".SQL_AFFECTEDROWS().")
      \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):refback={$refback},uid={$uid},refid={$refid} - UPDATE! (".SQL_AFFECTEDROWS().")
      "); // Add points again, but only directly - //* DEBUG: */ print __FUNCTION__."(".__LINE__."):refback={$refback}
      \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):refback={$refback}
      "); 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__."(".__LINE__."):points={$return} - REDUCED
      \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):points={$return} - REDUCED
      "); } // 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 "
    ----------------------- ".__FUNCTION__." - EXIT ------------------------
    \n"; + //* DEBUG: */ OUTPUT_HTML("
----------------------- ".__FUNCTION__." - EXIT ------------------------
"); return $return; } // "Getter" for refback percents function GET_REFBACK_PERCENTS ($uid, $ref) { - //* DEBUG: */ print "----------------------- ".__FUNCTION__." - ENTRY ------------------------
  • \n"; - //* DEBUG: */ print __FUNCTION__."(".__LINE__."):uid={$uid},ref={$ref}
    \n"; + //* DEBUG: */ OUTPUT_HTML("----------------------- ".__FUNCTION__." - ENTRY ------------------------
    • \n"); + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):uid={$uid},ref={$ref}
      "); // 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__."(".__LINE__."):percents={$percents}
      \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):percents={$percents}
      "); } else { // Debug log - //* DEBUG: */ print __FUNCTION__."(".__LINE__."): NO ENTRY FOUND! :-(
      \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."): NO ENTRY FOUND! :-(
      "); 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 "
    ----------------------- ".__FUNCTION__." - EXIT ------------------------
    \n"; + //* DEBUG: */ OUTPUT_HTML("
----------------------- ".__FUNCTION__." - EXIT ------------------------
"); return $percents; } // "Getter" for userid array which will return only one entry function GET_REFBACK_USERID_ARRAY ($rid, $level) { - //* DEBUG: */ print "----------------------- ".__FUNCTION__." - ENTRY ------------------------
  • \n"; - //* DEBUG: */ print __FUNCTION__."(".__LINE__."):rid={$rid},level={$level}
    \n"; + //* DEBUG: */ OUTPUT_HTML("----------------------- ".__FUNCTION__." - ENTRY ------------------------
    • \n"); + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):rid={$rid},level={$level}
      "); // Init userids $userIds = array(); @@ -158,11 +158,11 @@ ORDER BY array($rid,$level), __FUNCTION__, __LINE__); // Entries found? - //* DEBUG: */ print __FUNCTION__."(".__LINE__."):numRows=".SQL_NUMROWS($result)."
      \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):numRows=".SQL_NUMROWS($result)."
      "); if (SQL_NUMROWS($result) > 0) { // Add all while ($content = SQL_FETCHARRAY($result)) { - //* DEBUG: */ print __FUNCTION__."(".__LINE__."):rid={$rid},level={$level},userid={$content['userid']}
      \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):rid={$rid},level={$level},userid={$content['userid']}
      "); $userIds[] = $content['userid']; } // END - while } // END - if @@ -171,17 +171,17 @@ ORDER BY SQL_FREERESULT($result); // Return array - //* DEBUG: */ print __FUNCTION__."(".__LINE__."):rid={$rid},count()=".count($userIds)."
      \n"; - //* DEBUG: */ print "
    ----------------------- ".__FUNCTION__." - EXIT ------------------------
    \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):rid={$rid},count()=".count($userIds)."
    "); + //* DEBUG: */ OUTPUT_HTML("
----------------------- ".__FUNCTION__." - EXIT ------------------------
"); return $userIds; } // Update "refback table" function updateRefbackTable ($uid) { - //* DEBUG: */ print "----------------------- ".__FUNCTION__." - ENTRY ------------------------
  • \n"; + //* DEBUG: */ OUTPUT_HTML("----------------------- ".__FUNCTION__." - ENTRY ------------------------
    • \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__."(".__LINE__."):uid={$uid},level={$GLOBALS['cache_array']['back_level']}
      \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):uid={$uid},level={$GLOBALS['cache_array']['back_level']}
      "); // 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__."(".__LINE__."):found=".SQL_NUMROWS($result_refid)."
      \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):found=".SQL_NUMROWS($result_refid)."
      "); 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__."(".__LINE__."):uid={$uid},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]}
      \n"; // Refid set? + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):uid={$uid},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]}
      "); 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__."(".__LINE__."):uid={$uid},old={$old},level={$GLOBALS['cache_array']['back_level']},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - NEW UID!
      \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):uid={$uid},old={$old},level={$GLOBALS['cache_array']['back_level']},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - NEW UID!
      "); } // 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__."(".__LINE__."):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!
      \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):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!
      "); if (SQL_NUMROWS($result) == 0) { // Insert this level - //* DEBUG: */ print __FUNCTION__."(".__LINE__."):uid={$uid},level={$GLOBALS['cache_array']['back_level']},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - ADD!
      \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):uid={$uid},level={$GLOBALS['cache_array']['back_level']},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - ADD!
      "); 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__."(".__LINE__."):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!
      \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):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!
      "); 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__."(".__LINE__."):uid={$uid},level=".($GLOBALS['cache_array']['back_level']-$minus).",ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - RETURNED!
      \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):uid={$uid},level=".($GLOBALS['cache_array']['back_level']-$minus).",ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - RETURNED!
      "); } // 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__."(".__LINE__."):uid={$uid},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - CACHE!
      \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):uid={$uid},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - CACHE!
      "); 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__."(".__LINE__."):uid={$uid},level={$GLOBALS['cache_array']['back_level']} - LEVEL!
      \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):uid={$uid},level={$GLOBALS['cache_array']['back_level']} - LEVEL!
      "); // 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__."(".__LINE__."):uid={$uid},level={$GLOBALS['cache_array']['back_level']},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']-1]} - BACK!
      \n"; - //* DEBUG: */ print "
    ----------------------- ".__FUNCTION__." - EXIT ------------------------
    \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):uid={$uid},level={$GLOBALS['cache_array']['back_level']},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']-1]} - BACK!
    "); + //* DEBUG: */ OUTPUT_HTML("
----------------------- ".__FUNCTION__." - EXIT ------------------------
"); } // "Getter" for array for user refs in given level function GET_USER_REFS ($uid, $level) { - //* DEBUG: */ print "----------------------- ".__FUNCTION__." - ENTRY ------------------------
  • \n"; + //* DEBUG: */ OUTPUT_HTML("----------------------- ".__FUNCTION__." - ENTRY ------------------------
    • \n"); // Default is no refs and no nickname $add = ''; $refs = array(); @@ -314,13 +314,13 @@ ORDER BY SQL_FREERESULT($result); // Return result - //* DEBUG: */ print "
    ----------------------- ".__FUNCTION__." - EXIT ------------------------
    \n"; + //* DEBUG: */ OUTPUT_HTML("
----------------------- ".__FUNCTION__." - EXIT ------------------------
"); return $refs; } // "Getter" for refback entry function GET_USER_REF_ENTRY ($id) { - //* DEBUG: */ print "----------------------- ".__FUNCTION__." - ENTRY ------------------------
  • \n"; + //* DEBUG: */ OUTPUT_HTML("----------------------- ".__FUNCTION__." - ENTRY ------------------------
    • \n"); // Default data is nothing $data = array(); @@ -341,13 +341,13 @@ function GET_USER_REF_ENTRY ($id) { SQL_FREERESULT($result); // Return entry - //* DEBUG: */ print "
    ----------------------- ".__FUNCTION__." - EXIT ------------------------
    \n"; + //* DEBUG: */ OUTPUT_HTML("
----------------------- ".__FUNCTION__." - EXIT ------------------------
"); return $data; } // Update refback percents (but with some sanity-checks! function REFBACK_CHANGE_MEMBER_PERCENTS ($id, $percents) { - //* DEBUG: */ print "----------------------- ".__FUNCTION__." - ENTRY ------------------------
  • \n"; + //* DEBUG: */ OUTPUT_HTML("----------------------- ".__FUNCTION__." - ENTRY ------------------------
    • \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 "
    ----------------------- ".__FUNCTION__." - EXIT ------------------------
    \n"; + //* DEBUG: */ OUTPUT_HTML("
----------------------- ".__FUNCTION__." - EXIT ------------------------
"); return $status; } // diff --git a/inc/libs/surfbar_functions.php b/inc/libs/surfbar_functions.php index 932259cc40..08b2bd1645 100644 --- a/inc/libs/surfbar_functions.php +++ b/inc/libs/surfbar_functions.php @@ -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)", diff --git a/inc/libs/wernis_functions.php b/inc/libs/wernis_functions.php index 7c89782e87..a7ff74f1de 100644 --- a/inc/libs/wernis_functions.php +++ b/inc/libs/wernis_functions.php @@ -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}
\n"; + //* DEBUG: */ OUTPUT_HTML("mode={$mode},points={$points}
"); 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}
\n"; + //* DEBUG: */ OUTPUT_HTML("mode={$mode},points={$points}
"); return $points; } diff --git a/inc/libs/yoomedia_functions.php b/inc/libs/yoomedia_functions.php index 1e218be4c8..4ed0f57bbd 100644 --- a/inc/libs/yoomedia_functions.php +++ b/inc/libs/yoomedia_functions.php @@ -304,10 +304,10 @@ function yoomediaTranslateError ($errorCode) { $return = $GLOBALS['translation_tables']['yoomedia']['error_codes'][$errorCode]; } else { // Log missing entries - print '
';
+		DEBUG_LOG(__FUNCTION__, __LINE__, "errorCode={$errorCode}");
+		print('
');
 		debug_print_backtrace();
 		die('
'); - 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) { diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index 1353ad3d10..151cc2e578 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -111,7 +111,7 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password) { SQL_FREERESULT($result); } - //* DEBUG: */ echo "*".$data['password'].'/'.md5($password).'/'.$ret."
"; + //* DEBUG: */ OUTPUT_HTML("*".$data['password'].'/'.md5($password).'/'.$ret."
"); 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."*
\n"; + //* DEBUG: */ OUTPUT_HTML("*".$ret.','.$data['password'].','.$password.','.$salt."*
"); 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__."(".__LINE__."):".generatePassString($pass).'('.strlen($pass).")/".$password.'('.strlen($password).")
\n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):".generatePassString($pass).'('.strlen($pass).")/".$password.'('.strlen($password).")
"); // 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()."*
\n"; + //* DEBUG: */ OUTPUT_HTML(__LINE__."*".$wht.'/'.getModule().'/'.getAction().'/'.getWhat()."*
"); // 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."
"; // Return link + //* DEBUG: */ OUTPUT_HTML("a:".$title."
"); return "
".$title.""; } diff --git a/inc/modules/admin/overview-inc.php b/inc/modules/admin/overview-inc.php index 2eb662816b..152c73e0b4 100644 --- a/inc/modules/admin/overview-inc.php +++ b/inc/modules/admin/overview-inc.php @@ -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."
\n"; + //* DEBUG: */ OUTPUT_HTML($ext_name."=".$ext_ver."
"); // 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)."
\n"; + //* DEBUG: */ OUTPUT_HTML("ext={$ext_name},ver={EXT_GET_VERSION()}/".GET_EXT_VERSION($ext_name)."
"); if (EXT_GET_VERSION() > $ext_ver) { // Update the extension EXTENSION_UPDATE($ext_name, $ext_ver); diff --git a/inc/modules/admin/what-del_email.php b/inc/modules/admin/what-del_email.php index 0307be89ea..d41efd86b8 100644 --- a/inc/modules/admin/what-del_email.php +++ b/inc/modules/admin/what-del_email.php @@ -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."
\n"; + //* DEBUG: */ OUTPUT_HTML($stats_id.':'.$totalPoints.'/'.$links.'/'.$price."
"); 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."
\n"; + //* DEBUG: */ OUTPUT_HTML("PAYBACK:".$sender."
"); ADD_POINTS_REFSYSTEM('mail_deleted', $sender, $totalPoints, true, '0', false,'direct'); // Output message diff --git a/inc/modules/admin/what-list_rallyes.php b/inc/modules/admin/what-list_rallyes.php index c2ed620c93..de49279861 100644 --- a/inc/modules/admin/what-list_rallyes.php +++ b/inc/modules/admin/what-list_rallyes.php @@ -242,14 +242,14 @@ LIMIT 1", if (($content['curr_points'] > 0) && ($cnt > 0)) { $bl = ""; $br = ""; } if (($content['refs'] > 0) || ($cnt > 0)) { // Insert link to referal list - //* DEBUG: */ echo '-'.$content['userid'].'/'.$cnt.'/'.$content['refs']."-
"; + //* DEBUG: */ OUTPUT_HTML('-'.$content['userid'].'/'.$cnt.'/'.$content['refs']."-
"); $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']}
\n"; + //* DEBUG: */ OUTPUT_HTML(basename(__FILE__).":uid={$content['userid']},points={$points},opoints={$content['curr_points']}
"); // Prepare content // @TODO Rewritings: uid->userid,opoints->curr_points,old->refs in template diff --git a/inc/modules/admin/what-list_refs.php b/inc/modules/admin/what-list_refs.php index 8bfb68fe4b..08cc89941d 100644 --- a/inc/modules/admin/what-list_refs.php +++ b/inc/modules/admin/what-list_refs.php @@ -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)."
\n"; + //* DEBUG: */ OUTPUT_HTML($uid.'/'.$levels['level'].'/'.SQL_NUMROWS($result_refs)."
"); // Do we have levels? if (SQL_NUMROWS($result_refs) > 0) { diff --git a/inc/modules/admin/what-logs.php b/inc/modules/admin/what-logs.php index 49b9553395..9af39581e6 100644 --- a/inc/modules/admin/what-logs.php +++ b/inc/modules/admin/what-logs.php @@ -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("
  • ".$file."
  • "); } // END - foreach diff --git a/inc/modules/guest/action-themes.php b/inc/modules/guest/action-themes.php index 52e22c9fd9..06fba85c3a 100644 --- a/inc/modules/guest/action-themes.php +++ b/inc/modules/guest/action-themes.php @@ -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, "
    {--ADMIN_NO_THEME_INSTALLED_WARNING--}
    "); @@ -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); // ?> diff --git a/inc/modules/member/action-themes.php b/inc/modules/member/action-themes.php index 46acae9c4e..b4cdecf965 100644 --- a/inc/modules/member/action-themes.php +++ b/inc/modules/member/action-themes.php @@ -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()) { diff --git a/inc/monthly/monthly_beg.php b/inc/monthly/monthly_beg.php index 3d5396e36c..628986e0b9 100644 --- a/inc/monthly/monthly_beg.php +++ b/inc/monthly/monthly_beg.php @@ -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__)."
    \n"; +//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."
    "); // Get current month (2 digits) $curr = date('m', time()); diff --git a/inc/monthly/monthly_bonus.php b/inc/monthly/monthly_bonus.php index d18b95c6cd..cfd712948b 100644 --- a/inc/monthly/monthly_bonus.php +++ b/inc/monthly/monthly_bonus.php @@ -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__)."
    \n"; +//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."
    "); // Get current month (2 digits) $curr = date('m', time()); diff --git a/inc/monthly/monthly_newsletter.php b/inc/monthly/monthly_newsletter.php index c1108be6af..ca8e2baf42 100644 --- a/inc/monthly/monthly_newsletter.php +++ b/inc/monthly/monthly_newsletter.php @@ -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__)."
    \n"; +//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."
    "); // 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 diff --git a/inc/monthly/monthly_surfbar.php b/inc/monthly/monthly_surfbar.php index 842c23bd95..02a35f38c7 100644 --- a/inc/monthly/monthly_surfbar.php +++ b/inc/monthly/monthly_surfbar.php @@ -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__)."
    \n"; +//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."
    "); // Reset surfbar counter updateConfiguration('surfbar_monthly_counter', '0'); diff --git a/inc/mysql-connect.php b/inc/mysql-connect.php index a31a7879a7..ba583c1cc1 100644 --- a/inc/mysql-connect.php +++ b/inc/mysql-connect.php @@ -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)); diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 23f4621a6d..49962859a1 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -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."*
    "; + //* DEBUG: */ OUTPUT_HTML(__LINE__."*".count($modSplit)."*/".$mod."*
    "); if (count($modSplit) == 2) { // Okay, there is a seperator (_) in the name so is the first part a module? - //* DEBUG: */ echo __LINE__."*".$modSplit[0]."*
    "; + //* DEBUG: */ OUTPUT_HTML(__LINE__."*".$modSplit[0]."*
    "); 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 . "\n"; + //* DEBUG: */ OUTPUT_HTML(__LINE__."*".$type.'/'.getWhat()."*
    "); if (($type == 'what') || (($type == 'action') && ((!isWhatSet()) || (getWhat() == 'overview')))) { - //* DEBUG: */ echo __LINE__.'+'.$type."+
    \n"; + //* DEBUG: */ OUTPUT_HTML(__LINE__.'+'.$type."+
    "); // Add closing div and br-tag $OUT .= "
    \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()."*
    \n"; + //* DEBUG: */ OUTPUT_HTML(__LINE__.'/'.$main_cnt.'/'.$main_action.'/'.$sub_what.':'.getWhat()."*
    "); if (SQL_NUMROWS($result_main) > 0) { OUTPUT_HTML(""); // 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()."*
    \n"; + //* DEBUG: */ OUTPUT_HTML(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$sub_what.':'.getWhat()."*
    "); // 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']."!!!
    \n"; + //* DEBUG: */ OUTPUT_HTML(__LINE__.":!!!!".$content['sub_what']."!!!
    "); $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(""); } - //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*
    \n"; + //* DEBUG: */ OUTPUT_HTML(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*
    "); } $main_cnt++; - //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*
    \n"; + //* DEBUG: */ OUTPUT_HTML(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*
    "); if (SQL_NUMROWS($result_main) > $main_cnt) { OUTPUT_HTML(""); } // 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()."*
    \n"; + //* DEBUG: */ OUTPUT_HTML(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*
    "); OUTPUT_HTML("
    "); - //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*
    \n"; + //* DEBUG: */ OUTPUT_HTML(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*
    "); loadInclude($INC_BLOCK); - //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*
    \n"; + //* DEBUG: */ OUTPUT_HTML(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*
    "); if ((!EXT_IS_ACTIVE($content['action'])) || ($content['action'] == 'online')) OUTPUT_HTML("
    "); } // END - if } @@ -575,12 +575,12 @@ function IS_MEMBER () { $ret = true; } else { // Maybe got locked etc. - //* DEBUG: */ echo __LINE__."!!!
    "; + //* DEBUG: */ OUTPUT_HTML(__LINE__."!!!
    "); destroyUserSession(); } } else { // Cookie data is invalid! - //* DEBUG: */ echo __LINE__."***
    "; + //* DEBUG: */ OUTPUT_HTML(__LINE__."***
    "); destroyUserSession(); } @@ -588,7 +588,7 @@ function IS_MEMBER () { SQL_FREERESULT($result); } else { // Cookie data is invalid! - //* DEBUG: */ echo __LINE__."///
    "; + //* DEBUG: */ OUTPUT_HTML(__LINE__."///
    "); destroyUserSession(); } @@ -603,7 +603,7 @@ function IS_MEMBER () { function IS_ADMIN ($admin = '') { // Init variables $ret = false; $passCookie = ''; $valPass = ''; - //* DEBUG: */ echo __LINE__."ADMIN:".$admin."
    "; + //* DEBUG: */ OUTPUT_HTML(__LINE__."ADMIN:".$admin."
    "); // 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."
    "; + //* DEBUG: */ OUTPUT_HTML(__LINE__."ADMIN:".$admin.'/'.$passCookie."
    "); // 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."*
    \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."*".$valPass.'/'.$passCookie."*
    "); $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!
    "; + //* DEBUG: */ if (!$ret) OUTPUT_HTML(__LINE__."OK!
    "); 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."*
    \n"; + //* DEBUG: */ OUTPUT_HTML(__LINE__.':'.$mode.'/'.$act.'/'.$wht."*
    "); 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()."=
    "; + //* DEBUG: */ OUTPUT_HTML(__LINE__.'='.$mode.'/'.$wht.'/'.getAction()."=
    "); 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__."(".__LINE__."): ret=".$ret."
    \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."): ret=".$ret."
    "); // 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.'
    \n'; + //* DEBUG: */ OUTPUT_HTML($search.'/'.$tableName.'/'.$lookFor.'/'.$whereStatement.'/'.$add.'
    '); 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!
    \n"; + //* DEBUG: */ OUTPUT_HTML("COUNT!
    "); $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!
    \n"; + //* DEBUG: */ OUTPUT_HTML("SUM!
    "); $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 "----------------------- ".__FUNCTION__." - ENTRY ------------------------
    • \n"; + //* DEBUG: */ OUTPUT_HTML("----------------------- ".__FUNCTION__." - ENTRY ------------------------
      • \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__."(".__LINE__."): Referal system initialized!
        \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."): Referal system initialized!
        "); $GLOBALS['ref_level'] = 0; } else { // Increase referal level $GLOBALS['ref_level']++; - //* DEBUG: */ print __FUNCTION__."(".__LINE__."): Referal level increased. DEPTH={$GLOBALS['ref_level']}
        \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."): Referal level increased. DEPTH={$GLOBALS['ref_level']}
        "); } // 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__."(".__LINE__."):uid={$uid},numRows=".SQL_NUMROWS($result_user).",points={$points}
        \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):uid={$uid},numRows=".SQL_NUMROWS($result_user).",points={$points}
        "); 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__."(".__LINE__."):uid={$uid},points={$points},depth={$GLOBALS['ref_level']},per={$per},mode={$add_mode}
        \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):uid={$uid},points={$points},depth={$GLOBALS['ref_level']},per={$per},mode={$add_mode}
        "); // Some percents found? if ($per > 0) { // Calculate new points - //* DEBUG: */ print __FUNCTION__."(".__LINE__."):uid={$uid},points={$points},per={$per},depth={$GLOBALS['ref_level']}
        \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):uid={$uid},points={$points},per={$per},depth={$GLOBALS['ref_level']}
        "); $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__."(".__LINE__."):uid={$uid},data={$GLOBALS['cache_array']['add_uid'][$uid]},ref_points={$ref_points},depth={$GLOBALS['ref_level']} - BEFORE!
        \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):uid={$uid},data={$GLOBALS['cache_array']['add_uid'][$uid]},ref_points={$ref_points},depth={$GLOBALS['ref_level']} - BEFORE!
        "); $ref_points = ADD_REFBACK_POINTS($GLOBALS['cache_array']['add_uid'][$uid], $uid, $points, $ref_points); - //* DEBUG: */ print __FUNCTION__."(".__LINE__."):uid={$uid},data={$GLOBALS['cache_array']['add_uid'][$uid]},ref_points={$ref_points},depth={$GLOBALS['ref_level']} - AFTER!
        \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):uid={$uid},data={$GLOBALS['cache_array']['add_uid'][$uid]},ref_points={$ref_points},depth={$GLOBALS['ref_level']} - AFTER!
        "); } // END - if // Update points... SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_points` SET %s=%s+%s WHERE `userid`=%s AND ref_depth='%s' LIMIT 1", array($data, $data, $ref_points, bigintval($uid), bigintval($GLOBALS['ref_level'])), __FUNCTION__, __LINE__); - //* DEBUG: */ print __FUNCTION__."(".__LINE__."):data={$data},ref_points={$ref_points},uid={$uid},depth={$GLOBALS['ref_level']},mode={$add_mode} - UPDATE! (".SQL_AFFECTEDROWS().")
        \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):data={$data},ref_points={$ref_points},uid={$uid},depth={$GLOBALS['ref_level']},mode={$add_mode} - UPDATE! (".SQL_AFFECTEDROWS().")
        "); // No entry updated? if (SQL_AFFECTEDROWS() < 1) { // First ref in this level! :-) SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_points` (userid,ref_depth,%s) VALUES (%s,'%s',%s)", array($data, bigintval($uid), bigintval($GLOBALS['ref_level']), $ref_points), __FUNCTION__, __LINE__); - //* DEBUG: */ print __FUNCTION__."(".__LINE__."):data={$data},ref_points={$ref_points},uid={$uid},depth={$GLOBALS['ref_level']},mode={$add_mode} - INSERTED! (".SQL_AFFECTEDROWS().")
        \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):data={$data},ref_points={$ref_points},uid={$uid},depth={$GLOBALS['ref_level']},mode={$add_mode} - INSERTED! (".SQL_AFFECTEDROWS().")
        "); } // 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__."(".__LINE__."):uid={$uid},ref={$ref},points={$points} - ADVANCE!
        \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):uid={$uid},ref={$ref},points={$points} - ADVANCE!
        "); 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 "
      ----------------------- ".__FUNCTION__." - EXIT ------------------------
      \n"; + //* DEBUG: */ OUTPUT_HTML("
    ----------------------- ".__FUNCTION__." - EXIT ------------------------
    "); } // 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__."(".__LINE__."):uid={$uid},level={$GLOBALS['cache_array']['ref_level'][$uid]}
    \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):uid={$uid},level={$GLOBALS['cache_array']['ref_level'][$uid]}
    "); // 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__."(".__LINE__."):updated=".SQL_AFFECTEDROWS()."
    \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):updated=".SQL_AFFECTEDROWS()."
    "); if (SQL_AFFECTEDROWS() < 1) { // First count! SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_refsystem` (`userid`, `level`, `counter`) VALUES (%s,%s,1)", array(bigintval($uid), $GLOBALS['cache_array']['ref_level'][$uid]), __FUNCTION__, __LINE__); - //* DEBUG: */ print __FUNCTION__."(".__LINE__."):uid={$uid}
    \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):uid={$uid}
    "); } // END - if // Check for his referal @@ -1349,16 +1349,16 @@ function updateReferalCounter ($uid) { // Free memory SQL_FREERESULT($result); - //* DEBUG: */ print __FUNCTION__."(".__LINE__."):uid={$uid},ref={$ref}
    \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):uid={$uid},ref={$ref}
    "); // When he has a referal... if (($ref > 0) && ($ref != $uid)) { // Move to next referal level and count his counter one up! - //* DEBUG: */ print __FUNCTION__."(".__LINE__."):ref={$ref} - ADVANCE!
    \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):ref={$ref} - ADVANCE!
    "); $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__."(".__LINE__."):ref={$ref} - CACHE!
    \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):ref={$ref} - CACHE!
    "); rebuildCacheFiles('refsystem', 'refsystem'); } @@ -1739,7 +1739,7 @@ function getWhatFromModule ($modCheck) { // Default is empty $wht = ''; - //* DEBUG: */ echo __LINE__.'!'.$modCheck."!
    \n"; + //* DEBUG: */ OUTPUT_HTML(__LINE__.'!'.$modCheck."!
    "); switch ($modCheck) { case 'admin': $wht = 'overview'; @@ -1835,7 +1835,7 @@ function updateConfiguration ($entries, $values, $updateMode='') { // Get affected rows $affectedRows = SQL_AFFECTEDROWS(); - //* DEBUG: */ print __FUNCTION__."(".__LINE__."):entries={$entries},affectedRows={$affectedRows}
    \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):entries={$entries},affectedRows={$affectedRows}
    "); // 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 "----------------------- ".__FUNCTION__." - ENTRY ------------------------
    • \n"; + //* DEBUG: */ OUTPUT_HTML("----------------------- ".__FUNCTION__." - ENTRY ------------------------
      • \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 "
      ----------------------- ".__FUNCTION__." - EXIT ------------------------
      \n"; + //* DEBUG: */ OUTPUT_HTML("
    ----------------------- ".__FUNCTION__." - EXIT ------------------------
    "); return $refs; } diff --git a/inc/pool/pool-bonus.php b/inc/pool/pool-bonus.php index 1bc67ec2aa..6793f63f4b 100644 --- a/inc/pool/pool-bonus.php +++ b/inc/pool/pool-bonus.php @@ -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."*
    "; + //* DEBUG: */ OUTPUT_HTML("*L:".__LINE__.'/'.$uid."*
    "); $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__."
    "; + //* DEBUG: */ OUTPUT_HTML("OK!/L:".__LINE__."
    "); // 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__."
    "; + //* DEBUG: */ OUTPUT_HTML("*EXIT/L:".__LINE__."
    "); 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."+
    "; + //* DEBUG: */ OUTPUT_HTML("+MEDIA/L:".__LINE__.'/'.$P."+
    "); MEDIA_UPDATE_ENTRY(array("total_send", "bonus_send"), 'add', $P); } // END - if // Close sending system - //* DEBUG: */ echo "-L:".__LINE__.'/'.countSelection($dummy)."-
    "; + //* DEBUG: */ OUTPUT_HTML("-L:".__LINE__.'/'.countSelection($dummy)."-
    "); 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__."*
    "; + //* DEBUG: */ OUTPUT_HTML("*L:".__LINE__."*
    "); // 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__."*
    "; + //* DEBUG: */ OUTPUT_HTML("*MEDIA/L:".__LINE__."*
    "); 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__."
    ";
    -				//* DEBUG: */ print_r($dummy);
    -				//* DEBUG: */ echo "
    \n!!!
    "; + //* DEBUG: */ OUTPUT_HTML("*L:".__LINE__."
    ");
    +				//* DEBUG: */ OUTPUT_HTML(print_r($dummy, true));
    +				//* DEBUG: */ OUTPUT_HTML("
    \n!!!
    "); break; } } diff --git a/inc/pool/pool-user.php b/inc/pool/pool-user.php index 83bd61e435..c10638afb4 100644 --- a/inc/pool/pool-user.php +++ b/inc/pool/pool-user.php @@ -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)."*
    "; + //* DEBUG: */ OUTPUT_HTML("*L:".__LINE__.'/'.SQL_NUMROWS($result_user)."*
    "); 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)."!
    "; + //* DEBUG: */ OUTPUT_HTML("!L:".__LINE__.'/'.SQL_NUMROWS($result_stats)."!
    "); if (SQL_NUMROWS($result_stats) == 0) { // No entry was found, so we add him! SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_stats` (pool_id , userid, cat_id, payment_id, subject, url , max_rec , timestamp_ordered, timestamp_sstart) VALUES ('%s','%s','%s','%s','%s','%s','%s','%s' , UNIX_TIMESTAMP())", @@ -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)."!
    "; + //* DEBUG: */ OUTPUT_HTML("!L:".__LINE__.'/'.SQL_NUMROWS($result_stats)."!
    "); if (SQL_NUMROWS($result_stats) == 1) { // We got one! list($stats_id) = SQL_FETCHROW($result_stats); // Mark this user as "spammed" ;-) And place a line for him... - //* DEBUG: */ echo "?L:".__LINE__.'/'.$dummy.'/'.$key.'/'.$uid.'('.$DATA[1].")/".$DATA[0].'/'.$stats_id."?
    "; - 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."?
    "); + 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__."*
    "; + //* DEBUG: */ OUTPUT_HTML("*MEDIA/L:".__LINE__."*
    "); 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']."*
    "; + //* DEBUG: */ OUTPUT_HTML("*EXIT/L:".__LINE__.'/'.$GLOBALS['pool_cnt']."*
    "); break; case 'already': // Entry already found, but we still count one up! $GLOBALS['pool_cnt']++; - //* DEBUG: */ echo"*EXIT/L:".__LINE__.'/'.$GLOBALS['pool_cnt']."
    "; + //* DEBUG: */ OUTPUT_HTML("*EXIT/L:".__LINE__.'/'.$GLOBALS['pool_cnt']."
    "); 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]."*
    "; + //* DEBUG: */ OUTPUT_HTML("*L:".__LINE__.'/'.$GLOBALS['pool_cnt'].">=".$DATA[8].'/'.getConfig('max_send').">=".$GLOBALS['pool_cnt'].'/'.$lastSentId."!=".$DATA[0]."*
    "); 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__."*
    "; + //* DEBUG: */ OUTPUT_HTML("*MEDIA/L:".__LINE__."*
    "); MEDIA_UPDATE_ENTRY(array("total_orders", "normal_orders"), 'add', 1); } // END - if - //* DEBUG: */ echo"*EXIT/L:".__LINE__.'/'.$P."
    "; + //* DEBUG: */ OUTPUT_HTML("*EXIT/L:".__LINE__.'/'.$P."
    "); 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__."*
    "; + //* DEBUG: */ OUTPUT_HTML("*EXIT/L:".__LINE__."*
    "); break; } diff --git a/inc/reset/reset_beg.php b/inc/reset/reset_beg.php index bd04234ba5..e14cf05433 100644 --- a/inc/reset/reset_beg.php +++ b/inc/reset/reset_beg.php @@ -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__)."
    \n"; +//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."
    "); // Reset accounts $result = SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET beg_points=0.00000 WHERE beg_points > 0", diff --git a/inc/reset/reset_bonus.php b/inc/reset/reset_bonus.php index 03fabd84c8..2d2cb237bd 100644 --- a/inc/reset/reset_bonus.php +++ b/inc/reset/reset_bonus.php @@ -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__)."
    \n"; +//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."
    "); // Purge expired entries in _bonus_turbo BONUS_PURGE_EXPIRED_TURBO_BONUS(); diff --git a/inc/reset/reset_daily.php b/inc/reset/reset_daily.php index 87a9a10a63..47ae3478de 100644 --- a/inc/reset/reset_daily.php +++ b/inc/reset/reset_daily.php @@ -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__)."
    \n"; +//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."
    "); // 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)."
    \n"; +//* DEBUG: */ OUTPUT_HTML(basename(__FILE__).":payout=0;daily|numRows=".SQL_NUMROWS($result_daily)."
    "); 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']}
    \n"; + //* DEBUG: */ OUTPUT_HTML(basename(__FILE__).":uid={$content['userid']}
    "); $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)."
    \n"; + //* DEBUG: */ OUTPUT_HTML(basename(__FILE__).":payout=0;points|numRows=".SQL_NUMROWS($result_points)."
    "); if (SQL_NUMROWS($result_points) > 0) { // Ok transfer points while ($content2 = SQL_FETCHARRAY($result_points)) { // Merge both arrays $content = merge_array($content, $content2); - //* DEBUG: */ echo basename(__FILE__).":uid={$content['userid']},depth={$content['ref_depth']},locked={$content['locked_points']}
    \n"; + //* DEBUG: */ OUTPUT_HTML(basename(__FILE__).":uid={$content['userid']},depth={$content['ref_depth']},locked={$content['locked_points']}
    "); 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", diff --git a/inc/reset/reset_engine.php b/inc/reset/reset_engine.php index 0b815c9b20..0c1b2f8820 100644 --- a/inc/reset/reset_engine.php +++ b/inc/reset/reset_engine.php @@ -40,13 +40,13 @@ 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__)."
    \n"; +//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."
    "); // ?> diff --git a/inc/reset/reset_holiday.php b/inc/reset/reset_holiday.php index ce3762b754..3fd392a602 100644 --- a/inc/reset/reset_holiday.php +++ b/inc/reset/reset_holiday.php @@ -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__)."
    \n"; +//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."
    "); // Check for holidays we need to enable and send email to user $result_main = SQL_QUERY("SELECT userid, holiday_activated diff --git a/inc/reset/reset_surfbar.php b/inc/reset/reset_surfbar.php index fd5b6527ab..d44a6f60a7 100644 --- a/inc/reset/reset_surfbar.php +++ b/inc/reset/reset_surfbar.php @@ -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__)."
    \n"; +//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."
    "); // Reset surfbar counter updateConfiguration(array("surfbar_daily_counter", "surfbar_yester_counter"), array(0, getConfig('surfbar_daily_counter'))); diff --git a/inc/security.php b/inc/security.php index 1c2245aebb..19cff33338 100644 --- a/inc/security.php +++ b/inc/security.php @@ -36,11 +36,11 @@ * MA 02110-1301 USA * ************************************************************************/ -print "
    ";
    +print("
    ");
     debug_print_backtrace();
     die("
    "); -echo " +print(" Protected file ".basename($_SERVER['PHP_SELF'])." - ACCESS DENIED! @@ -65,7 +65,7 @@ echo " -\n"; +\n"); shutdown(); // ?> diff --git a/inc/session-functions.php b/inc/session-functions.php index 495c36625f..6a47b648dd 100644 --- a/inc/session-functions.php +++ b/inc/session-functions.php @@ -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)."
    \n"; + //* DEBUG: */ OUTPUT_HTML("UNSET:".$var.'='.getSession($var)."
    "); unset($_SESSION[$var]); return session_unregister($var); } elseif (("".$value."" != '') && (!isSessionVariableSet($var))) { // Set session - //* DEBUG: */ echo "SET:".$var.'='.$value."
    \n"; + //* DEBUG: */ OUTPUT_HTML("SET:".$var.'='.$value."
    "); $_SESSION[$var] = $value; return session_register($var); } elseif (!empty($value)) { // Update session - //* DEBUG: */ echo "UPDATE:".$var.'='.$value."
    \n"; + //* DEBUG: */ OUTPUT_HTML("UPDATE:".$var.'='.$value."
    "); $_SESSION[$var] = $value; return true; } // Ignored (but valid) - //* DEBUG: */ echo "IGNORED:".$var.'='.$value."
    \n"; + //* DEBUG: */ OUTPUT_HTML("IGNORED:".$var.'='.$value."
    "); return true; } // Check wether a session variable is set function isSessionVariableSet ($var) { - //* DEBUG: */ print __FUNCTION__."(".__LINE__."):var={$var}
    \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."):var={$var}
    "); 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__."(".__LINE__."): ".$var."-CACHE!
    \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."): ".$var."-CACHE!
    "); $value = $GLOBALS['cache_array']['session'][$var]; } elseif (isSessionVariableSet($var)) { // Then get it secured! - //* DEBUG: */ print __FUNCTION__."(".__LINE__."): ".$var."-RESOLVE!
    \n"; + //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(".__LINE__."): ".$var."-RESOLVE!
    "); $value = SQL_ESCAPE($_SESSION[$var]); // Cache the value diff --git a/inc/weekly/weekly_surfbar.php b/inc/weekly/weekly_surfbar.php index 7527451607..305de9010b 100644 --- a/inc/weekly/weekly_surfbar.php +++ b/inc/weekly/weekly_surfbar.php @@ -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__)."
    \n"; +//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."
    "); // Reset the surfbar counter updateConfiguration('surfbar_weekly_counter', '0'); -- 2.30.2