X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmysql-manager.php;h=ce69ffa3eec6937b46eead2ebc738ee7b01e2ffc;hb=83b592ec7b67258426acab646f682830ce9128c7;hp=910f6a551360e8c2d021bb3062e53d10177a66c6;hpb=15d03825972c38fbd95abad41f304c7494c5a70e;p=mailer.git diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 910f6a5513..ce69ffa3ee 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -47,7 +47,7 @@ if (!defined('__SECURITY')) { function getTitleFromMenu ($mode, $what, $column = 'what', $ADD='') { // Fix empty 'what' if (empty($what)) { - $what = getConfig('index_home'); + $what = getIndexHome(); } // END - if // Default is not found @@ -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'; @@ -125,7 +125,7 @@ function addMenuDescription ($accessLevel, $FQFN, $return = false) { } // Begin the navigation line - if ((!isset($GLOBALS['nav_depth'])) && ($return === false)) { + if (!isset($GLOBALS['nav_depth'])) { // Init nav_depth $GLOBALS['nav_depth'] = '0'; @@ -147,7 +147,7 @@ function addMenuDescription ($accessLevel, $FQFN, $return = false) { if (substr($search, -4, 4) == '.php') { // Remove the .php $search = substr($search, 0, -4); - } // END - i + } // END - if if (((isExtensionInstalledAndNewer('sql_patches', '0.2.3')) && (getConfig('youre_here') == 'Y')) || ((isAdmin()) && ($modCheck == 'admin'))) { // Output HTML code @@ -454,7 +454,6 @@ function fetchUserData ($userid, $column = 'userid') { return true; } - // By default none was found $found = false; @@ -585,13 +584,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; @@ -732,7 +731,7 @@ function getActionFromModuleWhat ($module, $what) { } } elseif ((empty($what)) && ($module != 'admin')) { // Use configured 'home' - $what = getConfig('index_home'); + $what = getIndexHome(); } // END - if if ($module == 'admin') { @@ -872,7 +871,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 +893,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 +910,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 +996,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 ------------------------