X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmysql-manager.php;h=bf54a9f45b5b4dff9450c065025295a88bdff584;hp=186b1d43e1c678457ef27ae9e0f24ac82e7a75c6;hb=40e18f1f10e4c7b3e63cf728567459a2cc0dcbd5;hpb=dfaa8c1675da4071ea451406a6f6fedd4c568416 diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 186b1d43e1..bf54a9f45b 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,7 +191,12 @@ 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)) { // This is an action file! @@ -282,8 +287,17 @@ function ADD_DESCR($ACC_LVL, $file, $return = false, $output = true) { //* DEBUG: */ die("
".print_r($_CONFIG, true)."
"); if (($type == "what") || (($type == "action") && ((!isset($GLOBALS['what'])) || ($GLOBALS['what'] == "overview")))) { //* DEBUG: */ echo __LINE__."+".$type."+
\n"; - $OUT .= "
\n"; - $DEPTH="0"; + $OUT .= "\n"; + + // Extension removeip activated? + if ((EXT_IS_ACTIVE("removeip")) && (isset($_CONFIG['removeip_'.strtolower($ACC_LVL).'_show'])) && ($_CONFIG['removeip_'.strtolower($ACC_LVL).'_show'] == "Y")) { + // Add anoymity/privacy infos + $OUT .= REMOVEIP_ADD_INFOS(); + } // END - if + + // Add line-break tag + $OUT .= "
\n"; + $DEPTH = "0"; // Handle failed logins here if not in guest //* DEBUG: */ print __FUNCTION__."(".__LINE__."):type={$type},action={$GLOBALS['action']},what={$GLOBALS['what']},lvl={$ACC_LVL}
\n"; @@ -445,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]); @@ -629,6 +643,7 @@ function IS_MEMBER() } else { // Cookie data is invalid! //* DEBUG: */ echo __LINE__."***
"; + destroy_user_session(); // Reset userid $GLOBALS['userid'] = 0; @@ -689,8 +704,8 @@ function UPDATE_LOGIN_DATA () { } // END - if // Update last module / online time - $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET last_module='%s', last_online=UNIX_TIMESTAMP() WHERE userid=%s LIMIT 1", - array($GLOBALS['what'], $GLOBALS['userid']), __FILE__, __LINE__); + $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET last_module='%s', last_online=UNIX_TIMESTAMP(), REMOTE_ADDR='%s' WHERE userid=%s LIMIT 1", + array($GLOBALS['what'], GET_REMOTE_ADDR(), $GLOBALS['userid']), __FILE__, __LINE__); } } else { // Destroy session, we cannot update! @@ -1060,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 @@ -1102,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 @@ -1124,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 ------------------------