define('SERVER_URL', "http://www.mxchange.org");
// Current SVN revision
-define('CURR_SVN_REVISION', "689");
+define('CURR_SVN_REVISION', "690");
// Take a prime number which is long (if you know a longer one please try it out!)
define('_PRIME', 591623);
// Check if given extension is active
function EXT_IS_ACTIVE ($ext_name) {
- global $cacheArray, $_CONFIG;
+ global $cacheArray;
// Extensions are all inactive during installation
if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing')) || (empty($ext_name))) return false;
$active = $cacheArray['extensions']['ext_active'][$ext_name];
// Count cache hits
- if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ incrementConfigEntry('cache_hits');
} elseif (($ext_name == "cache") || (GET_EXT_VERSION("cache") == "")) {
//* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "DB! ext_name={$ext_name}");
// Load from database
}
// Get version from extensions
function GET_EXT_VERSION ($ext_name) {
- global $cacheArray, $_CONFIG, $cacheInstance;
+ global $cacheArray, $cacheInstance;
$ext_ver = false;
// Extensions are all inactive during installation
$ext_ver = $cacheArray['extensions']['ext_version'][$ext_name];
// Count cache hits
- if (getConfig('cache_hits') > 0) $_CONFIG['cache_hits']++; else $_CONFIG['cache_hits'] = 1;
+ incrementConfigEntry('cache_hits');
} elseif (!is_object($cacheInstance)) {
// Load from database
$result = SQL_QUERY_ESC("SELECT ext_version FROM "._MYSQL_PREFIX."_extensions WHERE ext_name='%s' LIMIT 1",
// Get extension name from id
function GET_EXT_NAME ($ext_id) {
- global $cacheArray, $_CONFIG;
+ global $cacheArray;
// Init extension name
$ret = "";
$ret = $cacheArray['extensions']['ext_name'][$ext_id];
// Count cache hits
- if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ incrementConfigEntry('cache_hits');
} elseif (!EXT_IS_ACTIVE("cache")) {
// Load from database
$result = SQL_QUERY_ESC("SELECT ext_name FROM "._MYSQL_PREFIX."_extensions WHERE id=%s LIMIT 1",
// Get extension id from name
function GET_EXT_ID ($ext_name) {
- global $cacheArray, $_CONFIG;
+ global $cacheArray;
// Init ID number
$ret = 0;
$ret = $cacheArray['extensions']['ext_id'][$ext_name];
// Count cache hits
- if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ incrementConfigEntry('cache_hits');
} elseif (!EXT_IS_ACTIVE("cache")) {
// Load from database
$result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_extensions WHERE ext_name='%s' LIMIT 1",
// Checks if the module has a menu
function MODULE_HAS_MENU ($mod, $forceDb = false) {
- global $cacheArray, $_CONFIG;
+ global $cacheArray;
// All is false by default
$ret = false;
if (isset($cacheArray['modules']['has_menu'][$mod])) {
// Check module cache and count hit
$ret = ($cacheArray['modules']['has_menu'][$mod] == "Y");
- if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ incrementConfigEntry('cache_hits');
} elseif (isset($cacheArray['extensions']['ext_menu'][$mod])) {
// Check cache and count hit
$ret = ($cacheArray['extensions']['ext_menu'][$mod] == "Y");
- if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ incrementConfigEntry('cache_hits');
} elseif ((IS_ADMIN()) && ($mod == "admin")) {
// Admin module has always a menu!
$ret = true;
//
// Generate a password in a specified length or use default password length
-function GEN_PASS($LEN = 0) {
- global $_CONFIG;
+function GEN_PASS ($LEN = 0) {
+ // Auto-fix invalid length of zero
if ($LEN == 0) $LEN = getConfig('pass_len');
// Initialize array with all allowed chars
}
//
function SET_LANGUAGE($lang) {
- global $_CONFIG;
-
// Accept only first 2 chars!
$lang = substr(SQL_ESCAPE(strip_tags($lang)), 0, 2);
}
//
function LOAD_EMAIL_TEMPLATE($template, $content=array(), $UID="0") {
- global $DATA, $_CONFIG, $REPLACER;
+ global $DATA, $REPLACER;
// Make sure all template names are lowercase!
$template = strtolower($template);
}
//
function LOAD_URL($URL, $addUrlData=true) {
- global $CSS, $_CONFIG, $footer;
+ global $CSS, $footer;
// Compile out URI codes
$URL = COMPILE_CODE($URL);
}
//
function ADD_SELECTION($type, $DEFAULT, $prefix="", $id="0") {
- global $MONTH_DESCR, $_CONFIG;
+ global $MONTH_DESCR;
$OUT = "";
if ($type == "yn") {
// Optional : $DATA
//
function GEN_RANDOM_CODE($length, $code, $uid, $DATA="") {
- global $_CONFIG;
-
// Fix missing _MAX constant
if (!defined('_MAX')) define('_MAX', 15235);
}
// Insert the code in $img_code into jpeg or PNG image
function GENERATE_IMAGE($img_code, $header=true) {
- global $_CONFIG;
-
if ((strlen($img_code) > 6) || (empty($img_code)) || (getConfig('code_length') == 0)) {
// Stop execution of function here because of over-sized code length
return;
}
// Create selection box or array of splitted timestamp
function CREATE_TIME_SELECTIONS ($timestamp, $prefix="", $display="", $align="center", $return_array=false) {
- global $_CONFIG;
-
// Calculate 2-seconds timestamp
$stamp = round($timestamp);
//* DEBUG: */ print("*".$stamp."/".$timestamp."*<br />");
return $OUT;
}
//
-function CREATE_TIMESTAMP_FROM_SELECTIONS($prefix, $POST) {
- global $_CONFIG;
+function CREATE_TIMESTAMP_FROM_SELECTIONS ($prefix, $POST) {
+ // Initial return value
$ret = 0;
// Do we have a leap year?
// Sends a raw request to another host
function SEND_RAW_REQUEST ($host, $request) {
- global $_CONFIG;
-
// Initialize array
$response = array("", "", "");
}
// Generate a hash for extra-security for all passwords
function generateHash ($plainText, $salt = "") {
- global $_CONFIG, $_SERVER;
+ global $_SERVER;
// Is the required extension "sql_patches" there and a salt is not given?
if (((EXT_VERSION_IS_OLDER("sql_patches", "0.3.6")) || (!EXT_IS_ACTIVE("sql_patches"))) && (empty($salt))) {
}
//
function scrambleString($str) {
- global $_CONFIG;
-
// Init
$scrambled = "";
}
//
function descrambleString($str) {
- global $_CONFIG;
// Scramble only 40 chars long strings
if (strlen($str) != 40) return $str;
}
// Append data like session ID or referal ID to the given URL which would
// normally be stored in cookies
-function ADD_URL_DATA($URL) {
- global $_CONFIG;
+function ADD_URL_DATA ($URL) {
+ // Init add
$ADD = "";
// Determine URL binder
}
// Generate an PGP-like encrypted hash of given hash for e.g. cookies
function generatePassString($passHash) {
- global $_CONFIG;
-
// Return vanilla password hash
$ret = $passHash;
// Display parsing time and number of SQL queries in footer
function DISPLAY_PARSING_TIME_FOOTER() {
- global $_CONFIG;
-
// Is the timer started?
if (!isset($GLOBALS['startTime'])) {
// Abort here
}
// Load more reset scripts
function RESET_ADD_INCLUDES () {
- global $_CONFIG;
-
// Is the reset set or old sql_patches?
if ((!defined('__DAILY_RESET')) || (EXT_VERSION_IS_OLDER("sql_patches", "0.4.5"))) {
// Then abort here
}
// Rebuild cache
function REBUILD_CACHE ($cache, $inc="") {
- global $cacheInstance, $_CONFIG, $CSS;
+ global $cacheInstance, $CSS;
// Shall I remove the cache file?
if ((EXT_IS_ACTIVE("cache")) && (is_object($cacheInstance))) {
}
// Determines referal id and sets it
function DETERMINE_REFID () {
- global $_CONFIG, $CLICK, $_SERVER;
+ global $CLICK, $_SERVER;
// Check if refid is set
if ((!empty($_GET['user'])) && ($CLICK == 1) && (basename($_SERVER['PHP_SELF']) == "click.php")) {
// Get current theme name
function GET_CURR_THEME() {
- global $INC_POOL, $_CONFIG, $CSS, $cacheArray;
+ global $INC_POOL, $CSS, $cacheArray;
// The default theme is 'default'... ;-)
$ret = "default";
// Get id from theme
function THEME_GET_ID ($name) {
- global $cacheArray, $_CONFIG;
+ global $cacheArray;
// Is the extension "theme" installed?
if (!EXT_IS_ACTIVE("theme")) {
$id = $cacheArray['themes']['id'][$name];
// Count up
- if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ incrementConfigEntry('cache_hits');
} elseif (GET_EXT_VERSION("cache") != "0.1.8") {
// Check if current theme is already imported or not
$result = SQL_QUERY_ESC("SELECT id FROM `"._MYSQL_PREFIX."_themes` WHERE theme_path='%s' LIMIT 1",
return $id;
}
+// Increment or init with 1 the given config entry
+function incrementConfigEntry ($configEntry) {
+ global $_CONFIG;
+
+ // Increment it if set or init it with 1
+ if (getConfig($configEntry) > 0) { $_CONFIG[$configEntry]++; } else { $_CONFIG[$configEntry] = 1; }
+}
+
//////////////////////////////////////////////////
// //
// AUTOMATICALLY RE-GENERATED MISSING FUNCTIONS //
// Check ACL for menu combination
function ADMINS_CHECK_ACL($act, $wht) {
- global $cacheArray, $_CONFIG, $cacheInstance;
+ global $cacheArray, $cacheInstance;
// If action is login or logout allow allways!
$default = "allow";
if (($act == "login") || ($act == "logout")) return true;
}
if ($lines == 1) {
// Count cache hits
- if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ incrementConfigEntry('cache_hits');
break;
}
}
{
// Global data array for LOAD_EMAIL_TEMPLATE()
$DATA = array();
- global $DATA, $_CONFIG;
+ global $DATA;
// Load all rallyes (usally we have only one rallye active per time!
list($id, $title, $start, $end, $notify, $min_users, $min_prices) = SQL_FETCHROW($result);
//
function RALLYE_ADD_TOPUSERS($rallye,$default=0)
{
- global $_CONFIG;
-
// First check how many prices are set
$result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_rallye_prices WHERE rallye_id=%s ORDER BY price_level",
array(bigintval($rallye)), __FILE__, __LINE__);
//
function RALLYE_EXPIRE_RALLYES($result)
{
- global $DATA, $_CONFIG;
+ global $DATA;
// Load rallye data
list($id, $title, $start, $end, $notify, $min_users, $min_prices) = SQL_FETCHROW($result);
//
function RALLYE_DELETE_EXPIRED_RALLYES()
{
- global $DATA, $_CONFIG;
+ global $DATA;
// Check for expired rallyes
$EXPIRE = getConfig('one_day') * 3; // @TODO The hard-coded value...
}
//
function RALLYE_GET_REFCOUNT($uid, $old=0) {
- global $_CONFIG, $cacheArray;
+ global $cacheArray;
// Check current refs
if (GET_EXT_VERSION("cache") >= "0.1.2") {
if ($cnt > 0) {
// Count cache hits
- if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ incrementConfigEntry('cache_hits');
// Remove old refs
//* DEBUG: */ echo "+".$cnt."/".$old."+<br />";
WHERE s.userid=%s AND s.level=1", array(bigintval($uid)), __FILE__, __LINE__);
list($cnt) = SQL_FETCHROW($result_ref);
SQL_FREERESULT($result_ref);
- if (empty($cnt))
- {
+ if (empty($cnt)) {
$cnt = 0;
- }
- else
- {
+ } else {
$cnt -= $old;
}
}
// Get version from name
function THEME_GET_VERSION ($name) {
- global $cacheArray, $_CONFIG;
+ global $cacheArray;
// Is the extension "theme" installed?
if (!EXT_IS_ACTIVE("theme")) {
$cver = $cacheArray['themes']['theme_ver'][$name];
// Count up
- if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ incrementConfigEntry('cache_hits');
} elseif (GET_EXT_VERSION("cache") != "0.1.8") {
// Load version from database
$result = SQL_QUERY_ESC("SELECT theme_ver FROM `"._MYSQL_PREFIX."_themes` WHERE theme_path='%s' LIMIT 1",
// Checks if a theme is active
function THEME_IS_ACTIVE ($name) {
- global $cacheArray, $_CONFIG;
+ global $cacheArray;
// Is the extension "theme" installed?
if (!EXT_IS_ACTIVE("theme")) {
$active = ($cacheArray['themes']['theme_active'][$name] == "Y");
// Count up
- if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ incrementConfigEntry('cache_hits');
} elseif (GET_EXT_VERSION("cache") != "0.1.8") {
// Check if current theme is already imported or not
$result = SQL_QUERY_ESC("SELECT theme_active FROM `"._MYSQL_PREFIX."_themes` WHERE theme_path='%s' AND theme_active='Y' LIMIT 1",
// Gets current human-readable theme name
function GET_CURR_THEME_NAME () {
- global $cacheArray, $_CONFIG;
+ global $cacheArray;
// Is the extension "theme" installed?
if (!EXT_IS_ACTIVE("theme")) {
$name = $cacheArray['themes']['theme_name'][$name];
// Count up
- if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ incrementConfigEntry('cache_hits');
} elseif (GET_EXT_VERSION("cache") != "0.1.8") {
// Check if current theme is already imported or not
$result = SQL_QUERY_ESC("SELECT theme_name FROM `"._MYSQL_PREFIX."_themes` WHERE theme_path='%s' AND theme_active='Y' LIMIT 1",
}
// Only be executed on login procedure!
function CHECK_ADMIN_LOGIN ($admin_login, $password) {
- global $cacheArray, $_CONFIG, $cacheInstance;
+ global $cacheArray, $cacheInstance;
// By default no admin is found
$ret = "404";
// Get password from cache
$data['password'] = $cacheArray['admins']['password'][$aid];
$ret = "pass";
- if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ incrementConfigEntry('cache_hits');
// Include more admins data?
if (GET_EXT_VERSION("admins") >= "0.7.0") {
// Only be executed on cookie checking
function CHECK_ADMIN_COOKIES ($admin_login, $password) {
- global $cacheArray, $_CONFIG;
+ global $cacheArray;
$ret = "404"; $pass = "";
// Get hash
//
function ADMIN_DO_ACTION($wht) {
- global $menuDesription, $menuTitle, $_CONFIG, $cacheArray, $DATA;
+ global $menuDesription, $menuTitle, $cacheArray, $DATA;
//* DEBUG: */ echo __LINE__."*".$wht."/".$GLOBALS['module']."/".$GLOBALS['action']."/".$GLOBALS['what']."*<br />\n";
if (EXT_IS_ACTIVE("cache")) {
}
//
function ADD_ADMIN_MENU($act, $wht, $return=false) {
- global $menuDesription, $menuTitle, $cacheInstance, $_CONFIG;
+ global $menuDesription, $menuTitle, $cacheInstance;
// Init variables
$SUB = false;
}
//
function ADMIN_CHECK_MENU_MODE() {
- global $_CONFIG, $cacheArray;
+ global $cacheArray;
// Set the global mode as the mode for all admins
$MODE = getConfig('admin_menu');
if (isset($cacheArray['admins']['la_mode'][$aid])) {
// Load from cache
$ADMIN = $cacheArray['admins']['la_mode'][$aid];
- if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ incrementConfigEntry('cache_hits');
} elseif (GET_EXT_VERSION("admins") >= "0.6.7") {
// Load from database when version of "admins" is enough
$result = SQL_QUERY_ESC("SELECT la_mode FROM "._MYSQL_PREFIX."_admins WHERE id=%s LIMIT 1",
}
// Change activation status
function ADMIN_CHANGE_ACTIVATION_STATUS ($IDs, $table, $row, $idRow = "id") {
- global $_CONFIG;
$cnt = 0; $newStatus = "Y";
if ((is_array($IDs)) && (count($IDs) > 0)) {
// "Walk" all through and count them
}
// Build a special template list
function ADMIN_BUILD_LIST ($listType, $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn) {
- global $_CONFIG;
$OUT = ""; $SW = 2;
// "Walk" through all entries
}
// Sends out a link to the given email adress so the admin can reset his/her password
function ADMIN_SEND_PASSWORD_RESET_LINK ($email) {
- global $_CONFIG;
// Init output
$OUT = "";
//
function ADD_MODULE_TITLE($mod) {
- global $cacheArray, $_CONFIG;
+ global $cacheArray;
$name = ""; $result = false;
// Is the script installed?
$name = $cacheArray['modules']['title'][$mod];
// Update cache hits
- if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ incrementConfigEntry('cache_hits');
} elseif (!EXT_IS_ACTIVE("cache")) {
// Load from database
$result = SQL_QUERY_ESC("SELECT title FROM "._MYSQL_PREFIX."_mod_reg WHERE module='%s' LIMIT 1", array($mod), __FILE__, __LINE__);
// Check validity of a given module name (no file extension)
function CHECK_MODULE ($mod) {
// We need them now here...
- global $cacheArray, $_CONFIG, $cacheInstance;
+ global $cacheArray, $cacheInstance;
// Filter module name (names with low chars and underlines are fine!)
$mod = preg_replace("/[^a-z_]/", "", $mod);
$mem = $cacheArray['modules']['mem_only'][$mod_chk];
// Update cache hits
- if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ incrementConfigEntry('cache_hits');
$found = true;
} else {
// No, then we have to update it!
}
// Add menu description pending on given file name (without path!)
-function ADD_DESCR($ACC_LVL, $file, $return = false, $output = true) {
- global $NAV_DEPTH, $_CONFIG;
+function ADD_DESCR ($ACC_LVL, $file, $return = false, $output = true) {
+ global $NAV_DEPTH;
// Use only filename of the file ;)
$file = basename($file);
// Can we close the you-are-here navigation?
//* DEBUG: */ echo __LINE__."*".$type."/".$GLOBALS['what']."*<br />\n";
- //* DEBUG: */ die("<pre>".print_r($_CONFIG, true)."</pre>");
if (($type == "what") || (($type == "action") && ((!isset($GLOBALS['what'])) || ($GLOBALS['what'] == "overview")))) {
//* DEBUG: */ echo __LINE__."+".$type."+<br />\n";
// Add closing div and br-tag
}
}
//
-function ADD_MENU($MODE, $act, $wht) {
- global $_CONFIG;
-
+function ADD_MENU ($MODE, $act, $wht) {
// Init some variables
$main_cnt = 0;
$AND = "";
}
}
// This patched function will reduce many SELECT queries for the specified or current admin login
-function IS_ADMIN($admin="")
-{
- global $cacheArray, $_CONFIG;
+function IS_ADMIN ($admin="") {
+ global $cacheArray;
+
+ // Init variables
$ret = false; $passCookie = ""; $valPass = "";
//* DEBUG: */ echo __LINE__."ADMIN:".$admin."<br />";
$valPass = $cacheArray['admin_hash'];
} elseif ((!empty($passCookie)) && (isset($cacheArray['admins']['password'][$admin])) && (!empty($admin))) {
// Count cache hits
- if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ incrementConfigEntry('cache_hits');
// Login data is valid or not?
$valPass = generatePassString($cacheArray['admins']['password'][$admin]);
return $ret;
}
//
-function SEND_MODE_MAILS($mod, $modes)
-{
- global $_CONFIG, $DATA;
+function SEND_MODE_MAILS($mod, $modes) {
+ global $DATA;
// Load hash
$result_main = SQL_QUERY_ESC("SELECT password FROM `"._MYSQL_PREFIX."_user_data` WHERE userid=%s AND status='CONFIRMED' LIMIT 1",
} // END - if
}
// Get action value from mode (admin/guest/member) and what-value
-function GET_ACTION ($MODE, &$wht)
-{
- global $ret, $_CONFIG;
+function GET_ACTION ($MODE, &$wht) {
+ global $ret;
+
// @DEPRECATED Init status
$ret = "";
}
// "Getter fro ref level percents
function GET_REF_LEVEL_PERCENTS ($level) {
- global $cacheInstance, $_CONFIG, $cacheArray;
+ global $cacheInstance, $cacheArray;
// Default is zero
$per = 0;
$per = $cacheArray['ref_depths']['percents'][$key];
// Count cache hit
- if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ incrementConfigEntry('cache_hits');
}
} elseif (!EXT_IS_ACTIVE("cache")) {
// Get referal data
*/
function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify=false, $rid="0", $locked=false, $add_mode="ref") {
//* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
- global $_CONFIG, $DATA, $cacheArray;
+ global $DATA, $cacheArray;
// Convert mode to lower-case
$add_mode = strtolower($add_mode);
// Get ID number from administrator's login name
function GET_ADMIN_ID ($login) {
- global $cacheArray, $_CONFIG;
+ global $cacheArray;
$ret = "-1";
if (isset($cacheArray['admins']['aid'][$login])) {
// Check cache
$ret = $cacheArray['admins']['aid'][$login];
// Update cache hits
- if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ incrementConfigEntry('cache_hits');
} elseif (!EXT_IS_ACTIVE("cache")) {
// Load from database
$result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_admins WHERE login='%s' LIMIT 1",
// Get password hash from administrator's login name
function GET_ADMIN_HASH ($aid)
{
- global $cacheArray, $_CONFIG;
+ global $cacheArray;
$ret = "-1";
if (isset($cacheArray['admins']['password'][$aid])) {
// Check cache
$ret = $cacheArray['admins']['password'][$aid];
// Update cache hits
- if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ incrementConfigEntry('cache_hits');
} elseif (!EXT_IS_ACTIVE("cache")) {
// Load from database
$result = SQL_QUERY_ESC("SELECT password FROM "._MYSQL_PREFIX."_admins WHERE id=%s LIMIT 1",
}
//
function GET_ADMIN_LOGIN ($aid) {
- global $cacheArray, $_CONFIG;
+ global $cacheArray;
$ret = "***";
if (isset($cacheArray['admins']['login'][$aid])) {
// Get cache
$ret = $cacheArray['admins']['login'][$aid];
// Update cache hits
- if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ incrementConfigEntry('cache_hits');
} elseif (!EXT_IS_ACTIVE("cache")) {
// Load from database
$result = SQL_QUERY_ESC("SELECT login FROM "._MYSQL_PREFIX."_admins WHERE id=%s LIMIT 1",
}
// Get email address of admin id
function GET_ADMIN_EMAIL ($aid) {
- global $cacheArray, $_CONFIG;
+ global $cacheArray;
$ret = "***";
if (isset($cacheArray['admins']['email'][$aid])) {
$ret = $cacheArray['admins']['email'][$aid];
// Update cache hits
- if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ incrementConfigEntry('cache_hits');
} elseif (!EXT_IS_ACTIVE("cache")) {
// Load from database
$result_aid = SQL_QUERY_ESC("SELECT email FROM "._MYSQL_PREFIX."_admins WHERE id=%s LIMIT 1",
}
// Get default ACL of admin id
function GET_ADMIN_DEFAULT_ACL ($aid) {
- global $cacheArray, $_CONFIG;
+ global $cacheArray;
$ret = "***";
if (isset($cacheArray['admins']['def_acl'][$aid])) {
$ret = $cacheArray['admins']['def_acl'][$aid];
// Update cache hits
- if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ incrementConfigEntry('cache_hits');
} elseif (!EXT_IS_ACTIVE("cache")) {
// Load from database
$result_aid = SQL_QUERY_ESC("SELECT default_acl FROM "._MYSQL_PREFIX."_admins WHERE id=%s LIMIT 1",
// Ok, delete the account!
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_user_data` WHERE userid=%s LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__);
}
+
//
function META_DESCRIPTION ($mod, $wht) {
- global $_CONFIG;
-
// Exclude admin and member's area
if (($mod != "admin") && ($mod != "login")) {
// Construct dynamic description
}
// Gets the matching what name from module
function GET_WHAT($modCheck) {
- global $_CONFIG;
-
$wht = "";
//* DEBUG: */ echo __LINE__."!".$modCheck."!<br />\n";
switch ($modCheck)
// Generate a receiver list for given category and maximum receivers
function GENERATE_RECEIVER_LIST ($cat, $receiver, $mode="") {
- global $_CONFIG;
-
// Init variables
$CAT_TABS = "%s";
$CAT_WHERE = "";
// "Getter" for array for user refs and points in given level
function GET_USER_REF_POINTS ($uid, $level) {
- global $_CONFIG;
-
//* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
// Default is no refs and no nickname
$ADD = "";