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