b.userid=%s AND b.chk_value='%s'
LIMIT 1",
array($uid, $chk), __FILE__, __LINE__);
-//* DEBUG: */ echo "uid=".$uid.",chk=".$chk." (".strlen($chk).'/'.strlen(REQUEST_GET('check')).'/'.SQL_NUMROWS($result).")<br />\n";
+//* DEBUG: */ OUTPUT_HTML("uid=".$uid.",chk=".$chk." (".strlen($chk).'/'.strlen(REQUEST_GET('check')).'/'.SQL_NUMROWS($result).")<br />");
// Prepare content
$content = array();
// Check for cache extension, cache-array and if the requested configuration is in cache
if ((isset($GLOBALS['cache_array'])) && (is_array($GLOBALS['cache_array'])) && (isset($GLOBALS['cache_array']['config'][$no])) && (is_array($GLOBALS['cache_array']['config'][$no]))) {
// Load config from cache
- //* DEBUG: */ echo gettype($GLOBALS['cache_array']['config'][$no])."<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(gettype($GLOBALS['cache_array']['config'][$no])."<br />");
foreach ($GLOBALS['cache_array']['config'][$no] as $key => $value) {
setConfigEntry($key, $value);
} // END - foreach
// Is the line found?
if ((substr($line, 0, strlen($old)) == $old) && (!isset($done[$old]))) {
// Entry found!
- //* DEBUG: */ print htmlentities($line) . " - FOUND!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(htmlentities($line) . " - FOUND!<br />");
// Eval the line...
eval($line);
} // END - if
/// ... and write it to the new config
- //* DEBUG: */ print 'function=' . $function . ',new=' . $new . ',comment=' . $comment . "<br />\n";
+ //* DEBUG: */ OUTPUT_HTML('function=' . $function . ',new=' . $new . ',comment=' . $comment . "<br />");
changeDataInFile(constant('PATH') . 'inc/cache/config-local.php', $comment, $function . "('" . $oldNew . "', \"", "\");", constant($new), 0);
- //* DEBUG: */ print "CHANGED!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("CHANGED!<br />");
// Mark it as done
$done[$old] = 1;
}
// Debug output only
- //* DEBUG: */ print htmlentities($line) . " - MySQL!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(htmlentities($line) . " - MySQL!<br />");
// Split parts so we can check them and prepare them
$parts = explode('=>', $line);
$querytimeBefore = array_sum(explode(' ', microtime()));
// Run SQL command
- //* DEBUG: */ print $sql_string."<br />\n";
+ //* DEBUG: */ OUTPUT_HTML($sql_string."<br />");
$result = mysql_query($sql_string, SQL_GET_LINK())
or addFatalMessage(__FUNCTION__, __LINE__, $F." (".$L."):".mysql_error()."<br />
Query string:<br />
".$sql_string);
- //* DEBUG: */ print __LINE__ . ': numRows=' . SQL_NUMROWS($result) . ',affected=' . SQL_AFFECTEDROWS() . "<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__LINE__ . ': numRows=' . SQL_NUMROWS($result) . ',affected=' . SQL_AFFECTEDROWS() . "<br />");
// Ending time
$querytimeAfter = array_sum(explode(' ', microtime()));
incrementConfigEntry('sql_count');
// Debug output
- //* DEBUG: */ print "Query=<pre>".$sql_string."</pre>, affected=<strong>".SQL_AFFECTEDROWS()."</strong>, numrows=<strong>".SQL_NUMROWS($result)."</strong><br />\n";
+ //* DEBUG: */ OUTPUT_HTML("Query=<pre>".$sql_string."</pre>, affected=<strong>".SQL_AFFECTEDROWS()."</strong>, numrows=<strong>".SQL_NUMROWS($result)."</strong><br />");
if ((getOutputMode() != '1') && (getOutputMode() != '-1') && (isDebugModeEnabled()) && (getConfig('DEBUG_SQL') == 'Y')) {
//
// Debugging stuff...
} // END - if
// Do we need to update cache/db counter?
- //* DEBUG: */ echo "DB=".getConfig('db_hits').",CACHE=".getConfig('cache_hits')."<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("DB=".getConfig('db_hits').",CACHE=".getConfig('cache_hits')."<br />");
if ((GET_EXT_VERSION('cache') >= '0.0.7') && (getConfig('db_hits') > 0) && (getConfig('cache_hits') > 0) && (isCacheInstanceValid())) {
// Add new hits
incrementConfigEntry('db_hits', getConfig('db_hits_run'));
return smartAddSlashes($str);
} elseif (function_exists('mysql_real_escape_string')) {
// The new and improved version
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):str={$str}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):str={$str}<br />");
return mysql_real_escape_string($str, SQL_GET_LINK());
} elseif (function_exists('mysql_escape_string')) {
// The obsolete function
// 123 4 4 3 3 4 4 32 23 4 4 3 3 4 4 321
if (((SQL_NUMROWS($result) == 0) && (strpos($sql, 'ADD') !== false)) || ((SQL_NUMROWS($result) == 1) && (strpos($sql, 'DROP') !== false))) {
// Do the query
- //* DEBUG: */ print __LINE__.':'.$sql."<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__LINE__.':'.$sql."<br />");
$result = SQL_QUERY($sql, $F, $L, false);
} // END - if
} elseif ((getConfig('_TABLE_TYPE') == 'InnoDB') && (strpos($sql, 'FULLTEXT') !== false)) {
while (strpos($columnName, ',') !== false) {
// Use last
$columnName = str_replace('`', '', $tableArray[count($tableArray) - $begin]);
- //* DEBUG: */ print __LINE__.':'.$columnName."----------------".$begin."<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__LINE__.':'.$columnName."----------------".$begin."<br />");
// Remove brackes
$columnName = str_replace('(', '', str_replace(')', '', $columnName));
- //* DEBUG: */ print __LINE__.':'.$columnName."----------------".$begin."<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__LINE__.':'.$columnName."----------------".$begin."<br />");
// Continue
$begin++;
$skip = false;
while ($content = SQL_FETCHARRAY($result)) {
// Is it found?
- //* DEBUG: */ print "<pre>".print_r($content, true)."</pre>";
+ //* DEBUG: */ OUTPUT_HTML("<pre>".print_r($content, true)."</pre>");
if (($content['Column_name'] == $columnName) || ($content['Key_name'] == $columnName)) {
// Skip this query!
//* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Skiped: %s", $sql));
// Shall we run it?
if (!$skip) {
// Send it to the SQL_QUERY() function
- //* DEBUG: */ print __LINE__.':'.$sql."<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__LINE__.':'.$sql."<br />");
$result = SQL_QUERY($sql, $F, $L, false);
} // END - if
} else {
// Other ALTER TABLE query
- //* DEBUG: */ print __LINE__.':'.$sql."<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__LINE__.':'.$sql."<br />");
$result = SQL_QUERY($sql, $F, $L, false);
}
// Set current extension name
EXT_SET_CURR_NAME($ext_name);
- //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME()." - ENTERED!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME()." - ENTERED!<br />");
// This shall never do a non-admin user or if the extension is active (already installed)
if ((!IS_ADMIN()) || (EXT_IS_ACTIVE($ext_name))) {
return false;
// When this extension is already in install/update phase, all is fine
if (EXT_IS_REGISTER_RUNNING($ext_name)) {
// Then abort here which is fine
- //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME()." - ALREADY!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME()." - ALREADY!<br />");
return true;
} // END - if
// Entry found?
if ($task > 0) {
// Try to register the extension
- //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME().":ext_update=".$ext_update.",taskId=".$task."<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME().":ext_update=".$ext_update.",taskId=".$task."<br />");
$test = REGISTER_EXTENSION($ext_update, $task, $dry_run, false);
// Reset extension name
EXT_SET_CURR_NAME($ext_name);
- //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME().':'; var_dump($test);
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME().':'); var_dump($test);
} // END - if
} elseif ($ext_ver != EXT_GET_VERSION()) {
// Ok, update this extension now
$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) {
runFilterChain('pre_extension_installed', array('dry_run' => $dry_run));
// Register extension
- //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:insert=".EXT_GET_CURR_NAME().'/'.EXT_GET_VERSION()." - INSERT!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."[".__LINE__."]:insert=".EXT_GET_CURR_NAME().'/'.EXT_GET_VERSION()." - INSERT!<br />");
SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_extensions` (ext_name, ext_active, ext_version) VALUES ('%s','%s','%s')",
array(EXT_GET_CURR_NAME(), EXT_GET_ALWAYS_ACTIVE(), EXT_GET_VERSION()), __FUNCTION__, __LINE__);
$ret = false;
}
} elseif (($task_id > 0) && (EXT_GET_CURR_NAME() != '')) {
- //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME()."<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME()."<br />");
// Remove task from system when id and extension's name is valid
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_task_system` WHERE `id`=%s AND `status`='NEW' LIMIT 1",
array(bigintval($task_id)), __FUNCTION__, __LINE__);
} // END - if
// Return status code
- //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME()." - LEFT!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME()." - LEFT!<br />");
//* DEBUG: */ var_dump($ret);
return $ret;
}
// And load SQL queries in order of version history
for ($idx = ($start + 1); $idx < count($history); $idx++) {
// Set current extension name
- //* DEBUG: */ print __FUNCTION__.'['.__LINE__.':] ext_name='.$ext_name."<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__.'['.__LINE__.':] ext_name='.$ext_name."<br />");
EXT_SET_CURR_NAME($ext_name);
// Set extension version
}
// 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;
}
$content = $data;
// Handle failed logins here if not in guest
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):type={$data['type']},action={getAction()},what={getWhat()},lvl={$data['access_level']}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):type={$data['type']},action={getAction()},what={getWhat()},lvl={$data['access_level']}<br />");
if ((($data['type'] == 'what') || ($data['type'] == 'action') && ((!isWhatSet()) || (getWhat() == 'overview') || (getWhat() == getConfig('index_home')))) && ($data['access_level'] != 'guest') && ((GET_EXT_VERSION('sql_patches') >= '0.4.7') || (GET_EXT_VERSION('admins') >= '0.7.0'))) {
// Handle failure
$content['content'] .= HANDLE_LOGIN_FAILTURES($data['access_level']);
// Is this extension always activated?
if (EXT_GET_ALWAYS_ACTIVE() == 'Y') {
// Then activate the extension
- //* DEBUG: */ echo __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ext_name={$data['ext_name']}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ext_name={$data['ext_name']}<br />");
ACTIVATE_EXTENSION($data['ext_name']);
} // END - if
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;
// The same as above... ^
outputRawCode($HTML);
- if ($newLine) echo "\n";
+ if ($newLine) print("\n");
break;
default:
// 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') {
// Send mail out to an email address
function sendEmail ($toEmail, $subject, $message, $HTML = 'N', $mailHeader = '') {
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):TO={$toEmail},SUBJECT={$subject}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):TO={$toEmail},SUBJECT={$subject}<br />");
// Compile subject line (for POINTS constant etc.)
$eval = "\$subject = decodeEntities(\"".COMPILE_CODE(smartAddSlashes($subject))."\");";
// Load email address
$result_email = SQL_QUERY_ESC("SELECT `email` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1",
array(bigintval($toEmail)), __FUNCTION__, __LINE__);
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):numRows=".SQL_NUMROWS($result_email)."<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):numRows=".SQL_NUMROWS($result_email)."<br />");
// Does the user exist?
if (SQL_NUMROWS($result_email)) {
// Is the webmaster!
$toEmail = constant('WEBMASTER');
}
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):TO={$toEmail}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):TO={$toEmail}<br />");
// Check for PHPMailer or debug-mode
if (!checkPhpMailerUsage()) {
} // END - if
// Load user's data
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):UID={$UID},template={$template},content[]=".gettype($content)."<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):UID={$UID},template={$template},content[]=".gettype($content)."<br />");
if (($UID > 0) && (is_array($content))) {
// If nickname extension is installed, fetch nickname as well
if (EXT_IS_ACTIVE('nickname')) {
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):NICKNAME!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):NICKNAME!<br />");
// Load nickname
$result = SQL_QUERY_ESC("SELECT `surname`, `family`, `gender`, `email`, `nickname` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1",
array(bigintval($UID)), __FUNCTION__, __LINE__);
} else {
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):NO-NICK!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):NO-NICK!<br />");
/// Load normal data
$result = SQL_QUERY_ESC("SELECT `surname`, `family`, `gender`, `email` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1",
array(bigintval($UID)), __FUNCTION__, __LINE__);
}
// Fetch and merge data
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):content()=".count($content)." - PRE<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):content()=".count($content)." - PRE<br />");
$content = merge_array($content, SQL_FETCHARRAY($result));
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):content()=".count($content)." - AFTER<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):content()=".count($content)." - AFTER<br />");
// Free result
SQL_FREERESULT($result);
$test = substr($found, 0, strlen($match));
// Does this entry exist?
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):found={$found},match={$match},set={$set}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):found={$found},match={$match},set={$set}<br />");
if ($test == $match) {
// Match found!
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):fuzzyFound!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):fuzzyFound!<br />");
$fuzzyFound = true;
break;
} // END - if
// Take all string elements
if ((is_string($matches[4][$key])) && (!isset($matchesFound[$match])) && (!isset($matchesFound[$key."_" . $matches[4][$key]]))) {
// Replace it in the code
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):key={$key},match={$match}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):key={$key},match={$match}<br />");
$newMatch = str_replace("[" . $matches[4][$key]."]", "['" . $matches[4][$key]."']", $match);
$code = str_replace($match, "\"." . $newMatch.".\"", $code);
$matchesFound[$key."_" . $matches[4][$key]] = 1;
$matchesFound[$match] = 1;
} elseif (!isset($matchesFound[$match])) {
// Not yet replaced!
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):match={$match}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):match={$match}<br />");
$code = str_replace($match, "\"." . $match.".\"", $code);
$matchesFound[$match] = 1;
}
// First of all years...
$Y = abs(floor($timestamp / (31536000 + $SWITCH)));
- //* DEBUG: */ print("Y={$Y}<br />\n");
+ //* DEBUG: */ print("Y={$Y}<br />");
// Next months...
$M = abs(floor($timestamp / 2628000 - $Y * 12));
- //* DEBUG: */ print("M={$M}<br />\n");
+ //* DEBUG: */ print("M={$M}<br />");
// Next weeks
$W = abs(floor($timestamp / 604800 - $Y * ((365 + $SWITCH / getConfig('one_day')) / 7) - ($M / 12 * (365 + $SWITCH / getConfig('one_day')) / 7)));
- //* DEBUG: */ print("W={$W}<br />\n");
+ //* DEBUG: */ print("W={$W}<br />");
// Next days...
$D = abs(floor($timestamp / 86400 - $Y * (365 + $SWITCH / getConfig('one_day')) - ($M / 12 * (365 + $SWITCH / getConfig('one_day'))) - $W * 7));
- //* DEBUG: */ print("D={$D}<br />\n");
+ //* DEBUG: */ print("D={$D}<br />");
// Next hours...
$h = abs(floor($timestamp / 3600 - $Y * (365 + $SWITCH / getConfig('one_day')) * 24 - ($M / 12 * (365 + $SWITCH / getConfig('one_day')) * 24) - $W * 7 * 24 - $D * 24));
- //* DEBUG: */ print("h={$h}<br />\n");
+ //* DEBUG: */ print("h={$h}<br />");
// Next minutes..
$m = abs(floor($timestamp / 60 - $Y * (365 + $SWITCH / getConfig('one_day')) * 24 * 60 - ($M / 12 * (365 + $SWITCH / getConfig('one_day')) * 24 * 60) - $W * 7 * 24 * 60 - $D * 24 * 60 - $h * 60));
- //* DEBUG: */ print("m={$m}<br />\n");
+ //* DEBUG: */ print("m={$m}<br />");
// And at last seconds...
$s = abs(floor($timestamp - $Y * (365 + $SWITCH / getConfig('one_day')) * 24 * 3600 - ($M / 12 * (365 + $SWITCH / getConfig('one_day')) * 24 * 3600) - $W * 7 * 24 * 3600 - $D * 24 * 3600 - $h * 3600 - $m * 60));
- //* DEBUG: */ print("s={$s}<br />\n");
+ //* DEBUG: */ print("s={$s}<br />");
// Is seconds zero and time is < 60 seconds?
if (($s == 0) && ($timestamp < 60)) {
if (ereg('/', $host)) $host = substr($host, 0, strpos($host, '/'));
// Generate relative URL
- //* DEBUG: */ print("SCRIPT=" . $script."<br />\n");
+ //* DEBUG: */ print("SCRIPT=" . $script."<br />");
if (substr(strtolower($script), 0, 7) == 'http://') {
// But only if http:// is in front!
$script = substr($script, (strlen($url) + 7));
$script = substr($script, (strlen($url) + 8));
}
- //* DEBUG: */ print("SCRIPT=" . $script."<br />\n");
+ //* DEBUG: */ print("SCRIPT=" . $script."<br />");
if (substr($script, 0, 1) == '/') $script = substr($script, 1);
// Return host name
} // END - if
// Open connection
- //* DEBUG: */ die("SCRIPT=" . $script."<br />\n");
+ //* DEBUG: */ die("SCRIPT=" . $script."<br />");
if ($useProxy === true) {
// Connect to host through proxy connection
$fp = @fsockopen(COMPILE_CODE(getConfig('proxy_host')), bigintval(getConfig('proxy_port')), $errno, $errdesc, 30);
function isUrlValid ($URL, $compile=true) {
// Trim URL a little
$URL = trim(urldecode($URL));
- //* DEBUG: */ echo $URL."<br />";
+ //* DEBUG: */ OUTPUT_HTML($URL."<br />");
// Compile some chars out...
if ($compile === true) $URL = compileUriCode($URL, false, false, false);
- //* DEBUG: */ echo $URL."<br />";
+ //* DEBUG: */ OUTPUT_HTML($URL."<br />");
// Check for the extension filter
if (EXT_IS_ACTIVE('filter')) {
foreach ($TARGETS as $tar) {
$eval .= "<span class=\\\"admin_user_link\\\"><a href=\\\"{!URL!}/modules.php?module=admin&what=" . $tar."&uid=" . $uid."\\\" title=\\\"{--ADMIN_LINK_";
- //* DEBUG: */ echo "*" . $tar.'/' . $status."*<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("*" . $tar.'/' . $status."*<br />");
if (($tar == "lock_user") && ($status == 'LOCKED')) {
// Locked accounts shall be unlocked
$eval .= "UNLOCK_USER";
// Generate SHA1 sum from modula of number and the prime number
$sha1 = sha1(($a % getConfig('_PRIME')) . $server.getConfig('ENCRYPT_SEPERATOR') . $keys.getConfig('ENCRYPT_SEPERATOR') . $data.getConfig('ENCRYPT_SEPERATOR').getConfig('DATE_KEY').getConfig('ENCRYPT_SEPERATOR') . $a);
- //* DEBUG: */ echo "SHA1=" . $sha1." (".strlen($sha1).")<br />";
+ //* DEBUG: */ OUTPUT_HTML("SHA1=" . $sha1." (".strlen($sha1).")<br />");
$sha1 = scrambleString($sha1);
- //* DEBUG: */ echo "Scrambled=" . $sha1." (".strlen($sha1).")<br />";
+ //* DEBUG: */ OUTPUT_HTML("Scrambled=" . $sha1." (".strlen($sha1).")<br />");
//* DEBUG: */ $sha1b = descrambleString($sha1);
- //* DEBUG: */ echo "Descrambled=" . $sha1b." (".strlen($sha1b).")<br />";
+ //* DEBUG: */ OUTPUT_HTML("Descrambled=" . $sha1b." (".strlen($sha1b).")<br />");
// Generate the password salt string
$salt = substr($sha1, 0, getConfig('salt_length'));
- //* DEBUG: */ echo $salt." (".strlen($salt).")<br />";
+ //* DEBUG: */ OUTPUT_HTML($salt." (".strlen($salt).")<br />");
} else {
// Use given salt
$salt = substr($salt, 0, getConfig('salt_length'));
- //* DEBUG: */ echo "GIVEN={$salt}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("GIVEN={$salt}<br />");
}
// Return hash
}
// Scramble string here
- //* DEBUG: */ echo "***Original=" . $str."***<br />";
+ //* DEBUG: */ OUTPUT_HTML("***Original=" . $str."***<br />");
for ($idx = 0; $idx < strlen($str); $idx++) {
// Get char on scrambled position
$char = substr($str, $scrambleNums[$idx], 1);
} // END - for
// Return scrambled string
- //* DEBUG: */ echo "***Scrambled=" . $scrambled."***<br />";
+ //* DEBUG: */ OUTPUT_HTML("***Scrambled=" . $scrambled."***<br />");
return $scrambled;
}
if (count($scrambleNums) != 40) return $str;
// Begin descrambling
- $orig = str_repeat(" ", 40);
- //* DEBUG: */ echo "+++Scrambled=" . $str."+++<br />";
+ $orig = str_repeat(' ', 40);
+ //* DEBUG: */ OUTPUT_HTML("+++Scrambled=" . $str."+++<br />");
for ($idx = 0; $idx < 40; $idx++) {
$char = substr($str, $idx, 1);
$orig = substr_replace($orig, $char, $scrambleNums[$idx], 1);
} // END - for
// Return scrambled string
- //* DEBUG: */ echo "+++Original=" . $orig."+++<br />";
+ //* DEBUG: */ OUTPUT_HTML("+++Original=" . $orig."+++<br />");
return $orig;
}
}
$mod = substr(round($mod), 0, 4);
$mod = str_repeat('0', 4-strlen($mod)) . $mod;
- //* DEBUG: */ echo "*" . $start.'=' . $mod."*<br />";
+ //* DEBUG: */ OUTPUT_HTML("*" . $start.'=' . $mod."*<br />");
$start += 4;
$newHash .= $mod;
} // END - for
//* DEBUG: */ print($passHash."<br />" . $newHash." (".strlen($newHash).')');
$ret = generateHash($newHash, getConfig('master_salt'));
- //* DEBUG: */ print($ret."<br />\n");
+ //* DEBUG: */ print($ret."<br />");
} else {
// Hash it simple
- //* DEBUG: */ echo "--" . $passHash."--<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("--" . $passHash."--<br />");
$ret = md5($passHash);
- //* DEBUG: */ echo "++" . $ret."++<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("++" . $ret."++<br />");
}
// Return result
// In cache?
if (isset($GLOBALS['cache_array']['const'][$constName])) {
// Use cache
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): " . $constName."-CACHE!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): " . $constName."-CACHE!<br />");
$res = ($GLOBALS['cache_array']['const'][$constName] === true);
} else {
// Check constant
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): " . $constName."-RESOLVE!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): " . $constName."-RESOLVE!<br />");
if (defined($constName)) {
// Found!
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): " . $constName."-FOUND!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): " . $constName."-FOUND!<br />");
$res = (constant($constName) === true);
} // END - if
// Function to search for the last modifified file
function searchDirsRecursive ($dir, &$last_changed) {
// Get dir as array
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):dir=" . $dir."<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):dir=" . $dir."<br />");
// Does it match what we are looking for? (We skip a lot files already!)
// RegexPattern to exclude ., .., .revision, .svn, debug.log or .cache in the filenames
$excludePattern = '@(\.revision|debug\.log|\.cache|config\.php)$@';
$ds = getArrayFromDirectory($dir, '', true, false, array(), '.php', $excludePattern);
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):ds[]=".count($ds)."<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):ds[]=".count($ds)."<br />");
// Walk through all entries
foreach ($ds as $d) {
$FQFN = str_replace('//', '/', constant('PATH') . $dir. '/'. $d);
// Is it a file and readable?
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):FQFN={$FQFN}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):FQFN={$FQFN}<br />");
if (isDirectory($FQFN)) {
// $FQFN is a directory so also crawl into this directory
$newDir = $d;
if (!empty($dir)) $newDir = $dir . '/'. $d;
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):DESCENT: " . $newDir."<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):DESCENT: " . $newDir."<br />");
searchDirsRecursive($newDir, $last_changed);
} elseif (isFileReadable($FQFN)) {
// $FQFN is a filename and no directory
$time = filemtime($FQFN);
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):File: " . $d." found. (".($last_changed['time'] - $time).")<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):File: " . $d." found. (".($last_changed['time'] - $time).")<br />");
if ($last_changed['time'] < $time) {
// This file is newer as the file before
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>) - NEWER!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>) - NEWER!<br />");
$last_changed['path_name'] = $FQFN;
$last_changed['time'] = $time;
} // END - if
// @TODO Are these convertions still required?
$pat = str_replace('.', "\.", $pat);
$pat = str_replace('@', "\@", $pat);
- echo $key."= " . $pat . "<br />";
+ //* DEBUG: */ OUTPUT_HTML($key."= " . $pat . "<br />");
} // END - if
// Check if expression matches
// Ignore zero values
if (getSession('mxchange_' . $accessLevel.'_failures') > 0) {
// Non-guest has login failures found, get both data and prepare it for template
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):accessLevel={$accessLevel}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):accessLevel={$accessLevel}<br />");
$content = array(
'login_failures' => getSession('mxchange_' . $accessLevel.'_failures'),
'last_failure' => generateDateTime(getSession('mxchange_' . $accessLevel.'_last_fail'), '2')
// Is the include there?
if (isIncludeReadable($INC)) {
// And rebuild it from scratch
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): inc={$inc} - LOADED!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): inc={$inc} - LOADED!<br />");
loadInclude($INC);
} else {
// Include not found!
// Exclude '.', '..' and entries in $excludeArray automatically
if (in_array($baseFile, $excludeArray, true)) {
// Exclude them
- //* DEBUG: */ print 'excluded=' . $baseFile . "<br />\n";
+ //* DEBUG: */ OUTPUT_HTML('excluded=' . $baseFile . "<br />");
continue;
} // END - if
// Check if the base filename matches an exclusion pattern and if the pattern is not empty
if ((!empty($excludePattern)) && (preg_match($excludePattern, $baseFile, $match))) {
// These Lines are only for debugging!!
- //* DEBUG: */ print 'baseDir:' . $baseDir . "<br />\n";
- //* DEBUG: */ print 'baseFile:' . $baseFile . "<br />\n";
- //* DEBUG: */ print 'FQFN:' . $FQFN . "<br />\n";
+ //* DEBUG: */ OUTPUT_HTML('baseDir:' . $baseDir . "<br />");
+ //* DEBUG: */ OUTPUT_HTML('baseFile:' . $baseFile . "<br />");
+ //* DEBUG: */ OUTPUT_HTML('FQFN:' . $FQFN . "<br />");
// Exclude this one
continue;
$GLOBALS['cache_array']['back_level'] = 1;
// Update refback table
- //* DEBUG: */ echo "uid={$content['userid']}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("uid={$content['userid']}<br />");
updateRefbackTable($content['userid']);
} // END - while
} // END - if
} // END - if
// Return value
- //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:act={$act},wht={$wht},default={$default},acl_mode={$acl_mode}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."[".__LINE__."]:act={$act},wht={$wht},default={$default},acl_mode={$acl_mode}<br />");
return $ret;
}
// Remove pointer
$this->pointer = false;
- //* DEBUG: */ print __METHOD__."(<font color=\"#0000aa\">".__LINE__."</font>): {$this->name} - FINALIZED!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__METHOD__."(<font color=\"#0000aa\">".__LINE__."</font>): {$this->name} - FINALIZED!<br />");
} // END - if
}
// Add the extension version to object (DO NOT REMOVE IT! Endless loop...)
$this->version[$this->name][$ext_name] = $ext_ver;
- //* DEBUG: */ print __METHOD__."(<font color=\"#0000aa\">".__LINE__."</font>): {$this->name} - {$ext_name}={$ext_ver}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__METHOD__."(<font color=\"#0000aa\">".__LINE__."</font>): {$this->name} - {$ext_name}={$ext_ver}<br />");
} else {
// Cannot create file
addFatalMessage(__METHOD__, __LINE__, "(<font color=\"#0000aa\">".__LINE__."</font>): ".getMessage('CACHE_PROBLEMS_DETECTED'));
// Debug messages
if (isset($this->version[$this->name][$ext_name])) {
- //* DEBUG: */ print __METHOD__."(<font color=\"#0000aa\">".__LINE__."</font>): cache={$this->name},ext_name={$ext_name} - {$ext_ver}/{$this->version[$this->name][$ext_name]}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__METHOD__."(<font color=\"#0000aa\">".__LINE__."</font>): cache={$this->name},ext_name={$ext_name} - {$ext_ver}/{$this->version[$this->name][$ext_name]}<br />");
} else {
// No cache version found!
DEBUG_LOG(__METHOD__, __LINE__, "Cache {$this->name} has missing version entry for extension {$ext_name}!");
// Init userid for list
$_uid = '---';
// List only users with at least one ref!
- //* DEBUG: */ echo "*".$cnt.'/'.$content['userid'].'/'.$content['curr_points'].'/'.$refpoints."*<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("*".$cnt.'/'.$content['userid'].'/'.$content['curr_points'].'/'.$refpoints."*<br />");
if (($cnt > 0) && ($refpoints > $content['curr_points'])) { $_uid = $content['userid']; } else { $cnt = ''; }
// Save values to array
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] = '---';
$cnt = 0;
foreach ($GLOBALS['cache_array']['refsystem']['userid'] as $id => $uid) {
// Do we have a ref for this user?
- //* DEBUG: */ echo "id={$id},uid={$uid},uid={$uid},old={$old},level={$GLOBALS['cache_array']['refsystem']['level'][$id]}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("id={$id},uid={$uid},uid={$uid},old={$old},level={$GLOBALS['cache_array']['refsystem']['level'][$id]}<br />");
if (($uid == $uid) && ($GLOBALS['cache_array']['refsystem']['level'][$id] == 1)) {
- //* DEBUG: */ echo "uid matches!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("uid matches!<br />");
foreach ($GLOBALS['cache_array']['ref_depths']['level'] as $level) {
if (($level == $GLOBALS['cache_array']['refsystem']['level'][$id]) && ($level == 1)) {
// Level does exist so abort here
$cnt = $GLOBALS['cache_array']['refsystem']['counter'][$id];
- //* DEBUG: */ echo "*".$uid.'/'.$cnt."*<br />";
+ //* DEBUG: */ OUTPUT_HTML("*".$uid.'/'.$cnt."*<br />");
break;
} elseif ($level > 1) {
// Not interesting here...
} // END - if
} // END - foreach
- //* DEBUG: */ echo "<pre>";
- //* DEBUG: */ print_r($GLOBALS['cache_array']['refsystem']);
- //* DEBUG: */ echo "</pre>";
- //* DEBUG: */ die();
+ //* DEBUG: */ OUTPUT_HTML("<pre>");
+ //* DEBUG: */ OUTPUT_HTML(print_r($GLOBALS['cache_array']['refsystem'], true));
+ //* DEBUG: */ OUTPUT_HTML("</pre>");
+ //* DEBUG: */ shutdown();
if ($cnt > 0) {
// Count cache hits
incrementConfigEntry('cache_hits');
// Remove old refs
- //* DEBUG: */ echo '+'.$cnt.'/'.$old."+<br />";
+ //* DEBUG: */ OUTPUT_HTML('+'.$cnt.'/'.$old."+<br />");
$cnt -= $old;
} // END - if
} else {
}
// Return count
- //* DEBUG: */ echo "*".$uid.'/'.$old.'/'.$cnt."*<br />";
+ //* DEBUG: */ OUTPUT_HTML("*".$uid.'/'.$old.'/'.$cnt."*<br />");
return $cnt;
}
// Payback refback for refid and reduce it for current user
function ADD_REFBACK_POINTS ($uid, $ref, $points, $ref_points) {
- //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
+ //* DEBUG: */ OUTPUT_HTML("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
// Back ref depths
$GLOBALS['cache_array']['depth'][$uid][$ref] = $GLOBALS['ref_level'];
unset($GLOBALS['ref_level']);
// "Walk" through all refids
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref},level={$content['level']},points={$points}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref},level={$content['level']},points={$points}<br />");
foreach (GET_REFBACK_USERID_ARRAY($uid, $content['level']) as $refid) {
// Skip level zero or if both are the same
if ($uid == $refid) continue;
// Get refback percents
$percents = GET_REFBACK_PERCENTS($uid, $refid);
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref},refid={$refid},points={$points},percents={$percents}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref},refid={$refid},points={$points},percents={$percents}<br />");
// Some percents given?
if ($percents > 0) {
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):points={$points},perc={$content['percents']},percents={$percents},level={$content['level']}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):points={$points},perc={$content['percents']},percents={$percents},level={$content['level']}<br />");
// Calculate points for refback
$refback = $points * ($content['percents'] / 100) * ($percents / 100);
// Update refback table ("refid" and "uid" must be exchanged!)
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_refs` SET points=points+%s WHERE `userid`=%s AND refid=%s LIMIT 1",
array($refback, $refid, $uid), __FUNCTION__, __LINE__);
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):refback={$refback},uid={$uid},refid={$refid} - UPDATE! (".SQL_AFFECTEDROWS().")<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):refback={$refback},uid={$uid},refid={$refid} - UPDATE! (".SQL_AFFECTEDROWS().")<br />");
// Add points again, but only directly
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):refback={$refback}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):refback={$refback}<br />");
ADD_POINTS_REFSYSTEM_DIRECT(sprintf("refback:%s", $refid), $uid, $refback);
// Reduce points if refid is found
if ($refid == $ref) {
// Reduce points here!
$return = $points * ($content['percents'] / 100) - $refback;
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):points={$return} - REDUCED<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):points={$return} - REDUCED<br />");
} // END - if
} // END - if
} // END foreach
$GLOBALS['ref_level'] = $GLOBALS['cache_array']['depth'][$uid][$ref];
// Return them
- //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
return $return;
}
// "Getter" for refback percents
function GET_REFBACK_PERCENTS ($uid, $ref) {
- //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref}<br />");
// Skip identical ids
if ($uid == $ref) return 0;
if (SQL_NUMROWS($result) == 1) {
// Fetch percents
list($percents) = SQL_FETCHROW($result);
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):percents={$percents}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):percents={$percents}<br />");
} else {
// Debug log
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): NO ENTRY FOUND! :-(<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): NO ENTRY FOUND! :-(<br />");
DEBUG_LOG(__FUNCTION__, __LINE__, "uid={$uid},ref={$ref} - No entry found! :-(");
}
SQL_FREERESULT($result);
// Return percents
- //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
return $percents;
}
// "Getter" for userid array which will return only one entry
function GET_REFBACK_USERID_ARRAY ($rid, $level) {
- //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):rid={$rid},level={$level}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):rid={$rid},level={$level}<br />");
// Init userids
$userIds = array();
array($rid,$level), __FUNCTION__, __LINE__);
// Entries found?
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):numRows=".SQL_NUMROWS($result)."<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):numRows=".SQL_NUMROWS($result)."<br />");
if (SQL_NUMROWS($result) > 0) {
// Add all
while ($content = SQL_FETCHARRAY($result)) {
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):rid={$rid},level={$level},userid={$content['userid']}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):rid={$rid},level={$level},userid={$content['userid']}<br />");
$userIds[] = $content['userid'];
} // END - while
} // END - if
SQL_FREERESULT($result);
// Return array
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):rid={$rid},count()=".count($userIds)."<br />\n";
- //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):rid={$rid},count()=".count($userIds)."<br />");
+ //* DEBUG: */ OUTPUT_HTML("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
return $userIds;
}
// Update "refback table"
function updateRefbackTable ($uid) {
- //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
+ //* DEBUG: */ OUTPUT_HTML("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
// Make it sure referal level zero (member him-/herself) is at least selected
if (empty($GLOBALS['cache_array']['back_level'])) $GLOBALS['cache_array']['back_level'] = 1;
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['back_level']}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['back_level']}<br />");
// Init refid
$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']] = 0;
array(bigintval($uid)), __FUNCTION__, __LINE__);
// When no entry was updated then we have to create it here
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):found=".SQL_NUMROWS($result_refid)."<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):found=".SQL_NUMROWS($result_refid)."<br />");
if (SQL_NUMROWS($result_refid) > 0) {
// Load all refids
while (list($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]) = SQL_FETCHROW($result_refid)) {
// Remmber userid
$GLOBALS['cache_array']['up_userid'][$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]] = $uid;
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]}<br />\n";
// Refid set?
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]}<br />");
if (($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']] > 0) && ($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']] != $uid) && (isset($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]))) {
// New userid?
if ((isset($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']-1])) && (isset($GLOBALS['cache_array']['up_userid'][$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']-1]]))) {
$old = $uid;
$uid = $GLOBALS['cache_array']['up_userid'][$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']-1]];
$minus = 1;
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},old={$old},level={$GLOBALS['cache_array']['back_level']},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - NEW UID!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},old={$old},level={$GLOBALS['cache_array']['back_level']},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - NEW UID!<br />");
} // END - if
// Check existence
array(bigintval($uid), $GLOBALS['cache_array']['back_level'], bigintval($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']])), __FUNCTION__, __LINE__);
// Do we have no entry?
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['back_level']},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]},minus={$minus},numRows=".SQL_NUMROWS($result)." - FOUND!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['back_level']},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]},minus={$minus},numRows=".SQL_NUMROWS($result)." - FOUND!<br />");
if (SQL_NUMROWS($result) == 0) {
// Insert this level
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['back_level']},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - ADD!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['back_level']},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - ADD!<br />");
SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_refs` (`userid`,`level`,`refid`) VALUES (%s,%s,%s)",
array(bigintval($uid), $GLOBALS['cache_array']['back_level'], bigintval($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']])), __FUNCTION__, __LINE__);
array(bigintval($uid), ($GLOBALS['cache_array']['back_level']-$minus), bigintval($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']])), __FUNCTION__, __LINE__);
// Do we have no entry?
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level=".($GLOBALS['cache_array']['back_level']-$minus).",ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]},numRows=".SQL_NUMROWS($result)." - BACK!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level=".($GLOBALS['cache_array']['back_level']-$minus).",ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]},numRows=".SQL_NUMROWS($result)." - BACK!<br />");
if (SQL_NUMROWS($result) == 0) {
// Insert this level
SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_refs` (`userid`,`level`,`refid`) VALUES (%s,%s,%s)",
array(bigintval($uid), ($GLOBALS['cache_array']['back_level']-$minus), bigintval($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']])), __FUNCTION__, __LINE__);
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level=".($GLOBALS['cache_array']['back_level']-$minus).",ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - RETURNED!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level=".($GLOBALS['cache_array']['back_level']-$minus).",ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - RETURNED!<br />");
} // END - if
} // END - if
} // END - if
// When he has a referal...
if ((($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']] == $uid) || ($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']] == 0)) && (GET_EXT_VERSION('cache') >= '0.1.2') && (!isset($GLOBALS['cache_array']['back_cached']))) {
// Remove cache here
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - CACHE!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - CACHE!<br />");
if ($GLOBALS['cache_instance']->loadCacheFile('refback')) $GLOBALS['cache_instance']->destroyCacheFile();
$GLOBALS['cache_array']['back_cached'] = 1;
} // END - if
// "Walk" back here
$GLOBALS['cache_array']['back_level']--;
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['back_level']} - LEVEL!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['back_level']} - LEVEL!<br />");
// Fix empty refid
if (!isset($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']-1])) $GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']-1] = 0;
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['back_level']},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']-1]} - BACK!<br />\n";
- //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['back_level']},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']-1]} - BACK!<br />");
+ //* DEBUG: */ OUTPUT_HTML("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
}
// "Getter" for array for user refs in given level
function GET_USER_REFS ($uid, $level) {
- //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
+ //* DEBUG: */ OUTPUT_HTML("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
// Default is no refs and no nickname
$add = '';
$refs = array();
SQL_FREERESULT($result);
// Return result
- //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
return $refs;
}
// "Getter" for refback entry
function GET_USER_REF_ENTRY ($id) {
- //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
+ //* DEBUG: */ OUTPUT_HTML("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
// Default data is nothing
$data = array();
SQL_FREERESULT($result);
// Return entry
- //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
return $data;
}
// Update refback percents (but with some sanity-checks!
function REFBACK_CHANGE_MEMBER_PERCENTS ($id, $percents) {
- //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
+ //* DEBUG: */ OUTPUT_HTML("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
// Default status is failed
$status['message'] = getMessage('MEMBER_REFBACK_ERROR_GENERAL');
// 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;
$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) {
);
// Load member email template
- $mail = LOAD_EMAIL_TEMPLATE("member_refback", $content, getUserId());
+ $mail = LOAD_EMAIL_TEMPLATE('member_refback', $content, getUserId());
// Send email to user
sendEmail($dummy['refid'], getMessage('MEMBER_REFBACK_SUBJECT'), $mail);
// Send admin notification
- sendAdminNotification(getMessage('ADMIN_REFBACK_SUBJECT'), "admin_refback", $content, getUserId());
+ sendAdminNotification(getMessage('ADMIN_REFBACK_SUBJECT'), 'admin_refback', $content, getUserId());
// All fine!
$status['ok'] = true;
// Return status array
- //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
return $status;
}
//
// 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)",
// Take fees and factor
function WERNIS_TAKE_FEE ($points, $mode) {
// Payout or withdraw are allowed modes!
- //* DEBUG: */ echo "mode={$mode},points={$points}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("mode={$mode},points={$points}<br />");
if (!in_array($mode, array('payout', 'withdraw'))) {
// Log error and abort
DEBUG_LOG(__FUNCTION__, __LINE__, "uid={getUserId()},mode={$mode},points={$points}");
}
// Return value
- //* DEBUG: */ echo "mode={$mode},points={$points}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("mode={$mode},points={$points}<br />");
return $points;
}
$return = $GLOBALS['translation_tables']['yoomedia']['error_codes'][$errorCode];
} else {
// Log missing entries
- print '<pre>';
+ DEBUG_LOG(__FUNCTION__, __LINE__, "errorCode={$errorCode}");
+ print('<pre>');
debug_print_backtrace();
die('</pre>');
- DEBUG_LOG(__FUNCTION__, __LINE__, "errorCode={$errorCode}");
}
// Return value
// 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) {
SQL_FREERESULT($result);
}
- //* DEBUG: */ echo "*".$data['password'].'/'.md5($password).'/'.$ret."<br />";
+ //* DEBUG: */ OUTPUT_HTML("*".$data['password'].'/'.md5($password).'/'.$ret."<br />");
if ((isset($data['password'])) && (strlen($data['password']) == 32) && ($data['password'] == md5($password))) {
// Generate new hash
$data['password'] = generateHash($password);
$salt = __SALT;
// Check if password is same
- //* DEBUG: */ echo "*".$ret.','.$data['password'].','.$password.','.$salt."*<br >\n";
+ //* DEBUG: */ OUTPUT_HTML("*".$ret.','.$data['password'].','.$password.','.$salt."*<br />");
if (($ret == 'pass') && ($data['password'] == generateHash($password, $salt)) && ((!empty($salt))) || ($data['password'] == $password)) {
// Re-hash the plain passord with new random salt
$data['password'] = generateHash($password);
$pass = GET_ADMIN_HASH(GET_ADMIN_ID($admin_login));
if ($pass != '-1') $ret = 'pass';
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):".generatePassString($pass).'('.strlen($pass).")/".$password.'('.strlen($password).")<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):".generatePassString($pass).'('.strlen($pass).")/".$password.'('.strlen($password).")<br />");
// Check if password matches
if (($ret == 'pass') && ((generatePassString($pass) == $password) || ($pass == $password) || ((strlen($pass) == 32) && (md5($password) == $pass)))) {
//
function ADMIN_DO_ACTION ($wht) {
global $DATA;
- //* DEBUG: */ echo __LINE__."*".$wht.'/'.getModule().'/'.getAction().'/'.getWhat()."*<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__LINE__."*".$wht.'/'.getModule().'/'.getAction().'/'.getWhat()."*<br />");
// Remove any spaces from variable
if (empty($wht)) {
}
// Creates a user-profile link for the admin. This function can also be used for many other purposes
-function generateUserProfileLink ($uid, $title = '', $wht="list_user") {
+function generateUserProfileLink ($uid, $title = '', $wht = 'list_user') {
if (($title == '') && ($title != '0')) {
// Set userid as title
$title = $uid;
} // END - if
- if (($title == '0') && ($wht == "list_refs")) {
+ if (($title == '0') && ($wht == 'list_refs')) {
// Return title again
return $title;
} // END - if
- //* DEBUG: */ echo "a:".$title."<br />";
// Return link
+ //* DEBUG: */ OUTPUT_HTML("a:".$title."<br />");
return "<a href=\"{!URL!}/modules.php?module=admin&what=".$wht."&uid=".$uid."\" title=\"{--ADMIN_USER_PROFILE_TITLE--}\">".$title."</a>";
}
// Check if extension is installed or not
$ext_ver = GET_EXT_VERSION($ext_name);
- //* DEBUG: */ echo $ext_name."=".$ext_ver."<br />\n";
+ //* DEBUG: */ OUTPUT_HTML($ext_name."=".$ext_ver."<br />");
// Is the extension not yet installed?
if (empty($ext_ver)) {
require(sprintf("%sinc/extensions/ext-%s.php", constant('PATH'), $ext_name));
// Update extension if extension is installed and outdated
- //* DEBUG: */ print "ext={$ext_name},ver={EXT_GET_VERSION()}/".GET_EXT_VERSION($ext_name)."<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("ext={$ext_name},ver={EXT_GET_VERSION()}/".GET_EXT_VERSION($ext_name)."<br />");
if (EXT_GET_VERSION() > $ext_ver) {
// Update the extension
EXTENSION_UPDATE($ext_name, $ext_ver);
// Shall we pay the points back to the user?
if (getConfig('repay_deleted_mails') != 'SHRED') {
- //* DEBUG: */ echo $stats_id.':'.$totalPoints.'/'.$links.'/'.$price."<br />\n";
+ //* DEBUG: */ OUTPUT_HTML($stats_id.':'.$totalPoints.'/'.$links.'/'.$price."<br />");
if ($totalPoints > 0) {
// Shall we payback to user or jackpot?
if (getConfig('repay_deleted_mails') == 'JACKPOT') {
} // END - if
// Pay back points
- //* DEBUG: */ echo "PAYBACK:".$sender."<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("PAYBACK:".$sender."<br />");
ADD_POINTS_REFSYSTEM('mail_deleted', $sender, $totalPoints, true, '0', false,'direct');
// Output message
if (($content['curr_points'] > 0) && ($cnt > 0)) { $bl = "<strong>"; $br = "</strong>"; }
if (($content['refs'] > 0) || ($cnt > 0)) {
// Insert link to referal list
- //* DEBUG: */ echo '-'.$content['userid'].'/'.$cnt.'/'.$content['refs']."-<br />";
+ //* DEBUG: */ OUTPUT_HTML('-'.$content['userid'].'/'.$cnt.'/'.$content['refs']."-<br />");
$cnt = generateUserProfileLink($content['userid'], $cnt, 'list_refs');
$content['refs'] = generateUserProfileLink($content['userid'], $content['refs'], 'list_refs');
} // END - if
// Get user points
$points = GET_TOTAL_DATA($content['userid'], 'user_points', 'points', 'userid', false, " AND `ref_depth`=1 LIMIT 1");
- //* DEBUG: */ echo basename(__FILE__).":uid={$content['userid']},points={$points},opoints={$content['curr_points']}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(basename(__FILE__).":uid={$content['userid']},points={$points},opoints={$content['curr_points']}<br />");
// Prepare content
// @TODO Rewritings: uid->userid,opoints->curr_points,old->refs in template
// Load all refs of this user
$result_refs = SQL_QUERY_ESC("SELECT `refid` FROM `{!_MYSQL_PREFIX!}_user_refs` WHERE `userid`=%s AND `level`='%s' ORDER BY refid ASC",
array($uid, $levels['level']), __FILE__, __LINE__);
- //* DEBUG: */ echo $uid.'/'.$levels['level'].'/'.SQL_NUMROWS($result_refs)."<br />\n";
+ //* DEBUG: */ OUTPUT_HTML($uid.'/'.$levels['level'].'/'.SQL_NUMROWS($result_refs)."<br />");
// Do we have levels?
if (SQL_NUMROWS($result_refs) > 0) {
// Cut dirname away
$file = basename($file);
- // Okay, let us print it out
+ // Okay, add it
OUTPUT_HTML("<li><a href=\"{!URL!}/modules.php?module=admin&what=".getWhat()."&access=".urlencode($file)."\">".$file."</a></li>");
} // END - foreach
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
if (isActionSet()) $act = getAction();
$OUT = generateThemeSelectionBox('index', $act, getWhat(), $result_themes);
} elseif (($num_themes == 1) || ((!IS_ADMIN()) && ($num_themes == 0))) {
- // If there's only one just print it's name
+ // If there's only one just output it's name
define('__THEME_NAME', getCurrentThemeName());
- $OUT = LOAD_TEMPLATE("theme_one", true);
+ $OUT = LOAD_TEMPLATE('theme_one', true);
} elseif (IS_ADMIN()) {
// If there is no theme installed and there's an admin notify him!
$OUT = LOAD_TEMPLATE('admin_settings_saved', true, "<div class=\"admin_note\">{--ADMIN_NO_THEME_INSTALLED_WARNING--}</div>");
SQL_FREERESULT($result_themes);
// Load final box template
-LOAD_TEMPLATE("theme_select_box", false, $OUT);
+LOAD_TEMPLATE('theme_select_box', false, $OUT);
//
?>
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
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()) {
// Do not execute when script is in CSS mode or no daily reset
if ((getOutputMode() == 1) || (!isResetModeEnabled()) || (getConfig('beg_rallye') != 'Y')) return;
-//* DEBUG: */ echo basename(__FILE__)."<br />\n";
+//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."<br />");
// Get current month (2 digits)
$curr = date('m', time());
// Do not execute when script is in CSS mode or no daily reset
if ((getOutputMode() == 1) || (!isResetModeEnabled())) return;
-//* DEBUG: */ echo basename(__FILE__)."<br />\n";
+//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."<br />");
// Get current month (2 digits)
$curr = date('m', time());
// Do not execute when script is in CSS mode or no daily reset
if ((getOutputMode() == 1) || (!isResetModeEnabled())) return;
-//* DEBUG: */ echo basename(__FILE__)."<br />\n";
+//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."<br />");
// Get current month (2 digits)
$curr = date('m', time());
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
// Do not execute when script is in CSS mode or no daily reset
if ((getOutputMode() == 1) || (!isResetModeEnabled())) return;
-//* DEBUG: */ echo basename(__FILE__)."<br />\n";
+//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."<br />");
// Reset surfbar counter
updateConfiguration('surfbar_monthly_counter', '0');
// 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));
// Check for prefix is a extension...
$modSplit = explode("_", $mod);
$extension = ''; $mod_chk = $mod;
- //* DEBUG: */ echo __LINE__."*".count($modSplit)."*/".$mod."*<br />";
+ //* DEBUG: */ OUTPUT_HTML(__LINE__."*".count($modSplit)."*/".$mod."*<br />");
if (count($modSplit) == 2) {
// Okay, there is a seperator (_) in the name so is the first part a module?
- //* DEBUG: */ echo __LINE__."*".$modSplit[0]."*<br />";
+ //* DEBUG: */ OUTPUT_HTML(__LINE__."*".$modSplit[0]."*<br />");
if (EXT_IS_ACTIVE($modSplit[0])) {
// The prefix is an extension's name, so let's set it
$extension = $modSplit[0]; $mod = $modSplit[1];
$OUT = $prefix . "<strong><a class=\"you_are_here\" href=\"{!URL!}/modules.php?module=" . $modCheck . '&' . $type . '=' . $search.$LINK_ADD . "\">" . $ret . "</a></strong>\n";
// Can we close the you-are-here navigation?
- //* DEBUG: */ echo __LINE__."*".$type.'/'.getWhat()."*<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__LINE__."*".$type.'/'.getWhat()."*<br />");
if (($type == 'what') || (($type == 'action') && ((!isWhatSet()) || (getWhat() == 'overview')))) {
- //* DEBUG: */ echo __LINE__.'+'.$type."+<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__LINE__.'+'.$type."+<br />");
// Add closing div and br-tag
$OUT .= "</div><br />\n";
$GLOBALS['nav_depth'] = '0';
// Load SQL data and add the menu to the output stream...
$result_main = SQL_QUERY_ESC("SELECT `title`, `action` FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE (`what`='' OR `what` IS NULL)".$AND." ORDER BY `sort` ASC",
array($mode), __FUNCTION__, __LINE__);
- //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$main_action.'/'.$sub_what.':'.getWhat()."*<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__LINE__.'/'.$main_cnt.'/'.$main_action.'/'.$sub_what.':'.getWhat()."*<br />");
if (SQL_NUMROWS($result_main) > 0) {
OUTPUT_HTML("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"".$mode."_menu\">");
// There are menus available, so we simply display them... :)
while ($content = SQL_FETCHARRAY($result_main)) {
- //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$sub_what.':'.getWhat()."*<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$sub_what.':'.getWhat()."*<br />");
// Init variables
enableBlockMode(false);
$act = $content['action'];
$OUT = '';
// Full file name for checking menu
- //* DEBUG: */ echo __LINE__.":!!!!".$content['sub_what']."!!!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__LINE__.":!!!!".$content['sub_what']."!!!<br />");
$INC = sprintf("inc/modules/%s/what-%s.php", $mode, $content['sub_what']);
if (isIncludeReadable($INC)) {
if ((!empty($wht)) && (($wht == $content['sub_what']))) {
if ((!EXT_IS_ACTIVE($content['action'])) || ($content['action'] == 'online')) OUTPUT_HTML("<tr>
<td class=\"".$mode."_menu_whats\">");
- //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />");
loadInclude($INC_BLOCK);
- //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />");
if ((!EXT_IS_ACTIVE($content['action'])) || ($content['action'] == 'online')) OUTPUT_HTML(" </td>
</tr>");
}
- //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />");
}
$main_cnt++;
- //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />");
if (SQL_NUMROWS($result_main) > $main_cnt) {
OUTPUT_HTML("<tr><td class=\"".$mode."_menu_seperator\"></td></tr>");
} // END - if
SQL_FREERESULT($result_main);
// Close table
- //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />");
OUTPUT_HTML("</table>");
} // END - if
}
$ret = true;
} else {
// Maybe got locked etc.
- //* DEBUG: */ echo __LINE__."!!!<br />";
+ //* DEBUG: */ OUTPUT_HTML(__LINE__."!!!<br />");
destroyUserSession();
}
} else {
// Cookie data is invalid!
- //* DEBUG: */ echo __LINE__."***<br />";
+ //* DEBUG: */ OUTPUT_HTML(__LINE__."***<br />");
destroyUserSession();
}
SQL_FREERESULT($result);
} else {
// Cookie data is invalid!
- //* DEBUG: */ echo __LINE__."///<br />";
+ //* DEBUG: */ OUTPUT_HTML(__LINE__."///<br />");
destroyUserSession();
}
function IS_ADMIN ($admin = '') {
// Init variables
$ret = false; $passCookie = ''; $valPass = '';
- //* DEBUG: */ echo __LINE__."ADMIN:".$admin."<br />";
+ //* DEBUG: */ OUTPUT_HTML(__LINE__."ADMIN:".$admin."<br />");
// If admin login is not given take current from cookies...
if ((empty($admin)) && (isSessionVariableSet('admin_login')) && (isSessionVariableSet('admin_md5'))) {
$admin = getSession('admin_login');
$passCookie = getSession('admin_md5');
}
- //* DEBUG: */ echo __LINE__."ADMIN:".$admin.'/'.$passCookie."<br />";
+ //* DEBUG: */ OUTPUT_HTML(__LINE__."ADMIN:".$admin.'/'.$passCookie."<br />");
// Search in array for entry
if (isset($GLOBALS['cache_array']['admin_hash'])) {
if (!empty($valPass)) {
// Check if password is valid
- //* DEBUG: */ print __FUNCTION__."*".$valPass.'/'.$passCookie."*<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."*".$valPass.'/'.$passCookie."*<br />");
$ret = (($valPass == $passCookie) || ((strlen($valPass) == 32) && ($valPass == md5($passCookie))) || (($valPass == "*FAILED*") && (!EXT_IS_ACTIVE('cache'))));
} // END - if
// Return result of comparision
- //* DEBUG: */ if (!$ret) echo __LINE__."OK!<br />";
+ //* DEBUG: */ if (!$ret) OUTPUT_HTML(__LINE__."OK!<br />");
return $ret;
}
$add = '';
if ((!IS_ADMIN()) && ($mode != 'admin')) $add = " AND `locked`='N'";
- //* DEBUG: */ echo __LINE__.':'.$mode.'/'.$act.'/'.$wht."*<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__LINE__.':'.$mode.'/'.$act.'/'.$wht."*<br />");
if (($mode != 'admin') && ($UPDATE === true)) {
// Update guest or member menu
$sql = SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_%s_menu` SET counter=counter+1 WHERE `action`='%s' AND `what`='%s'".$add." LIMIT 1",
// Init status
$ret = '';
- //* DEBUG: */ echo __LINE__.'='.$mode.'/'.$wht.'/'.getAction()."=<br />";
+ //* DEBUG: */ OUTPUT_HTML(__LINE__.'='.$mode.'/'.$wht.'/'.getAction()."=<br />");
if ((empty($wht)) && ($mode != 'admin')) {
$wht = 'welcome';
if (getConfig('index_home') != '') $wht = getConfig('index_home');
// Get it directly from URL
return getAction();
}
- //* DEBUG: */ echo __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ret=".$ret."<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ret=".$ret."<br />");
// Does the module have a menu?
if (MODULE_HAS_MENU($mode)) {
// Calculate sum (default) or count records of given criteria
function GET_TOTAL_DATA ($search, $tableName, $lookFor = 'id', $whereStatement = 'userid', $countRows = false, $add = '') {
$ret = 0;
- //* DEBUG: */ echo $search.'/'.$tableName.'/'.$lookFor.'/'.$whereStatement.'/'.$add.'<br />\n';
+ //* DEBUG: */ OUTPUT_HTML($search.'/'.$tableName.'/'.$lookFor.'/'.$whereStatement.'/'.$add.'<br />');
if ((empty($search)) && ($search != '0')) {
// Count or sum whole table?
if ($countRows === true) {
}
} elseif (($countRows === true) || ($lookFor == 'userid')) {
// Count rows
- //* DEBUG: */ echo "COUNT!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("COUNT!<br />");
$result = SQL_QUERY_ESC("SELECT COUNT(`%s`) FROM `{!_MYSQL_PREFIX!}_%s` WHERE `%s`='%s'".$add,
array($lookFor, $tableName, $whereStatement, $search), __FUNCTION__, __LINE__);
} else {
// Add all rows
- //* DEBUG: */ echo "SUM!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("SUM!<br />");
$result = SQL_QUERY_ESC("SELECT SUM(`%s`) FROM `{!_MYSQL_PREFIX!}_%s` WHERE `%s`='%s'".$add,
array($lookFor, $tableName, $whereStatement, $search), __FUNCTION__, __LINE__);
}
* for default value will cause no referal will get points ever!!!)
*/
function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify = false, $rid = '0', $locked = false, $add_mode = 'ref') {
- //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
+ //* DEBUG: */ OUTPUT_HTML("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
global $DATA;
// Convert mode to lower-case
// Count up referal depth
if (!isset($GLOBALS['ref_level'])) {
// Initialialize referal system
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): Referal system initialized!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): Referal system initialized!<br />");
$GLOBALS['ref_level'] = 0;
} else {
// Increase referal level
$GLOBALS['ref_level']++;
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): Referal level increased. DEPTH={$GLOBALS['ref_level']}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): Referal level increased. DEPTH={$GLOBALS['ref_level']}<br />");
}
// Default is 'normal' points
// Check user account
$result_user = SQL_QUERY_ESC("SELECT refid, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s AND `status`='CONFIRMED' LIMIT 1",
- array(bigintval($uid)), __FUNCTION__, __LINE__);
+ array(bigintval($uid)), __FUNCTION__, __LINE__);
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},numRows=".SQL_NUMROWS($result_user).",points={$points}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},numRows=".SQL_NUMROWS($result_user).",points={$points}<br />");
if (SQL_NUMROWS($result_user) == 1) {
// This is the user and his ref
list($ref, $email) = SQL_FETCHROW($result_user);
// Get percents
$per = getReferalLevelPercents($GLOBALS['ref_level']);
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},points={$points},depth={$GLOBALS['ref_level']},per={$per},mode={$add_mode}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},points={$points},depth={$GLOBALS['ref_level']},per={$per},mode={$add_mode}<br />");
// Some percents found?
if ($per > 0) {
// Calculate new points
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},points={$points},per={$per},depth={$GLOBALS['ref_level']}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},points={$points},per={$per},depth={$GLOBALS['ref_level']}<br />");
$ref_points = $points * $per / 100;
// Pay refback here if level > 0 and in ref-mode
if ((EXT_IS_ACTIVE('refback')) && ($GLOBALS['ref_level'] > 0) && ($per < 100) && ($add_mode == "ref") && (isset($GLOBALS['cache_array']['add_uid'][$uid]))) {
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},data={$GLOBALS['cache_array']['add_uid'][$uid]},ref_points={$ref_points},depth={$GLOBALS['ref_level']} - BEFORE!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},data={$GLOBALS['cache_array']['add_uid'][$uid]},ref_points={$ref_points},depth={$GLOBALS['ref_level']} - BEFORE!<br />");
$ref_points = ADD_REFBACK_POINTS($GLOBALS['cache_array']['add_uid'][$uid], $uid, $points, $ref_points);
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},data={$GLOBALS['cache_array']['add_uid'][$uid]},ref_points={$ref_points},depth={$GLOBALS['ref_level']} - AFTER!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},data={$GLOBALS['cache_array']['add_uid'][$uid]},ref_points={$ref_points},depth={$GLOBALS['ref_level']} - AFTER!<br />");
} // END - if
// Update points...
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_points` SET %s=%s+%s WHERE `userid`=%s AND ref_depth='%s' LIMIT 1",
array($data, $data, $ref_points, bigintval($uid), bigintval($GLOBALS['ref_level'])), __FUNCTION__, __LINE__);
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):data={$data},ref_points={$ref_points},uid={$uid},depth={$GLOBALS['ref_level']},mode={$add_mode} - UPDATE! (".SQL_AFFECTEDROWS().")<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):data={$data},ref_points={$ref_points},uid={$uid},depth={$GLOBALS['ref_level']},mode={$add_mode} - UPDATE! (".SQL_AFFECTEDROWS().")<br />");
// No entry updated?
if (SQL_AFFECTEDROWS() < 1) {
// First ref in this level! :-)
SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_points` (userid,ref_depth,%s) VALUES (%s,'%s',%s)",
array($data, bigintval($uid), bigintval($GLOBALS['ref_level']), $ref_points), __FUNCTION__, __LINE__);
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):data={$data},ref_points={$ref_points},uid={$uid},depth={$GLOBALS['ref_level']},mode={$add_mode} - INSERTED! (".SQL_AFFECTEDROWS().")<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):data={$data},ref_points={$ref_points},uid={$uid},depth={$GLOBALS['ref_level']},mode={$add_mode} - INSERTED! (".SQL_AFFECTEDROWS().")<br />");
} // END - if
// Update mediadata as well
// Maybe there's another ref?
if (($ref > 0) && ($points > 0) && ($ref != $uid) && ($add_mode == 'ref')) {
// Then let's credit him here...
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref},points={$points} - ADVANCE!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref},points={$points} - ADVANCE!<br />");
ADD_POINTS_REFSYSTEM(sprintf("%s_ref:%s", $subject, $GLOBALS['ref_level']), $ref, $points, $send_notify, $ref, $locked);
} // END - if
} // END - if
// Free result
SQL_FREERESULT($result_user);
- //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
}
// Wrapper function for ADD_POINTS_REFSYSTEM()
function updateReferalCounter ($uid) {
// Make it sure referal level zero (member him-/herself) is at least selected
if (empty($GLOBALS['cache_array']['ref_level'][$uid])) $GLOBALS['cache_array']['ref_level'][$uid] = 1;
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['ref_level'][$uid]}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['ref_level'][$uid]}<br />");
// Update counter
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_refsystem` SET `counter`=`counter`+1 WHERE `userid`=%s AND `level`='%s' LIMIT 1",
array(bigintval($uid), $GLOBALS['cache_array']['ref_level'][$uid]), __FUNCTION__, __LINE__);
// When no entry was updated then we have to create it here
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):updated=".SQL_AFFECTEDROWS()."<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):updated=".SQL_AFFECTEDROWS()."<br />");
if (SQL_AFFECTEDROWS() < 1) {
// First count!
SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_refsystem` (`userid`, `level`, `counter`) VALUES (%s,%s,1)",
array(bigintval($uid), $GLOBALS['cache_array']['ref_level'][$uid]), __FUNCTION__, __LINE__);
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid}<br />");
} // END - if
// Check for his referal
// Free memory
SQL_FREERESULT($result);
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref}<br />");
// When he has a referal...
if (($ref > 0) && ($ref != $uid)) {
// Move to next referal level and count his counter one up!
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):ref={$ref} - ADVANCE!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):ref={$ref} - ADVANCE!<br />");
$GLOBALS['cache_array']['ref_level'][$uid]++; updateReferalCounter($ref);
} elseif ((($ref == $uid) || ($ref == 0)) && (GET_EXT_VERSION('cache') >= '0.1.2')) {
// Remove cache here
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):ref={$ref} - CACHE!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):ref={$ref} - CACHE!<br />");
rebuildCacheFiles('refsystem', 'refsystem');
}
// Default is empty
$wht = '';
- //* DEBUG: */ echo __LINE__.'!'.$modCheck."!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__LINE__.'!'.$modCheck."!<br />");
switch ($modCheck) {
case 'admin':
$wht = 'overview';
// Get affected rows
$affectedRows = SQL_AFFECTEDROWS();
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):entries={$entries},affectedRows={$affectedRows}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):entries={$entries},affectedRows={$affectedRows}<br />");
// Rebuild cache
rebuildCacheFiles('config', 'config');
// "Getter" for array for user refs and points in given level
function getUserReferalPoints ($uid, $level) {
- //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
+ //* DEBUG: */ OUTPUT_HTML("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
// Default is no refs and no nickname
$add = '';
$refs = array();
SQL_FREERESULT($result);
// Return result
- //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
return $refs;
}
// We can now send mails to them...
foreach ($RECEIVERS as $key => $uid) {
// Load personal data
- //* DEBUG: */ echo "*L:".__LINE__.'/'.$uid."*<br />";
+ //* DEBUG: */ OUTPUT_HTML("*L:".__LINE__.'/'.$uid."*<br />");
$result_user = SQL_QUERY_ESC("SELECT `surname`, `family`, `email` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1",
array(bigintval($uid)), __FILE__, __LINE__);
if (SQL_NUMROWS($result_user) == 1) {
// The final receiver does exists so we can continue...
list($sname, $fname, $email) = SQL_FETCHROW($result_user);
- //* DEBUG: */ echo "OK!/L:".__LINE__."<br />";
+ //* DEBUG: */ OUTPUT_HTML("OK!/L:".__LINE__."<br />");
// Mark this user as "spammed" ;-) And place a line for him...
if (removeReceiver($dummy, $key, $uid, $DATA['id'], $DATA['id'], true) == 'done') {
// Do we have send maximum mails?
if (($GLOBALS['pool_cnt'] >= getConfig('max_send')) || (countSelection($dummy) == 0)) {
// Yes, we have
- //* DEBUG: */ echo "*EXIT/L:".__LINE__."<br />";
+ //* DEBUG: */ OUTPUT_HTML("*EXIT/L:".__LINE__."<br />");
break;
} // END - if
} // END - if
// Update entry (or add missing
$P = $GLOBALS['pool_cnt'];
if (!empty($cnt2) && empty($GLOBALS['pool_cnt'])) $P = $cnt2;
- //* DEBUG: */ echo "+MEDIA/L:".__LINE__.'/'.$P."+<br />";
+ //* DEBUG: */ OUTPUT_HTML("+MEDIA/L:".__LINE__.'/'.$P."+<br />");
MEDIA_UPDATE_ENTRY(array("total_send", "bonus_send"), 'add', $P);
} // END - if
// Close sending system
- //* DEBUG: */ echo "-L:".__LINE__.'/'.countSelection($dummy)."-<br />";
+ //* DEBUG: */ OUTPUT_HTML("-L:".__LINE__.'/'.countSelection($dummy)."-<br />");
if (countSelection($dummy) == 0) {
// Queue reached!
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_bonus` SET `data_type`='SEND', `target_send`=0, `receivers`='' WHERE `id`=%s LIMIT 1",
array(bigintval($DATA['id'])), __FILE__, __LINE__);
- //* DEBUG: */ echo "*L:".__LINE__."*<br />";
+ //* DEBUG: */ OUTPUT_HTML("*L:".__LINE__."*<br />");
// Update mediadata if version is 0.0.4 or higher
if (GET_EXT_VERSION('mediadata') >= '0.0.4') {
// Update entry (or add missing)
- //* DEBUG: */ echo "*MEDIA/L:".__LINE__."*<br />";
+ //* DEBUG: */ OUTPUT_HTML("*MEDIA/L:".__LINE__."*<br />");
MEDIA_UPDATE_ENTRY(array("total_orders", "bonus_orders"), 'add', 1);
} // END - if
} elseif ($GLOBALS['pool_cnt'] >= getConfig('max_send')) {
// Update bonus pool
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_bonus` SET `data_type`='NEW', `target_send`=%s, `receivers`='%s' WHERE `id`=%s LIMIT 1",
array(countSelection($dummy), implode(';', $dummy), bigintval($DATA['id'])), __FILE__, __LINE__);
- //* DEBUG: */ echo "*L:".__LINE__."<pre>";
- //* DEBUG: */ print_r($dummy);
- //* DEBUG: */ echo "</pre>\n!!!<br />";
+ //* DEBUG: */ OUTPUT_HTML("*L:".__LINE__."<pre>");
+ //* DEBUG: */ OUTPUT_HTML(print_r($dummy, true));
+ //* DEBUG: */ OUTPUT_HTML("</pre>\n!!!<br />");
break;
}
}
array(bigintval($uid)), __FILE__, __LINE__);
// Is his data available?
- //* DEBUG: */ echo "*L:".__LINE__.'/'.SQL_NUMROWS($result_user)."*<br />";
+ //* DEBUG: */ OUTPUT_HTML("*L:".__LINE__.'/'.SQL_NUMROWS($result_user)."*<br />");
if (SQL_NUMROWS($result_user) == 1) {
// The final receiver does exists so we can continue...
list($gender, $sname, $fname, $email) = SQL_FETCHROW($result_user);
array($DATA[0], $DATA[1], $DATA[6]), __FILE__, __LINE__);
// If there's no stats entry add it!
- //* DEBUG: */ echo "!L:".__LINE__.'/'.SQL_NUMROWS($result_stats)."!<br />";
+ //* DEBUG: */ OUTPUT_HTML("!L:".__LINE__.'/'.SQL_NUMROWS($result_stats)."!<br />");
if (SQL_NUMROWS($result_stats) == 0) {
// No entry was found, so we add him!
SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_stats` (pool_id , userid, cat_id, payment_id, subject, url , max_rec , timestamp_ordered, timestamp_sstart) VALUES ('%s','%s','%s','%s','%s','%s','%s','%s' , UNIX_TIMESTAMP())",
array(bigintval($DATA[0]), bigintval($DATA[1]), bigintval($DATA[6])), __FILE__, __LINE__);
} // END - if
- //* DEBUG: */ echo "!L:".__LINE__.'/'.SQL_NUMROWS($result_stats)."!<br />";
+ //* DEBUG: */ OUTPUT_HTML("!L:".__LINE__.'/'.SQL_NUMROWS($result_stats)."!<br />");
if (SQL_NUMROWS($result_stats) == 1) {
// We got one!
list($stats_id) = SQL_FETCHROW($result_stats);
// Mark this user as "spammed" ;-) And place a line for him...
- //* DEBUG: */ echo "?L:".__LINE__.'/'.$dummy.'/'.$key.'/'.$uid.'('.$DATA[1].")/".$DATA[0].'/'.$stats_id."?<br />";
- switch (removeReceiver($dummy, $key, bigintval($uid), bigintval($DATA[0]), bigintval($stats_id)))
- {
+ //* DEBUG: */ OUTPUT_HTML("?L:".__LINE__.'/'.$dummy.'/'.$key.'/'.$uid.'('.$DATA[1].")/".$DATA[0].'/'.$stats_id."?<br />");
+ switch (removeReceiver($dummy, $key, bigintval($uid), bigintval($DATA[0]), bigintval($stats_id))) {
case 'done':
// Prepare the mail
$DATA[11] = bigintval($stats_id);
// Update mediadata if version is 0.0.4 or higher
if (GET_EXT_VERSION('mediadata') >= '0.0.4') {
// Update entry (or add missing)
- //* DEBUG: */ echo "*MEDIA/L:".__LINE__."*<br />";
+ //* DEBUG: */ OUTPUT_HTML("*MEDIA/L:".__LINE__."*<br />");
MEDIA_UPDATE_ENTRY(array("total_send", "normal_send"), 'add', 1);
} // END - if
// And count up the mail
$GLOBALS['pool_cnt']++;
- //* DEBUG: */ echo"*EXIT/L:".__LINE__.'/'.$GLOBALS['pool_cnt']."*<br />";
+ //* DEBUG: */ OUTPUT_HTML("*EXIT/L:".__LINE__.'/'.$GLOBALS['pool_cnt']."*<br />");
break;
case 'already':
// Entry already found, but we still count one up!
$GLOBALS['pool_cnt']++;
- //* DEBUG: */ echo"*EXIT/L:".__LINE__.'/'.$GLOBALS['pool_cnt']."<br />";
+ //* DEBUG: */ OUTPUT_HTML("*EXIT/L:".__LINE__.'/'.$GLOBALS['pool_cnt']."<br />");
break;
}
}
// Do we have reached the maximum to send mails? || (getConfig('max_send') >= $GLOBALS['pool_cnt'])
- //* DEBUG: */ echo "*L:".__LINE__.'/'.$GLOBALS['pool_cnt'].">=".$DATA[8].'/'.getConfig('max_send').">=".$GLOBALS['pool_cnt'].'/'.$lastSentId."!=".$DATA[0]."*<br />";
+ //* DEBUG: */ OUTPUT_HTML("*L:".__LINE__.'/'.$GLOBALS['pool_cnt'].">=".$DATA[8].'/'.getConfig('max_send').">=".$GLOBALS['pool_cnt'].'/'.$lastSentId."!=".$DATA[0]."*<br />");
if ((($GLOBALS['pool_cnt'] >= $DATA[8])) && ($lastSentId != $DATA[0])) {
// Prepare content
$content = array(
// Update mediadata if version is 0.0.4 or higher
if (GET_EXT_VERSION('mediadata') >= '0.0.4') {
// Update entry (or add missing)
- //* DEBUG: */ echo "*MEDIA/L:".__LINE__."*<br />";
+ //* DEBUG: */ OUTPUT_HTML("*MEDIA/L:".__LINE__."*<br />");
MEDIA_UPDATE_ENTRY(array("total_orders", "normal_orders"), 'add', 1);
} // END - if
- //* DEBUG: */ echo"*EXIT/L:".__LINE__.'/'.$P."<br />";
+ //* DEBUG: */ OUTPUT_HTML("*EXIT/L:".__LINE__.'/'.$P."<br />");
break;
}
// Do we have send maximum mails?
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET `data_type`='NEW', receivers='%s'".$add." WHERE `id`=%s LIMIT 1",
array(implode(';', $dummy), bigintval($DATA[0])), __FILE__, __LINE__);
- //* DEBUG: */ echo"*EXIT/L:".__LINE__."*<br />";
+ //* DEBUG: */ OUTPUT_HTML("*EXIT/L:".__LINE__."*<br />");
break;
}
// Do not execute when script is in CSS mode or no daily reset
if ((getOutputMode() == 1) || (!isResetModeEnabled()) || (getConfig('beg_rallye') == 'Y')) return;
-//* DEBUG: */ echo basename(__FILE__)."<br />\n";
+//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."<br />");
// Reset accounts
$result = SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET beg_points=0.00000 WHERE beg_points > 0",
// Do not execute when script is in CSS mode or no daily reset
if ((getOutputMode() == 1) || (!isResetModeEnabled())) return;
-//* DEBUG: */ echo basename(__FILE__)."<br />\n";
+//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."<br />");
// Purge expired entries in _bonus_turbo
BONUS_PURGE_EXPIRED_TURBO_BONUS();
// Do not execute when script is in CSS mode or no daily reset
if ((getOutputMode() == 1) || (!isResetModeEnabled())) return;
-//* DEBUG: */ echo basename(__FILE__)."<br />\n";
+//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."<br />");
// Update user profiles
if (GET_EXT_VERSION('order') >= '0.1.1') {
// Transfer points from locked_points to points
$result_daily = SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE ref_payout=0 AND `status`='CONFIRMED' ORDER BY `userid` ASC", __FILE__, __LINE__);
-//* DEBUG: */ echo basename(__FILE__).":payout=0;daily|numRows=".SQL_NUMROWS($result_daily)."<br />\n";
+//* DEBUG: */ OUTPUT_HTML(basename(__FILE__).":payout=0;daily|numRows=".SQL_NUMROWS($result_daily)."<br />");
if (SQL_NUMROWS($result_daily) > 0) {
// Init SQLs
INIT_SQLS();
// Start checking accounts which are on 0 confirmed-to-go mails
while ($content = SQL_FETCHARRAY($result_daily)) {
- //* DEBUG: */ echo basename(__FILE__).":uid={$content['userid']}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(basename(__FILE__).":uid={$content['userid']}<br />");
$result_points = SQL_QUERY_ESC("SELECT ref_depth, locked_points FROM `{!_MYSQL_PREFIX!}_user_points`
WHERE userid=%s AND locked_points != 0.00000 ORDER BY ref_depth",
array(bigintval($content['userid'])), __FILE__, __LINE__);
- //* DEBUG: */ echo basename(__FILE__).":payout=0;points|numRows=".SQL_NUMROWS($result_points)."<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(basename(__FILE__).":payout=0;points|numRows=".SQL_NUMROWS($result_points)."<br />");
if (SQL_NUMROWS($result_points) > 0) {
// Ok transfer points
while ($content2 = SQL_FETCHARRAY($result_points)) {
// Merge both arrays
$content = merge_array($content, $content2);
- //* DEBUG: */ echo basename(__FILE__).":uid={$content['userid']},depth={$content['ref_depth']},locked={$content['locked_points']}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(basename(__FILE__).":uid={$content['userid']},depth={$content['ref_depth']},locked={$content['locked_points']}<br />");
ADD_SQL(SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_points` SET points=points+%s, locked_points=0.00000
WHERE userid=%s AND ref_depth=%d
LIMIT 1",
if (!defined('__SECURITY')) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
require($INC);
-} elseif (!EXT_IS_ACTIVE("engine")) {
+} elseif (!EXT_IS_ACTIVE('engine')) {
return;
}
// Do not execute when script is in CSS mode or no daily reset
if ((getOutputMode() == 1) || (!isResetModeEnabled())) return;
-//* DEBUG: */ echo basename(__FILE__)."<br />\n";
+//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."<br />");
//
?>
// Do not execute when script is in CSS mode or no daily reset
if ((getOutputMode() == 1) || ((!isResetModeEnabled()) && (getConfig('holiday_mode') == 'RESET'))) return;
-//* DEBUG: */ echo basename(__FILE__)."<br />\n";
+//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."<br />");
// Check for holidays we need to enable and send email to user
$result_main = SQL_QUERY("SELECT userid, holiday_activated
// Do not execute when script is in CSS mode or no daily reset
if ((getOutputMode() == 1) || (!isResetModeEnabled())) return;
-//* DEBUG: */ echo basename(__FILE__)."<br />\n";
+//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."<br />");
// Reset surfbar counter
updateConfiguration(array("surfbar_daily_counter", "surfbar_yester_counter"), array(0, getConfig('surfbar_daily_counter')));
* MA 02110-1301 USA *
************************************************************************/
-print "<pre>";
+print("<pre>");
debug_print_backtrace();
die("</pre>");
-echo "<html>
+print("<html>
<head>
<title>Protected file ".basename($_SERVER['PHP_SELF'])." - ACCESS DENIED!</title>
</head>
</table>
</div>
</body>
-</html>\n";
+</html>\n");
shutdown();
//
?>
// Is the session variable set?
if (("".$value."" == '') && (isSessionVariableSet($var))) {
// Remove the session
- //* DEBUG: */ echo "UNSET:".$var.'='.getSession($var)."<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("UNSET:".$var.'='.getSession($var)."<br />");
unset($_SESSION[$var]);
return session_unregister($var);
} elseif (("".$value."" != '') && (!isSessionVariableSet($var))) {
// Set session
- //* DEBUG: */ echo "SET:".$var.'='.$value."<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("SET:".$var.'='.$value."<br />");
$_SESSION[$var] = $value;
return session_register($var);
} elseif (!empty($value)) {
// Update session
- //* DEBUG: */ echo "UPDATE:".$var.'='.$value."<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("UPDATE:".$var.'='.$value."<br />");
$_SESSION[$var] = $value;
return true;
}
// Ignored (but valid)
- //* DEBUG: */ echo "IGNORED:".$var.'='.$value."<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("IGNORED:".$var.'='.$value."<br />");
return true;
}
// Check wether a session variable is set
function isSessionVariableSet ($var) {
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):var={$var}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):var={$var}<br />");
return (isset($_SESSION[$var]));
}
// Is the variable there or cached values?
if (isset($GLOBALS['cache_array']['session'][$var])) {
// Get cached value (skips a lot SQL_ESCAPE() calles!
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ".$var."-CACHE!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ".$var."-CACHE!<br />");
$value = $GLOBALS['cache_array']['session'][$var];
} elseif (isSessionVariableSet($var)) {
// Then get it secured!
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ".$var."-RESOLVE!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ".$var."-RESOLVE!<br />");
$value = SQL_ESCAPE($_SESSION[$var]);
// Cache the value
// Do not execute when script is in CSS mode or no daily reset
if ((getOutputMode() == 1) || (!isResetModeEnabled())) return;
-//* DEBUG: */ echo basename(__FILE__)."<br />\n";
+//* DEBUG: */ OUTPUT_HTML(basename(__FILE__)."<br />");
// Reset the surfbar counter
updateConfiguration('surfbar_weekly_counter', '0');