From 241acfbd7e38ff9916100dac9d88892713f85c7f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 16 Jul 2010 15:34:57 +0000 Subject: [PATCH] Syntax errors fixed, naming convention applied, wrappers used: - Some syntax errors fixed (were added with last commit) - Naming convention applied on variables $max ($numMenus) and some more - Wraper countSumTotalData() further used - overview-inc.php contained a query which can be converted into a wrapper call, function isExtensionInstalled() could be used instead - TODOs.txt updated --- DOCS/TODOs.txt | 34 +++++++++++++------------- DOCS/lint.sh | 2 +- inc/functions.php | 4 ++- inc/language/de.php | 2 +- inc/libs/admins_functions.php | 15 ++++++------ inc/libs/bonus_functions.php | 6 ++--- inc/libs/rallye_functions.php | 5 +--- inc/modules/admin/overview-inc.php | 10 +++----- inc/modules/admin/what-adminedit.php | 6 ++--- inc/modules/admin/what-guestedit.php | 6 ++--- inc/modules/admin/what-memedit.php | 6 ++--- inc/modules/admin/what-send_bonus.php | 2 +- inc/modules/member/what-categories.php | 13 ++++++---- inc/modules/member/what-points.php | 10 ++++---- inc/mysql-manager.php | 24 +++++------------- templates/de/html/show_bonus_yr.tpl | 6 ++--- 16 files changed, 68 insertions(+), 83 deletions(-) diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index 8f8e799ec7..d414a4a530 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -41,12 +41,12 @@ ./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 @@ -58,17 +58,17 @@ ./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 @@ -96,9 +96,9 @@ ./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 @@ -158,7 +158,7 @@ ./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? @@ -176,8 +176,8 @@ ./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 diff --git a/DOCS/lint.sh b/DOCS/lint.sh index 2f79ca40f5..c2b43ca689 100755 --- a/DOCS/lint.sh +++ b/DOCS/lint.sh @@ -1,6 +1,6 @@ #!/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 diff --git a/inc/functions.php b/inc/functions.php index ac5ba52a50..5d929a9934 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -405,7 +405,9 @@ function translateGender ($gender) { // Male/female or company? switch ($gender) { - case 'M', 'M', 'C': + case 'M': + case 'M': + case 'C': $ret = sprintf("{--GENDER_%s--}", $gender); break; diff --git a/inc/language/de.php b/inc/language/de.php index b24b307f36..adf13c5308 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -555,7 +555,7 @@ addMessages(array( '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 bugs.mxchange.org.", - '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", diff --git a/inc/libs/admins_functions.php b/inc/libs/admins_functions.php index 344b5909ff..e549b1fca3 100644 --- a/inc/libs/admins_functions.php +++ b/inc/libs/admins_functions.php @@ -329,10 +329,7 @@ function adminsEditAdminAccount ($postData) { // 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) { @@ -340,12 +337,13 @@ function adminsDeleteAdminAccount ($postData) { $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--}'; @@ -355,6 +353,9 @@ function adminsDeleteAdminAccount ($postData) { // 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 diff --git a/inc/libs/bonus_functions.php b/inc/libs/bonus_functions.php index acdc940d72..17736e9292 100644 --- a/inc/libs/bonus_functions.php +++ b/inc/libs/bonus_functions.php @@ -128,7 +128,7 @@ function addBonusRanks ($data, $type, $userid) { array( $type, $data, - $userid + bigintval($userid) ), __FUNCTION__, __LINE__); // Entry found? @@ -140,9 +140,7 @@ function addBonusRanks ($data, $type, $userid) { $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']); diff --git a/inc/libs/rallye_functions.php b/inc/libs/rallye_functions.php index b0fd3a9943..c9a781a360 100644 --- a/inc/libs/rallye_functions.php +++ b/inc/libs/rallye_functions.php @@ -700,10 +700,7 @@ LIMIT 1", // @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); diff --git a/inc/modules/admin/overview-inc.php b/inc/modules/admin/overview-inc.php index 1b85cbead7..90bb61a898 100644 --- a/inc/modules/admin/overview-inc.php +++ b/inc/modules/admin/overview-inc.php @@ -278,18 +278,14 @@ LIMIT 1", 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 .= '
{--ADMIN_EXTENSION_ALREADY_REGISTERED--}
'; // Close task but not already closed, solved, deleted or update tasks diff --git a/inc/modules/admin/what-adminedit.php b/inc/modules/admin/what-adminedit.php index 9cfb7b94e8..8746b7d4bb 100644 --- a/inc/modules/admin/what-adminedit.php +++ b/inc/modules/admin/what-adminedit.php @@ -225,8 +225,8 @@ WHERE ".$AND." AND `id`=%s LIMIT 1", $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; @@ -243,7 +243,7 @@ WHERE ".$AND." AND `id`=%s LIMIT 1", if (($data['sort'] == '0') || (($data['sort'] == 1) && (!empty($SUB)))) { // Is highest position $data['navi'] = '{--LOWER--}'; - } elseif ($cnt == $max) { + } elseif ($cnt == $numMenus) { // Is lowest position $data['navi'] = '{--HIGHER--}'; } elseif ($data['sort'] > 0) { diff --git a/inc/modules/admin/what-guestedit.php b/inc/modules/admin/what-guestedit.php index 2893e90c0b..9c1e556d68 100644 --- a/inc/modules/admin/what-guestedit.php +++ b/inc/modules/admin/what-guestedit.php @@ -262,8 +262,8 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() } // 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; @@ -277,7 +277,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() if (($data['sort'] == '0') || (($data['sort'] == 1) && (!empty($SUB)))) { // Is highest position $NAVI = '{--LOWER--}'; - } elseif ($cnt == $max) { + } elseif ($cnt == $numMenus) { // Is lowest position $NAVI = '{--HIGHER--}'; } elseif ($data['sort'] > 0) { diff --git a/inc/modules/admin/what-memedit.php b/inc/modules/admin/what-memedit.php index aabe4643a0..49f8473f0f 100644 --- a/inc/modules/admin/what-memedit.php +++ b/inc/modules/admin/what-memedit.php @@ -252,10 +252,10 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() } // 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; @@ -267,7 +267,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() if (($data['sort'] == '0') || (($data['sort'] == 1) && (!empty($SUB)))) { // Is highest position $data['navi'] = '{--LOWER--}'; - } elseif ($cnt == $max) { + } elseif ($cnt == $numMenus) { // Is lowest position $data['navi'] = '{--HIGHER--}'; } elseif ($data['sort'] > 0) { diff --git a/inc/modules/admin/what-send_bonus.php b/inc/modules/admin/what-send_bonus.php index bd198c04de..11735715b8 100644 --- a/inc/modules/admin/what-send_bonus.php +++ b/inc/modules/admin/what-send_bonus.php @@ -51,7 +51,7 @@ if (!isExtensionActive('order')) { } // END - if // Set empty mode to "select" -if (!isGetRequestParameterSet('mode')) setGetRequestParameter('mode', "select"); +if (!isGetRequestParameterSet('mode')) setGetRequestParameter('mode', 'select'); if (isFormSent()) { // Deliver bonus mail diff --git a/inc/modules/member/what-categories.php b/inc/modules/member/what-categories.php index ce92c89530..1117465b0d 100644 --- a/inc/modules/member/what-categories.php +++ b/inc/modules/member/what-categories.php @@ -50,10 +50,13 @@ addMenuDescription('member', __FILE__); $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'; @@ -61,7 +64,7 @@ if ($cats > 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 @@ -120,7 +123,7 @@ if ($cats > 0) { } // 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); diff --git a/inc/modules/member/what-points.php b/inc/modules/member/what-points.php index 1b6db929f0..1f4d5d0ad0 100644 --- a/inc/modules/member/what-points.php +++ b/inc/modules/member/what-points.php @@ -49,16 +49,16 @@ addMenuDescription('member', __FILE__); // 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'; diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 1bf7eda6ef..1dd3aa1ca3 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -908,22 +908,22 @@ function countSumTotalData ($search, $tableName, $lookFor = 'id', $whereStatemen // 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__); } @@ -1580,21 +1580,9 @@ function subtractPoints ($subject, $userid, $points) { } // "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; diff --git a/templates/de/html/show_bonus_yr.tpl b/templates/de/html/show_bonus_yr.tpl index 9cb95a3016..1ff2789518 100644 --- a/templates/de/html/show_bonus_yr.tpl +++ b/templates/de/html/show_bonus_yr.tpl @@ -2,10 +2,10 @@ {--BONUS_SHOW_YOU_HAVE_CONFIRMED--} - $content[yr_tmark] - {--_ON--} $content[yr_level]. + $content[timemark] + {--_ON--} $content[level]. {--BONUS_SHOW_CONFIRMED_BONUS_IS--}: - $content[yr_points] {?POINTS?} + {%pipe,translateComma=$content[points]%} {?POINTS?} -- 2.30.2