X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmysql-manager.php;h=1def31192837709bc8214be54562fc4295a8229e;hp=3ef6deee4669c9f75d5b0843facf12450b3330e7;hb=1090de8d4e7bf659002468fec8571388e7487a00;hpb=9b3bd653b5103d8ec8e6188d7515aacebb5d6086 diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 3ef6deee46..1def311928 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -50,7 +50,7 @@ function ADD_MODULE_TITLE($mod) { $name = $cacheArray['modules']['title'][$mod]; // Update cache hits - $_CONFIG['cache_hits']++; + if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } } else { // Load from database $result = SQL_QUERY_ESC("SELECT title FROM "._MYSQL_PREFIX."_mod_reg WHERE module='%s' LIMIT 1", array($mod), __FILE__, __LINE__); @@ -115,7 +115,7 @@ function CHECK_MODULE($mod) { $mem = $cacheArray['modules']['mem_only'][$mod_chk]; // Update cache hits - $_CONFIG['cache_hits']++; + if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } $found = true; } else { // No, then we have to update it! @@ -191,9 +191,14 @@ function CHECK_MODULE($mod) { // Add menu description pending on given file name (without path!) function ADD_DESCR($ACC_LVL, $file, $return = false, $output = true) { global $DEPTH, $_CONFIG; + // Use only filename of the file ;) + $file = basename($file); + + // Init variables $LINK_ADD = ""; $OUT = ""; $AND = ""; + // First we have to do some analysis... - if (ereg("action-", $file)) { + if (substr($file, 0, 7) == "action-") { // This is an action file! $type = "action"; $search = substr($file, 7); @@ -210,7 +215,7 @@ function ADD_DESCR($ACC_LVL, $file, $return = false, $output = true) { break; } $AND = " AND (what='' OR what IS NULL)"; - } elseif (ereg("what-", $file)) { + } elseif (substr($file, 0, 5) == "what-") { // This is an admin what file! $type = "what"; $search = substr($file, 5); @@ -454,7 +459,7 @@ function IS_ADMIN($admin="") $valPass = $cacheArray['admin_hash']; } elseif ((!empty($passCookie)) && (isset($cacheArray['admins']['password'][$admin])) && (!empty($admin))) { // Count cache hits - $_CONFIG['cache_hits']++; + if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } // Login data is valid or not? $valPass = generatePassString($cacheArray['admins']['password'][$admin]); @@ -1070,16 +1075,16 @@ function REMOVE_RECEIVER(&$ARRAY, $key, $uid, $pool_id, $stats_id="", $bonus=fal return $ret; } // -function GET_TOTAL_DATA($search, $tableName, $lookFor, $whereStatement="userid", $onlyRows=false) { +function GET_TOTAL_DATA($search, $tableName, $lookFor, $whereStatement="userid", $onlyRows=false, $add="") { $ret = 0; if ($onlyRows) { // Count rows - $result = SQL_QUERY_ESC("SELECT COUNT(%s) FROM "._MYSQL_PREFIX."_%s WHERE %s='%s'", - array($lookFor, $tableName, $whereStatement, $search), __FILE__, __LINE__); + $result = SQL_QUERY_ESC("SELECT COUNT(%s) FROM "._MYSQL_PREFIX."_%s WHERE %s='%s'%s", + array($lookFor, $tableName, $whereStatement, $search, $add), __FILE__, __LINE__); } else { // Add all rows - $result = SQL_QUERY_ESC("SELECT SUM(%s) FROM "._MYSQL_PREFIX."_%s WHERE %s='%s'", - array($lookFor, $tableName, $whereStatement, $search), __FILE__, __LINE__); + $result = SQL_QUERY_ESC("SELECT SUM(%s) FROM "._MYSQL_PREFIX."_%s WHERE %s='%s'%s", + array($lookFor, $tableName, $whereStatement, $search, $add), __FILE__, __LINE__); } // Load row @@ -1112,7 +1117,7 @@ function GET_REF_LEVEL_PERCENTS ($level) { $per = $cacheArray['ref_depths']['percents'][$key]; // Count cache hit - $_CONFIG['cache_hits']++; + if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } } } else { // Get referal data @@ -1134,15 +1139,15 @@ function GET_REF_LEVEL_PERCENTS ($level) { } /** * - * Dynamic referral system, can also send mails! + * Dynamic referal system, can also send mails! * - * uid = Referral ID wich should receive... + * uid = Referal ID wich should receive... * points = ... xxx points - * send_notify = shall I send the referral an email or not? + * send_notify = shall I send the referal an email or not? * rid = inc/modules/guest/what-confirm.php need this (DEPRECATED???) * locked = Shall I pay it to normal (false) or locked (true) points ammount? * add_mode = Add points only to $uid or also refs? (WARNING! Changing "ref" to "direct" - * for default value will cause no referral will get points ever!!!) + * for default value will cause no referal will get points ever!!!) */ function ADD_POINTS_REFSYSTEM($uid, $points, $send_notify=false, $rid="0", $locked=false, $add_mode="ref") { //* DEBUG: */ print "----------------------- ".__FUNCTION__." - ENTRY ------------------------