./inc/extensions-functions.php:424:// @TODO Change from ext_id to ext_name (not just even the variable! ;-) )
./inc/extensions-functions.php:548: // @TODO Extension is loaded, what next?
./inc/functions.php:115: // @TODO Extension 'msg' does not exist
-./inc/functions.php:1484: // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ?
-./inc/functions.php:1507: // @TODO Rewrite this old lost code to a template
-./inc/functions.php:1575: // @TODO Are these convertions still required?
-./inc/functions.php:1593:// @TODO Rewrite this function to use readFromFile() and writeToFile()
+./inc/functions.php:1486: // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ?
+./inc/functions.php:1509: // @TODO Rewrite this old lost code to a template
+./inc/functions.php:1577: // @TODO Are these convertions still required?
+./inc/functions.php:1595:// @TODO Rewrite this function to use readFromFile() and writeToFile()
./inc/functions.php:178:// @TODO Rewrite this to an extension 'smtp'
-./inc/functions.php:2246: // @TODO This is still very static, rewrite it somehow
+./inc/functions.php:2248: // @TODO This is still very static, rewrite it somehow
./inc/gen_sql_patches.php:96:// @TODO Rewrite this to a filter
./inc/install-functions.php:63: // @TODO DEACTIVATED: changeDataInFile(getCachePath() . 'config-local.php', 'OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestParameter('omode'), 0);
./inc/language/de.php:1129:// @TODO Rewrite these two constants
./inc/language/rallye_de.php:13: * @TODO Naming convention not applied for language strings *
./inc/language/refback_de.php:46:// @TODO Rewrite these constants to one
./inc/language/sponsor_de.php:119:// @TODO Rewrite these four constants to one and use sprintf()
-./inc/libs/admins_functions.php:434: // @TODO This can be, somehow, rewritten
+./inc/libs/admins_functions.php:435: // @TODO This can be, somehow, rewritten
./inc/libs/beg_functions.php:58: // @TODO Try to rewrite the following unset()
-./inc/libs/bonus_functions.php:206: // @TODO Move this HTML to a template
-./inc/libs/bonus_functions.php:290: // @TODO This query isn't right, it will only update if the user was for a longer time away!
+./inc/libs/bonus_functions.php:204: // @TODO Move this HTML to a template
+./inc/libs/bonus_functions.php:288: // @TODO This query isn't right, it will only update if the user was for a longer time away!
./inc/libs/doubler_functions.php:46:// @TODO Lame description
./inc/libs/doubler_functions.php:94: // @TODO Can't this be moved into EL?
./inc/libs/mailid_functions.php:49: // @TODO Rewrite this to a dynamic include or so
./inc/libs/rallye_functions.php:700:// @TODO This function does not load min_users, min_prices, please encapsulate loading rallye data with e.g. getRallyeDataFromId()
-./inc/libs/rallye_functions.php:768: $EXPIRE = 3; // @TODO The hard-coded value...
-./inc/libs/rallye_functions.php:854:// @TODO Please document this function
-./inc/libs/rallye_functions.php:910: // Load count @TODO Can't we rewrite this to our API?
+./inc/libs/rallye_functions.php:765: $EXPIRE = 3; // @TODO The hard-coded value...
+./inc/libs/rallye_functions.php:851:// @TODO Please document this function
+./inc/libs/rallye_functions.php:907: // 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:292: // @TODO Rewrite these all to a single filter
./inc/libs/register_functions.php:365: // @TODO Rewrite this to a filter
./inc/modules/admin/admin-inc.php:438:// @TODO Try to rewrite this to adminAddMenuSelectionBox()
./inc/modules/admin/overview-inc.php:164: // @TODO Rewrite this to a filter
./inc/modules/admin/overview-inc.php:277: // @TODO Rewrite this to something with include files and/or filter
-./inc/modules/admin/overview-inc.php:315: // @TODO This may also be rewritten to include files
-./inc/modules/admin/overview-inc.php:317: default: // @TODO Unknown support mode
-./inc/modules/admin/overview-inc.php:432: // @TODO Try to move this in includes
+./inc/modules/admin/overview-inc.php:311: // @TODO This may also be rewritten to include files
+./inc/modules/admin/overview-inc.php:313: default: // @TODO Unknown support mode
+./inc/modules/admin/overview-inc.php:428: // @TODO Try to move this in includes
./inc/modules/admin/overview-inc.php:45:// @TODO This function does also check for uncompleted tasks
./inc/modules/admin/what-add_guestnl_cat.php:49: // @TODO Check if category does already exist
./inc/modules/admin/what-add_surfbar_url.php:57: // @TODO Find all convertSelectionsToTimestamp() calls and rewrite postRequestParameter() calls to $postData
./inc/modules/member/what-beg.php:56:// @TODO Can't this be moved into EL?
./inc/modules/member/what-beg.php:65:// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getConfig('beg_userid_timeout')));
./inc/modules/member/what-bonus.php:57: // @TODO Rewrite this to a filter
-./inc/modules/member/what-categories.php:129: // @TODO Rewrite this to use $OUT .= ...
+./inc/modules/member/what-categories.php:132: // @TODO Rewrite this to use $OUT .= ...
./inc/modules/member/what-order.php:427: // @TODO Rewrite this to a filter
./inc/modules/member/what-payout.php:196: // @TODO Rewrite this to a filter
./inc/modules/member/what-points.php:55:// @TODO Should we rewrite this to a filter?
./inc/mysql-manager.php:1164: // @TODO Rewrite this to a filter
./inc/mysql-manager.php:1411: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
./inc/mysql-manager.php:1509: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1888: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1932:// @TODO Fix inconsistency between last_module and getWhat()
+./inc/mysql-manager.php:1876: // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1920:// @TODO Fix inconsistency between last_module and getWhat()
./inc/mysql-manager.php:370: // @TODO Try to rewrite this to one or more functions
./inc/mysql-manager.php:46:// @TODO Can we cache this?
./inc/reset/reset_beg.php:51:// @TODO This should be converted in a daily beg rallye
#!/bin/sh
-echo "$0: Analysing PHP script for syntax errors (lint) ..."
+echo "$0: Analysing PHP scripts for syntax errors (lint) ..."
LINT=`find -name "*.php" -exec php -l -f {} 2>&1 \; | grep -v "No syntax errors detected in"`
if test "${LINT}" != ""; then
// Male/female or company?
switch ($gender) {
- case 'M', 'M', 'C':
+ case 'M':
+ case 'M':
+ case 'C':
$ret = sprintf("{--GENDER_%s--}", $gender);
break;
'NORMAL_MAIL_PROBLEM' => "Mail vom Mitgliedern bereits gelöscht",
'BONUS_MAIL_PROBLEM' => "Bonus-Mail bereits gelöscht",
'ADMIN_GENERAL_MAIL_PROBLEM' => "BUG! BUG! Bitte reporten auf <a href=\"http://bugs.mxchange.org/\" target=\"_blank\" title=\"Link zum Bug-Tracker\">bugs.mxchange.org</a>.",
- 'MEMBER_GENERAL_MAIL_PROBLEM' => "Allgemeines Mail-Problem erkannt. Bitte beim Support melden."
+ 'MEMBER_GENERAL_MAIL_PROBLEM' => "Allgemeines Mail-Problem erkannt. Bitte beim Support melden.",
'MEMBER_BACK_JACKPOT' => "{?POINTS?}-Rückgutschrift",
'ADMIN_BACK_JACKPOT' => "{?POINTS?}-Aufbuchung für Jackpot",
'MEDIA_DATA' => "Mediendaten",
// Delete given admin accounts
function adminsDeleteAdminAccount ($postData) {
// Check if this account is the last one which cannot be deleted...
- $result_main = SQL_QUERY("SELECT `id` FROM `{?_MYSQL_PREFIX?}_admins`", __FUNCTION__, __LINE__);
- $accounts = SQL_NUMROWS($result_main);
- SQL_FREERESULT($result_main);
- if ($accounts > 1) {
+ if (countSumTotalData('', 'admins', 'id', '', true) > 1) {
// Delete accounts
$OUT = '';
foreach ($postData['sel'] as $id => $selected) {
$id = bigintval($id);
// Get the admin's data
- $result = SQL_QUERY_ESC("SELECT login, email, default_acl AS mode, la_mode FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `login`, `email`, `default_acl` AS `mode`, `la_mode` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
array($id), __FUNCTION__, __LINE__);
+
+ // Do we have an entry?
if (SQL_NUMROWS($result) == 1) {
- // Entry found
+ // Entry found, so load data
$content = SQL_FETCHARRAY($result);
- SQL_FREERESULT($result);
$content['mode'] = '{--ADMINS_' . strtoupper($content['mode']) . '_MODE--}';
$content['la_mode'] = '{--ADMINS_' . strtoupper($content['la_mode']) . '_LA_SETTING--}';
// Load row template and switch color
$OUT .= loadTemplate('admin_del_admins_row', true, $content);
} // END - if
+
+ // Free result
+ SQL_FREERESULT($result);
} // END - foreach
// Load template
array(
$type,
$data,
- $userid
+ bigintval($userid)
), __FUNCTION__, __LINE__);
// Entry found?
$self = true;
// Transfer data to template
- $GLOBALS['ranking_content']['yr_level'] = $GLOBALS['ranking_content']['level'];
- $GLOBALS['ranking_content']['yr_points'] = translateComma($GLOBALS['ranking_content']['points']);
- $GLOBALS['ranking_content']['yr_tmark'] = generateDateTime($GLOBALS['ranking_content']['timemark'], 1);
+ $GLOBALS['ranking_content']['timemark'] = generateDateTime($GLOBALS['ranking_content']['timemark'], 1);
// Load template
$GLOBALS['ranking_content']['own'] = loadTemplate('show_bonus_yr', true, $GLOBALS['ranking_content']);
// @TODO This function does not load min_users, min_prices, please encapsulate loading rallye data with e.g. getRallyeDataFromId()
function addReferalRallyeWinners ($rallye, $default=0) {
// First check how many prices are set
- $result_prices = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `rallye_id`=%s ORDER BY `price_level` ASC",
- array(bigintval($rallye)), __FUNCTION__, __LINE__);
- $prices = SQL_NUMROWS($result_prices);
- SQL_FREERESULT($result_prices);
+ $prices = countSumTotalData(bigintval($rallye), 'rallye_prices', 'id', 'rallye_id', true);
// Load data
$DATA = getArrayFromReferalRallyeUsers($rallye);
switch ($taskData['task_type']) {
case 'EXTENSION': // Install new extensions
$ext_name = substr($taskData['subject'], 1, strpos($taskData['subject'], ':') - 1);
- $result_lines = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `ext_name`='%s' LIMIT 1",
- array($ext_name), __FILE__, __LINE__);
- $lines = SQL_NUMROWS($result_lines);
- SQL_FREERESULT($result_lines);
- if ($lines == '0') {
- // New extension found
+ if (!isExtensionInstalled($ext_name)) {
+ // New (not yet installed) extension found
$OUT .= loadTemplate('admin_extension_reg_form', true, array(
'id' => bigintval($taskId),
'ext_name' => $ext_name
));
} else {
- // Task is closed so nothing is todo
+ // Extension is already installed
$OUT .= '<div class="admin_failed">{--ADMIN_EXTENSION_ALREADY_REGISTERED--}</div>';
// Close task but not already closed, solved, deleted or update tasks
$result = SQL_QUERY("SELECT id, action, what, title, sort FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort` ASC", __FILE__, __LINE__);
}
- $max = SQL_NUMROWS($result);
- if ($max > 0) {
+ $numMenus = SQL_NUMROWS($result);
+ if ($numMenus > 0) {
// Remember sub value
$content['sub'] = $SUB;
if (($data['sort'] == '0') || (($data['sort'] == 1) && (!empty($SUB)))) {
// Is highest position
$data['navi'] = '<a href="{%url=modules.php?module=admin&what=adminedit&sub=' . $content['sub'] . '&act=' . $data['action'] . '&w=' . $data['what'] . '&tid=' . ($data['sort']+1) . '&fid=' . $data['sort'] . '%}">{--LOWER--}</a>';
- } elseif ($cnt == $max) {
+ } elseif ($cnt == $numMenus) {
// Is lowest position
$data['navi'] = '<a href="{%url=modules.php?module=admin&what=adminedit&sub=' . $content['sub'] . '&act=' . $data['action'] . '&w=' . $data['what'] . '&tid=' . ($data['sort']-1) . '&fid=' . $data['sort'] . '%}">{--HIGHER--}</a>';
} elseif ($data['sort'] > 0) {
}
// Get number of menu entries
- $max = SQL_NUMROWS($result);
- if ($max > 0) {
+ $numMenus = SQL_NUMROWS($result);
+ if ($numMenus > 0) {
// Set sub value
$content['sub'] = $SUB;
if (($data['sort'] == '0') || (($data['sort'] == 1) && (!empty($SUB)))) {
// Is highest position
$NAVI = '<a href="{%url=modules.php?module=admin&what=guestedit&sub=' . $content['sub'] . '&act=' . $data['action'] . '&w=' . $data['what'] . '&tid=' . ($data['sort']+1) . '&fid=' . $data['sort'] . '%}">{--LOWER--}</a>';
- } elseif ($cnt == $max) {
+ } elseif ($cnt == $numMenus) {
// Is lowest position
$NAVI = '<a href="{%url=modules.php?module=admin&what=guestedit&sub=' . $content['sub'] . '&act=' . $data['action'] . '&w=' . $data['what'] . '&tid=' . ($data['sort']-1) . '&fid=' . $data['sort'] . '%}">{--HIGHER--}</a>';
} elseif ($data['sort'] > 0) {
}
// Get total menu entries
- $max = SQL_NUMROWS($result);
+ $numMenus = SQL_NUMROWS($result);
// Some are there?
- if ($max > 0) {
+ if ($numMenus > 0) {
// Set sub value
$content['sub'] = $SUB;
if (($data['sort'] == '0') || (($data['sort'] == 1) && (!empty($SUB)))) {
// Is highest position
$data['navi'] = '<a href="{%url=modules.php?module=admin&what=adminedit&sub=' . $content['sub'] . '&act=' . $data['action'] . '&w=' . $data['what'] . '&tid=' . ($data['sort']+1) . '&fid=' . $data['sort'] . '%}">{--LOWER--}</a>';
- } elseif ($cnt == $max) {
+ } elseif ($cnt == $numMenus) {
// Is lowest position
$data['navi'] = '<a href="{%url=modules.php?module=admin&what=adminedit&sub=' . $content['sub'] . '&act=' . $data['action'] . '&w=' . $data['what'] . '&tid=' . ($data['sort']-1) . '&fid=' . $data['sort'] . '%}">{--HIGHER--}</a>';
} elseif ($data['sort'] > 0) {
} // END - if
// Set empty mode to "select"
-if (!isGetRequestParameterSet('mode')) setGetRequestParameter('mode', "select");
+if (!isGetRequestParameterSet('mode')) setGetRequestParameter('mode', 'select');
if (isFormSent()) {
// Deliver bonus mail
$whereStatement = " WHERE `visible`='Y'";
if (isAdmin()) $whereStatement = '';
-$result = SQL_QUERY("SELECT id, cat FROM `{?_MYSQL_PREFIX?}_cats`".$whereStatement." ORDER BY `sort`", __FILE__, __LINE__);
-$cats = SQL_NUMROWS($result);
+// Get all categories
+$result = SQL_QUERY("SELECT `id`, `cat` FROM `{?_MYSQL_PREFIX?}_cats`".$whereStatement." ORDER BY `sort` ASC", __FILE__, __LINE__);
-if ($cats > 0) {
+// Get num rows
+$numCategories = SQL_NUMROWS($result);
+
+if ($numCategories > 0) {
$LEAST = false;
if (isFormSent()) {
$cnt = '0';
if ($joined != 'Y') $cnt++;
} // END - foreach
- if (($cats - $cnt) < getConfig('least_cats')) {
+ if (($numCategories - $cnt) < getConfig('least_cats')) {
unsetPostRequestParameter('ok');
$LEAST = true;
} // END - if
} // END - if
// Put some data into constants for the template
- $content['rows'] = ($cats*2+4);
+ $content['rows'] = ($numCategories * 2 + 4);
// Load header template
loadTemplate('member_cats_header', false, $content);
// Query for referal levels and percents
$result_depths = SQL_QUERY("SELECT `level`, `percents` FROM `{?_MYSQL_PREFIX?}_refdepths` ORDER BY `level` ASC", __FILE__, __LINE__);
-$depths = SQL_NUMROWS($result_depths);
+$numDepths = SQL_NUMROWS($result_depths);
// Add many more rows for the login/turbo/ref/order bonus
// @TODO Should we rewrite this to a filter?
-if (!isExtensionActive('bonus')) $depths += 1;
-if (isExtensionInstalledAndNewer('bonus', '0.2.2')) $depths += 6;
-if (isExtensionInstalledAndNewer('bonus', '0.4.4')) $depths += 4;
+if (!isExtensionActive('bonus')) $numDepths += 1;
+if (isExtensionInstalledAndNewer('bonus', '0.2.2')) $numDepths += 6;
+if (isExtensionInstalledAndNewer('bonus', '0.4.4')) $numDepths += 4;
// Remember row count in constant
-$content['rowspan'] = ($depths*2+15);
+$content['rowspan'] = ($numDepths * 2 + 15);
// Init some vars...
$content['total_points'] = '0';
// Count or sum whole table?
if ($countRows === true) {
// Count whole table
- $result = SQL_QUERY_ESC("SELECT COUNT(`%s`) AS res FROM `{?_MYSQL_PREFIX?}_%s`".$add,
+ $result = SQL_QUERY_ESC("SELECT COUNT(`%s`) AS `res` FROM `{?_MYSQL_PREFIX?}_%s`".$add,
array($lookFor, $tableName), __FUNCTION__, __LINE__);
} else {
// Sum whole table
- $result = SQL_QUERY_ESC("SELECT SUM(`%s`) AS res FROM `{?_MYSQL_PREFIX?}_%s`".$add,
+ $result = SQL_QUERY_ESC("SELECT SUM(`%s`) AS `res` FROM `{?_MYSQL_PREFIX?}_%s`".$add,
array($lookFor, $tableName), __FUNCTION__, __LINE__);
}
} elseif (($countRows === true) || ($lookFor == 'userid')) {
// Count rows
//* DEBUG: */ debugOutput('COUNT!');
- $result = SQL_QUERY_ESC("SELECT COUNT(`%s`) AS res FROM `{?_MYSQL_PREFIX?}_%s` WHERE `%s`='%s'".$add,
+ $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: */ debugOutput('SUM!');
- $result = SQL_QUERY_ESC("SELECT SUM(`%s`) AS res FROM `{?_MYSQL_PREFIX?}_%s` WHERE `%s`='%s'".$add,
+ $result = SQL_QUERY_ESC("SELECT SUM(`%s`) AS `res` FROM `{?_MYSQL_PREFIX?}_%s` WHERE `%s`='%s'".$add,
array($lookFor, $tableName, $whereStatement, $search), __FUNCTION__, __LINE__);
}
}
// "Getter" for total available receivers
-function getTotalReceivers ($mode='normal') {
- // Query database
- $result_all = SQL_QUERY("SELECT
- `userid`
-FROM
- `{?_MYSQL_PREFIX?}_user_data`
-WHERE
- `status`='CONFIRMED' AND `receive_mails` > 0 ".runFilterChain('exclude_users', $mode),
- __FUNCTION__, __LINE__);
-
+function getTotalReceivers ($mode = 'normal') {
// Get num rows
- $numRows = SQL_NUMROWS($result_all);
-
- // Free result
- SQL_FREERESULT($result_all);
+ $numRows = countSumTotalData('CONFIRMED', 'user_data', 'userid', 'status', true, ' AND `receive_mails` > 0' . runFilterChain('exclude_users', $mode));
// Return value
return $numRows;
<tr>
<td align="center">
{--BONUS_SHOW_YOU_HAVE_CONFIRMED--}
- <strong class="nobr">$content[yr_tmark]</strong>
- {--_ON--} <strong>$content[yr_level].</strong>
+ <strong class="nobr">$content[timemark]</strong>
+ {--_ON--} <strong>$content[level].</strong>
{--BONUS_SHOW_CONFIRMED_BONUS_IS--}:
- <strong class="nobr">$content[yr_points] {?POINTS?}</strong>
+ <strong class="nobr">{%pipe,translateComma=$content[points]%} {?POINTS?}</strong>
</td>
</tr>
</table>