X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmysql-manager.php;h=1def31192837709bc8214be54562fc4295a8229e;hp=70721b868773fb9db75e3baf9fbdf96b34ddff26;hb=1090de8d4e7bf659002468fec8571388e7487a00;hpb=fa3cca8d61ae4840e6781eb39ed69c9ca89fe172 diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 70721b8687..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]); @@ -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 ------------------------