X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmysql-manager.php;h=af1420e77eadad4541423c93838bdeb7db71fd63;hp=45bd10646e9804c46928bb3529564d119a00a42f;hb=537df432292cb0aa63070479258e3e84b182a28b;hpb=a226d81121cb96048b1ed85fd8584a87d435b0db diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 45bd10646e..af1420e77e 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -109,7 +109,7 @@ function addMenuDescription ($accessLevel, $FQFN, $return = false) { if (isAdmin()) $ADD = ''; $dummy = substr($search, 0, -4); - $ADD .= " AND `action`='".getActionFromModuleWhat($accessLevel, $dummy)."'"; + $ADD .= sprintf(" AND `action`='%s'", getActionFromModuleWhat($accessLevel, $dummy)); } elseif (($accessLevel == 'sponsor') || ($accessLevel == 'engine')) { // Sponsor / engine menu $type = 'what'; @@ -585,13 +585,13 @@ function addMaxReceiveList ($mode, $default = '', $return = false) { switch ($mode) { case 'guest': // Guests (in the registration form) are not allowed to select 0 mails per day. - $result = SQL_QUERY("SELECT `value`, `comment` FROM `{?_MYSQL_PREFIX?}_max_receive` WHERE `value` > 0 ORDER BY `value` ASC", + $result = SQL_QUERY('SELECT `value`, `comment` FROM `{?_MYSQL_PREFIX?}_max_receive` WHERE `value` > 0 ORDER BY `value` ASC', __FUNCTION__, __LINE__); break; case 'member': // Members are allowed to set to zero mails per day (we will change this soon!) - $result = SQL_QUERY("SELECT `value`, `comment` FROM `{?_MYSQL_PREFIX?}_max_receive` ORDER BY `value` ASC", + $result = SQL_QUERY('SELECT `value`, `comment` FROM `{?_MYSQL_PREFIX?}_max_receive` ORDER BY `value` ASC', __FUNCTION__, __LINE__); break; @@ -872,7 +872,10 @@ function removeReceiver (&$receivers, $key, $userid, $pool_id, $stats_id = '', $ if ($stats_id > 0) { // Only when we got a real stats id continue searching for the entry $type = 'NORMAL'; $rowName = 'stats_id'; - if ($bonus) { $type = 'BONUS'; $rowName = 'bonus_id'; } + if ($bonus) { + $type = 'BONUS'; + $rowName = 'bonus_id'; + } // END - if // Try to look the entry up $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE %s='%s' AND `userid`=%s AND link_type='%s' LIMIT 1", @@ -891,8 +894,8 @@ function removeReceiver (&$receivers, $key, $userid, $pool_id, $stats_id = '', $ // Free memory SQL_FREERESULT($result); - } - } + } // END - if + } // END - if // Return status for sending routine return $ret; @@ -908,22 +911,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__); } @@ -994,7 +997,7 @@ function getReferalLevelPercents ($level) { * add_mode = Add points only to $userid or also refs? (WARNING! Changing 'ref' to 'direct' * for default value will cause no referal will get points ever!!!) */ -function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify = false, $refid = '0', $locked = false, $add_mode = 'ref') { +function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify = false, $refid = '0', $add_mode = 'ref') { //* DEBUG: */ debugOutput('----------------------- ' . __FUNCTION__ . ' - ENTRY ------------------------