From: Roland Häder Date: Mon, 23 Feb 2009 17:24:15 +0000 (+0000) Subject: More references to removed (still some left) X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=commitdiff_plain;h=c5e685ff1b1bd296243b9bfcd8921969fa09d53f More references to removed (still some left) --- diff --git a/inc/extensions.php b/inc/extensions.php index b3604ccdb4..90a5af3374 100644 --- a/inc/extensions.php +++ b/inc/extensions.php @@ -499,9 +499,15 @@ function EXTENSION_UPDATE ($ext_name, $ext_ver, $dry_run = false) { } // Output verbose SQL table for extension -function EXTENSION_VERBOSE_TABLE ($queries = array(), $title = ADMIN_SQLS_EXECUTED_ON_REMOVAL, $dashed = "", $switch = false, $width = "100%") { +function EXTENSION_VERBOSE_TABLE ($queries = array(), $title = "", $dashed = "", $switch = false, $width = "100%") { global $SQLs; + // Empty title? + if (empty($title)) { + // Then fix it to default + $title = getMessage('ADMIN_SQLS_EXECUTED_ON_REMOVAL'); + } // END - if + // Are there some queries in $queries? if (count($queries) > 0) { // Then use them instead! diff --git a/inc/libs/beg_functions.php b/inc/libs/beg_functions.php index 62e5949ba1..31cbc83d2d 100644 --- a/inc/libs/beg_functions.php +++ b/inc/libs/beg_functions.php @@ -39,8 +39,6 @@ if (!defined('__SECURITY')) { // Add points to user or begging rallye account function BEG_ADD_POINTS ($uid, $points) { - global $_CONFIG; - // Set mode depending on how many mails the member has to confirm $locked = false; if ((getConfig('ref_payout') > 0) && (getConfig('allow_direct_pay') != "Y")) $locked = true; diff --git a/inc/libs/bonus_functions.php b/inc/libs/bonus_functions.php index b5ea9b2b9f..f97467bf1b 100644 --- a/inc/libs/bonus_functions.php +++ b/inc/libs/bonus_functions.php @@ -38,9 +38,7 @@ if (!defined('__SECURITY')) { } // This function must be run *BEFORE* a link is removed from table 'mxchange_user_links' ! -function BONUS_ADD_TURBO_POINTS($mid, $uid, $type) { - global $_CONFIG; - +function BONUS_ADD_TURBO_POINTS ($mid, $uid, $type) { // Shall we add bonus points? if (getConfig('bonus_active') != "Y") return false; @@ -112,7 +110,6 @@ function BONUS_ADD_TURBO_POINTS($mid, $uid, $type) { } // function BONUS_MAKE_RANK_ROWS ($data, $type, $uid) { - global $_CONFIG; $self = false; $OUT = ""; // How many ranks do we have? @@ -188,8 +185,6 @@ function BONUS_MAKE_RANK_ROWS ($data, $type, $uid) { } // function BONUS_POINTS_HANDLER ($MODE) { - global $_CONFIG; - // Shall we add bonus points? if (getConfig('bonus_active') != "Y") return; @@ -234,11 +229,9 @@ function BONUS_POINTS_HANDLER ($MODE) { break; } } -// -function BONUS_PURGE_EXPIRED_TURBO_BONUS() -{ - global $_CONFIG; +// +function BONUS_PURGE_EXPIRED_TURBO_BONUS() { // Remove entries $result = SQL_QUERY("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_bonus_turbo` WHERE timemark < (UNIX_TIMESTAMP() - ".getConfig('bonus_timeout').")", __FILE__, __LINE__); if (SQL_AFFECTEDROWS() > 0) { diff --git a/inc/libs/doubler_functions.php b/inc/libs/doubler_functions.php index be2f18c129..4d64435e51 100644 --- a/inc/libs/doubler_functions.php +++ b/inc/libs/doubler_functions.php @@ -40,18 +40,17 @@ if (!defined('__SECURITY')) { // Generates a HTML table based on given data // @TODO Lame description function DOUBLER_GENERATE_TABLE ($uid="0", $done='N', $ref='N', $sort="ASC") { - global $_CONFIG; if (empty($cnt)) $cnt = 0; $ADD = ""; $DT_MODE = 0; if ($uid > 0) { // Load entries only from a single user $ADD = " AND userid='".bigintval($uid)."'"; $MODE = "member"; $COLS = "4"; $DT_MODE = "2"; - $NOT_FOUND = DOUBLER_MEMBER_NO_ENTRIES_FOUND; + $NOT_FOUND = getMessage('DOUBLER_MEMBER_NO_ENTRIES_FOUND'); } else { // Guest mode! $MODE = "guest"; $COLS = "3"; $DT_MODE = "3"; - $NOT_FOUND = DOUBLER_GUEST_NO_ENTRIES_FOUND; + $NOT_FOUND = getMessage('DOUBLER_GUEST_NO_ENTRIES_FOUND'); } if (($done == "Y") && ($sort == "ASC")) { diff --git a/inc/libs/primera_functions.php b/inc/libs/primera_functions.php index 58c7f4fff8..34da5e8dd5 100644 --- a/inc/libs/primera_functions.php +++ b/inc/libs/primera_functions.php @@ -243,8 +243,6 @@ function PRIMERA_TEST_API () { } // Execute the withdraw of a sponsor only! function PRIMERA_EXECUTE_WITHDRAW ($primusNick, $userMd5, $amount) { - global $_CONFIG; - // Is the sponsor extension installed? if (!EXT_IS_ACTIVE("sponsor")) { // No, abort here @@ -258,7 +256,7 @@ function PRIMERA_EXECUTE_WITHDRAW ($primusNick, $userMd5, $amount) { $api = new PrimeraApi($primusNick, $userMd5); // Prepare purpose - $eval = "\$purpose = \"".COMPILE_CODE(sprintf(PRIMERA_API_PURPOSE_WITHDRAW, get_session('sponsorid')))."\";"; + $eval = "\$purpose = \"".COMPILE_CODE(sprintf(getMessage('PRIMERA_API_PURPOSE_WITHDRAW'), get_session('sponsorid')))."\";"; eval($eval); // Pay the Primera @@ -266,13 +264,11 @@ function PRIMERA_EXECUTE_WITHDRAW ($primusNick, $userMd5, $amount) { } // Execute the payout function PRIMERA_EXECUTE_PAYOUT ($primusNick, $userMd5, $amount) { - global $_CONFIG; - // Get new instance $api = new PrimeraApi(getConfig('primera_api_name'), getConfig('primera_api_md5')); // Prepare purpose - $eval = "\$purpose = \"".COMPILE_CODE(sprintf(PRIMERA_API_PURPOSE_PAYOUT, $GLOBALS['userid']))."\";"; + $eval = "\$purpose = \"".COMPILE_CODE(sprintf(getMessage('PRIMERA_API_PURPOSE_PAYOUT'), $GLOBALS['userid']))."\";"; eval($eval); // Pay the Primera diff --git a/inc/libs/rallye_functions.php b/inc/libs/rallye_functions.php index 3304a5f724..d156ee865b 100644 --- a/inc/libs/rallye_functions.php +++ b/inc/libs/rallye_functions.php @@ -514,8 +514,6 @@ function RALLYE_LOAD_PRICES_ARRAY($rallye) // function RALLYE_LOAD_USERS_ARRAY ($rallye) { - global $_CONFIG; - // Fix zero points to 0.00000 if (getConfig('ref_payout') == "0") setConfigEntry('ref_payout', "0.00000"); diff --git a/inc/libs/register_functions.php b/inc/libs/register_functions.php index 042ed73134..1d36cd12a4 100644 --- a/inc/libs/register_functions.php +++ b/inc/libs/register_functions.php @@ -102,9 +102,7 @@ function REGISTER_OUTPUT_REQUIRE_CHECK(&$array) SQL_FREERESULT($result); } // -function REGISTER_ADD_CATEGORY_TABLE ($MODE, $return=false) -{ - global $_POST, $_CONFIG; +function REGISTER_ADD_CATEGORY_TABLE ($MODE, $return=false) { $OUT = ""; // Guests are mostly not interested in how many members has @@ -114,13 +112,11 @@ function REGISTER_ADD_CATEGORY_TABLE ($MODE, $return=false) // Admins are allowed to see every category... if (IS_ADMIN()) $AND = ""; $result = SQL_QUERY("SELECT id, cat, visible FROM `{!_MYSQL_PREFIX!}_cats` ".$AND." ORDER BY `sort`", __FILE__, __LINE__); - if (SQL_NUMROWS($result) > 0) - { + if (SQL_NUMROWS($result) > 0) { // List alle visible modules (or all to the admin) $SW = 2; $OUT .= "\n"; - while (list($id, $cat, $visible) = SQL_FETCHROW($result)) - { + while (list($id, $cat, $visible) = SQL_FETCHROW($result)) { if (empty($_POST['cat'][$id])) $_POST['cat'][$id] = ""; // Prepare array for the template $content = array( @@ -145,20 +141,15 @@ function REGISTER_ADD_CATEGORY_TABLE ($MODE, $return=false) // Free memory SQL_FREERESULT($result); - } - else - { + } else { // No categories setted up so far... - $OUT .= LOAD_TEMPLATE("admin_settings_saved", true, NO_CATEGORIES_VISIBLE); + $OUT .= LOAD_TEMPLATE("admin_settings_saved", true, getMessage('NO_CATEGORIES_VISIBLE')); } - if ($return) - { + if ($return) { // Return generated HTML code return $OUT; - } - else - { + } else { // Output directly (default) OUTPUT_HTML($OUT); } diff --git a/inc/libs/rewrite_functions.php b/inc/libs/rewrite_functions.php index 8a8d6f01fc..e7fa920e68 100644 --- a/inc/libs/rewrite_functions.php +++ b/inc/libs/rewrite_functions.php @@ -39,8 +39,6 @@ if (!defined('__SECURITY')) { // function REWRITE_LINKS ($HTML) { - global $_CONFIG; - // Skip rewriting for the admin area (which search engine may enter here???) if (ereg($GLOBALS['module'], getConfig('rewrite_skip'))) return $HTML; diff --git a/inc/libs/sponsor_functions.php b/inc/libs/sponsor_functions.php index 868ff43862..5ef940265a 100644 --- a/inc/libs/sponsor_functions.php +++ b/inc/libs/sponsor_functions.php @@ -352,7 +352,6 @@ ORDER BY `sort`", array($action), __FILE__, __LINE__); // function GENERATE_SPONSOR_CONTENT($what) { - global $_CONFIG; $OUT = ""; $INC = sprintf("inc/modules/sponsor/%s.php", $what); if (FILE_READABLE($INC)) { @@ -456,16 +455,14 @@ function SPONSOR_SAVE_DATA ($POST, $content) { switch ($GLOBALS['what']) { case "account": // Change account data - if ($EMAIL) { - $MSG = SPONSOR_ACCOUNT_EMAIL_CHANGED; + if ($EMAIL === true) { + $MSG = getMessage('SPONSOR_ACCOUNT_EMAIL_CHANGED'); $templ = "admin_sponsor_change_email"; - $subj = ADMIN_SPONSOR_ACC_EMAIL_SUBJ; - } - else - { - $MSG = SPONSOR_ACCOUNT_DATA_SAVED; + $subj = getMessage('ADMIN_SPONSOR_ACC_EMAIL_SUBJ'); + } else { + $MSG = getMessage('SPONSOR_ACCOUNT_DATA_SAVED'); $templ = "admin_sponsor_change_data"; - $subj = ADMIN_SPONSOR_ACC_DATA_SUBJ; + $subj = getMessage('ADMIN_SPONSOR_ACC_DATA_SUBJ'); } break; @@ -475,9 +472,9 @@ function SPONSOR_SAVE_DATA ($POST, $content) { $content['interval'] = CREATE_FANCY_TIME($content['warning_interval']); // Set message template and subject for admin - $MSG = SPONSOR_SETTINGS_SAVED; + $MSG = getMessage('SPONSOR_SETTINGS_SAVED'); $templ = "admin_sponsor_settings"; - $subj = ADMIN_SPONSOR_SETTINGS_SUBJ; + $subj = getMessage('ADMIN_SPONSOR_SETTINGS_SUBJ'); break; default: // Unknown sponsor what value! @@ -487,10 +484,8 @@ function SPONSOR_SAVE_DATA ($POST, $content) { break; } - if (SQL_AFFECTEDROWS() == 1) - { - if (!empty($templ) && !empty($subj)) - { + if (SQL_AFFECTEDROWS() == 1) { + if (!empty($templ) && !empty($subj)) { // Run SQL command and check for success $result = SQL_QUERY_ESC($SQL, $DATA, __FILE__, __LINE__); @@ -508,8 +503,7 @@ function SPONSOR_SAVE_DATA ($POST, $content) { SEND_ADMIN_NOTIFICATION($subj, $templ, $content); // Shall we send mail to the sponsor's new email address? - if ($content['receive_warnings'] == "Y") - { + if ($content['receive_warnings'] == "Y") { // Okay send email with confirmation link to new address and with no confirmation link // to the old address @@ -518,23 +512,22 @@ function SPONSOR_SAVE_DATA ($POST, $content) { { case "account": // Change account data $email_msg = LOAD_EMAIL_TEMPLATE("sponsor_change_data", $content); - SEND_EMAIL($content['email'], SPONSOR_ACC_DATA_SUBJ, $email_msg); + SEND_EMAIL($content['email'], getMessage('SPONSOR_ACC_DATA_SUBJ'), $email_msg); - if ($EMAIL) - { + if ($EMAIL === true) { // Add hash code to content array $content['hash'] = $HASH; // Second mail goes to the new address $email_msg = LOAD_EMAIL_TEMPLATE("sponsor_change_email", $content); - SEND_EMAIL($content['email'], SPONSOR_ACC_EMAIL_SUBJ, $email_msg); + SEND_EMAIL($content['email'], getMessage('SPONSOR_ACC_EMAIL_SUBJ'), $email_msg); } break; case "settings": // Change settings // Send email $email_msg = LOAD_EMAIL_TEMPLATE("sponsor_settings", $content); - SEND_EMAIL($content['email'], SPONSOR_SETTINGS_SUBJ, $email_msg); + SEND_EMAIL($content['email'], getMessage('SPONSOR_SETTINGS_SUBJ'), $email_msg); break; } } @@ -544,5 +537,6 @@ function SPONSOR_SAVE_DATA ($POST, $content) { // Return final message return $MSG; } + // ?> diff --git a/inc/libs/surfbar_functions.php b/inc/libs/surfbar_functions.php index 87b924d5dc..f97cab7c4b 100644 --- a/inc/libs/surfbar_functions.php +++ b/inc/libs/surfbar_functions.php @@ -146,8 +146,6 @@ function SURFBAR_ADMIN_REJECT_URL_IDS ($IDs) { // // Member has added an URL function SURFBAR_MEMBER_ADD_URL ($url, $limit) { - global $_CONFIG; - // Do some pre-checks if (!IS_MEMBER()) { // Not a member @@ -474,10 +472,9 @@ function SURFBAR_HANDLE_DEPLETED_VIEWS () { } // END - foreach } // END - if } + // Alert users which have URLs booked and are low on points amount function SURFBAR_HANDLE_LOW_POINTS () { - global $_CONFIG; - // Get all userids $UIDs = SURFBAR_DETERMINE_DEPLETED_USERIDS(getConfig('surfbar_warn_low_points')); @@ -503,11 +500,13 @@ function SURFBAR_HANDLE_LOW_POINTS () { } // END - if } // END - foreach } + // // ----------------------------------------------------------------------------- // Generic functions // ----------------------------------------------------------------------------- // + // Looks up by an URL function SURFBAR_LOOKUP_BY_URL ($url, $uid) { // Now lookup that given URL by itself @@ -516,6 +515,7 @@ function SURFBAR_LOOKUP_BY_URL ($url, $uid) { // Was it found? return (count($urlArray) > 0); } + // Load URL data by given search term and column function SURFBAR_GET_URL_DATA ($searchTerm, $column="id", $order="id", $sort="ASC", $group="id", $add="") { global $lastUrlData; @@ -564,10 +564,9 @@ ORDER BY %s %s // Return the result return $lastUrlData; } + // Registers an URL with the surfbar. You should have called SURFBAR_LOOKUP_BY_URL() first! function SURFBAR_REGISTER_URL ($url, $uid, $status="PENDING", $addMode="reg", $extraFields = array()) { - global $_CONFIG; - // Make sure by the user registered URLs are always pending if ($addMode == "reg") $status = "PENDING"; @@ -607,6 +606,7 @@ function SURFBAR_REGISTER_URL ($url, $uid, $status="PENDING", $addMode="reg", $e // Return the insert id return $content['insert_id']; } + // Inserts an url by given data array and return the insert id function SURFBAR_INSERT_URL_BY_ARRAY ($urlData) { // Get userid @@ -630,25 +630,22 @@ function SURFBAR_INSERT_URL_BY_ARRAY ($urlData) { // Return insert id return SQL_INSERTID(); } + // Notify admin(s) with a selected message and content function SURFBAR_NOTIFY_ADMIN ($messageType, $content) { // Prepare template name $templateName = sprintf("admin_surfbar_%s", $messageType); - // Set default subject if following eval() wents wrong - $subject = ADMIN_SURFBAR_NOTIFY_DEFAULT_SUBJECT; - - // Create constant name - $constantName = sprintf("ADMIN_SURFBAR_NOTIFY_%s_SUBJECT", + // Prepare subject + $subject = getMessage(sprintf("ADMIN_SURFBAR_NOTIFY_%s_SUBJECT", strtoupper($messageType) - ); + )); - // Prepare subject - if (defined($constantName)) { - $subject = constant($constantName); - } else { - addFatalMessage(getMessage('ADMIN_SURFBAR_NOTIFY_SUBJECT_404'), $constantName); - } + // Is the subject line there? + if ((substr($subject, 0, 1) == "!") && (substr($subject, -1, 1) == "!")) { + // Set default subject if following eval() wents wrong + $subject = getMessage('ADMIN_SURFBAR_NOTIFY_DEFAULT_SUBJECT'); + } // END - if // Translate some data if present if (isset($content['status'])) $content['status'] = SURFBAR_TRANSLATE_STATUS($content['status']); @@ -661,6 +658,7 @@ function SURFBAR_NOTIFY_ADMIN ($messageType, $content) { // Send the notification out return SEND_ADMIN_NOTIFICATION($subject, $templateName, $content, $content['uid']); } + // Notify the user about the performed action function SURFBAR_NOTIFY_USER ($messageType, $content) { // Skip notification if userid is zero @@ -671,20 +669,16 @@ function SURFBAR_NOTIFY_USER ($messageType, $content) { // Prepare template name $templateName = sprintf("member_surfbar_%s", $messageType); - // Set default subject if following eval() wents wrong - $subject = MEMBER_SURFBAR_NOTIFY_DEFAULT_SUBJECT; - - // Create constant name - $constantName = sprintf("MEMBER_SURFBAR_NOTIFY_%s_SUBJECT", + // Prepare subject + $subject = getMessage(sprintf("MEMBER_SURFBAR_NOTIFY_%s_SUBJECT", strtoupper($messageType) - ); + )); - // Prepare subject - if (defined($constantName)) { - $subject = constant($constantName); - } else { - addFatalMessage(getMessage('MEMBER_SURFBAR_NOTIFY_SUBJECT_404'), $constantName); - } + // Is the subject line there? + if ((substr($subject, 0, 1) == "!") && (substr($subject, -1, 1) == "!")) { + // Set default subject if following eval() wents wrong + $subject = getMessage('MEMBER_SURFBAR_NOTIFY_DEFAULT_SUBJECT'); + } // END - if // Translate some data if present if (isset($content['status'])) $content['status'] = SURFBAR_TRANSLATE_STATUS($content['status']); @@ -733,8 +727,6 @@ function SURFBAR_TRANSLATE_STATUS ($status) { } // Determine reward function SURFBAR_DETERMINE_REWARD ($onlyMin=false) { - global $_CONFIG; - // Static values are default $reward = getConfig('surfbar_static_reward'); @@ -753,8 +745,6 @@ function SURFBAR_DETERMINE_REWARD ($onlyMin=false) { } // Determine costs function SURFBAR_DETERMINE_COSTS ($onlyMin=false) { - global $_CONFIG; - // Static costs is default $costs = getConfig('surfbar_static_costs'); @@ -799,7 +789,7 @@ function SURFBAR_DETERMINE_TEMPLATE_NAME() { // Check if the "reload lock" of the current user is full, call this function // before you call SURFBAR_CHECK_RELOAD_LOCK(). function SURFBAR_CHECK_RELOAD_FULL() { - global $SURFBAR_CACHE, $_CONFIG; + global $SURFBAR_CACHE; // Default is full! $isFull = true; @@ -874,15 +864,11 @@ WHERE userid NOT IN (".implode(",", $UIDs['uid']).") AND `status`='%s'", } // Check wether the user is allowed to book more URLs function SURFBAR_IF_USER_BOOK_MORE_URLS ($uid=0) { - global $_CONFIG; - // Is this admin and userid is zero or does the user has some URLs left to book? return ((($uid == 0) && (IS_ADMIN())) || (SURFBAR_GET_TOTAL_USER_URLS($uid, "", array("REJECTED")) < getConfig('surfbar_max_order'))); } // Get total amount of URLs of given status for current user function SURFBAR_GET_TOTAL_USER_URLS ($uid=0, $status="",$exclude="") { - global $_CONFIG; - // Is the user 0 and user is logged in? if (($uid == 0) && (IS_MEMBER())) { // Then use this userid @@ -929,7 +915,7 @@ LIMIT %s", } // Generate a validation code for the given id number function SURFBAR_GENERATE_VALIDATION_CODE ($urlId, $salt="") { - global $_CONFIG, $SURFBAR_CACHE; + global $SURFBAR_CACHE; // @TODO Invalid salt should be refused $SURFBAR_CACHE['salt'] = "INVALID"; @@ -998,8 +984,6 @@ function SURFBAR_LOCKDOWN_ID ($urlId) { } // Pay points to the user and remove it from the sender if userid is given else it is a "sponsored surf" function SURFBAR_PAY_POINTS () { - global $_CONFIG; - // Remove it from the URL owner //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "uid=".SURFBAR_GET_USERID().",costs=".SURFBAR_GET_COSTS()."", false); if (SURFBAR_GET_USERID() > 0) { @@ -1012,8 +996,6 @@ function SURFBAR_PAY_POINTS () { } // Updates the statistics of current URL/userid function SURFBAR_UPDATE_INSERT_STATS_RECORD () { - global $_CONFIG; - // Init add $ADD = ""; @@ -1160,8 +1142,6 @@ ORDER BY u.userid ASC", __FILE__, __LINE__); } // Determine how many users are Online in surfbar function SURFBAR_DETERMINE_TOTAL_ONLINE () { - global $_CONFIG; - // Count all users in surfbar modue and return the value $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_surfbar_stats` @@ -1203,8 +1183,6 @@ function SURFBAR_DETERMINE_WAIT_TIME () { } // Changes the status of an URL from given to other function SURFBAR_CHANGE_STATUS ($urlId, $prevStatus, $newStatus, $data=array()) { - global $_CONFIG; - // Make new status always lower-case $newStatus = strtolower($newStatus); @@ -1262,8 +1240,6 @@ function SURFBAR_CHANGE_STATUS ($urlId, $prevStatus, $newStatus, $data=array()) } // Calculate minimum value for dynamic payment model function SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE () { - global $_CONFIG; - // Addon is zero by default $addon = 0; @@ -1297,8 +1273,6 @@ function SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE () { } // Calculate maximum value for dynamic payment model function SURFBAR_CALCULATE_DYNAMIC_MAX_VALUE () { - global $_CONFIG; - // Addon is zero by default $addon = 0; @@ -1325,8 +1299,6 @@ function SURFBAR_CALCULATE_DYNAMIC_MAX_VALUE () { } // Calculate dynamic lock function SURFBAR_CALCULATE_DYNAMIC_LOCK () { - global $_CONFIG; - // Default lock is 30 seconds $addon = 30; @@ -1394,7 +1366,6 @@ ORDER BY } // "Getter" for maximum random number function SURFBAR_GET_MAX_RANDOM ($UIDs, $ADD) { - global $_CONFIG; // Count max availabe entries $result = SQL_QUERY("SELECT sbu.id AS cnt FROM `{!_MYSQL_PREFIX!}_surfbar_urls` AS sbu @@ -1482,7 +1453,7 @@ function SURFBAR_RELOAD_TO_STOP_PAGE($page="stop") { // Determine next id for surfbar or get data for given id, always call this before you call other // getters below this function!!! function SURFBAR_DETERMINE_NEXT_ID ($urlId = 0) { - global $SURFBAR_CACHE, $_CONFIG; + global $SURFBAR_CACHE; // Default is no id and no random number $nextId = 0; diff --git a/inc/libs/task_functions.php b/inc/libs/task_functions.php index 4f79540237..dd7e3249de 100644 --- a/inc/libs/task_functions.php +++ b/inc/libs/task_functions.php @@ -47,8 +47,6 @@ if (!defined('__SECURITY')) { // // @TODO Move all extension-dependent queries into filters function OUTPUT_ADVANCED_OVERVIEW (&$result_main) { - global $_CONFIG; - // Init variables/arrays $EXTRAS = ""; $OUT = ""; diff --git a/inc/libs/user_functions.php b/inc/libs/user_functions.php index 6174010242..7c747ddf57 100644 --- a/inc/libs/user_functions.php +++ b/inc/libs/user_functions.php @@ -39,7 +39,6 @@ if (!defined('__SECURITY')) { // Add links for selecting some users function alpha ($sortby, $colspan, $return=false) { - global $_CONFIG; if (empty($_GET['offset'])) $_GET['offset'] = 0; $ADD = "&page=".SQL_ESCAPE($_GET['page'])."&offset=".SQL_ESCAPE($_GET['offset']); if (!empty($_GET['mode'])) $ADD .= "&mode=".SQL_ESCAPE($_GET['mode']); @@ -219,8 +218,6 @@ WHERE email='%s'".$locked." LIMIT 1", // Selects a random user id as the new referal id if they have at least X confirmed mails in this run function SELECT_RANDOM_REFID () { - global $_CONFIG; - // Default is zero refid $refid = 0; diff --git a/inc/libs/wernis_functions.php b/inc/libs/wernis_functions.php index e8e6d9a59b..89adec715d 100644 --- a/inc/libs/wernis_functions.php +++ b/inc/libs/wernis_functions.php @@ -261,13 +261,11 @@ function WERNIS_EXECUTE_WITHDRAW ($wdsId, $userMd5, $amount) { // Payout this amount function WERNIS_EXECUTE_PAYOUT ($wdsId, $amount) { - global $_CONFIG; - // Default is failed attempt $result = false; // Prepare the purpose - $eval = "\$purpose = \"".COMPILE_CODE(sprintf(WERNIS_API_PURPOSE_PAYOUT, $GLOBALS['userid']))."\";"; + $eval = "\$purpose = \"".COMPILE_CODE(sprintf(getMessage('WERNIS_API_PURPOSE_PAYOUT'), $GLOBALS['userid']))."\";"; eval($eval); // Prepare the request data diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index 2850f95bfa..4d11ed13fe 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -632,7 +632,7 @@ function ADMIN_MENU_SELECTION($MODE, $default="", $defid="") { // Save settings to the database function ADMIN_SAVE_SETTINGS (&$POST, $tableName="_config", $whereStatement="config=0", $translateComma=array(), $alwaysAdd=false) { - global $_CONFIG, $cacheArray, $cacheInstance; + global $cacheArray, $cacheInstance; // Prepare all arrays, variables $DATA = array(); @@ -667,7 +667,7 @@ function ADMIN_SAVE_SETTINGS (&$POST, $tableName="_config", $whereStatement="con } // Update current configuration - $_CONFIG[$id] = $val; + setConfigEntry($id, $val); } // END - if } // END - if } // END - foreach diff --git a/inc/modules/admin/overview-inc.php b/inc/modules/admin/overview-inc.php index f2f05f97b0..2ffdeee1f7 100644 --- a/inc/modules/admin/overview-inc.php +++ b/inc/modules/admin/overview-inc.php @@ -38,7 +38,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { } function OUTPUT_STANDARD_OVERVIEW(&$result_tasks) { - global $cacheArray, $_CONFIG; + global $cacheArray; // First check for solved and not assigned tasks and assign them to current admin SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_task_system` SET assigned_admin='%s' WHERE assigned_admin < 1 AND status != 'NEW'", @@ -119,7 +119,7 @@ ORDER BY userid DESC, task_type DESC, subject, task_created DESC", // Outputs selected tasks function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) { - global $_CONFIG, $NOTES; + global $NOTES; if ((isset($POST['assign'])) && (count($POST['task']) > 0)) { // Assign / do tasks $OUT = ""; $SW = 2; diff --git a/inc/modules/admin/what-config_primera.php b/inc/modules/admin/what-config_primera.php index 69afcbf6cd..3a8d0da5c2 100644 --- a/inc/modules/admin/what-config_primera.php +++ b/inc/modules/admin/what-config_primera.php @@ -42,6 +42,7 @@ ADD_DESCR("admin", __FILE__); if (isset($_POST['ok'])) { // First merge temporarily the new API data into the current config + global $_CONFIG; $_CONFIG = merge_array($_CONFIG, $_POST); // Is the password set? diff --git a/inc/modules/admin/what-config_wernis.php b/inc/modules/admin/what-config_wernis.php index 3e79f811a4..cfa9132c55 100644 --- a/inc/modules/admin/what-config_wernis.php +++ b/inc/modules/admin/what-config_wernis.php @@ -42,6 +42,7 @@ ADD_DESCR("admin", __FILE__); if (isset($_POST['ok'])) { // First merge temporarily the new API data into the current config + global $_CONFIG; $_CONFIG = merge_array($_CONFIG, $_POST); // Let's test the API first (hold your horses here, cowboy! Thank you. :) ) diff --git a/inc/modules/guest/what-register.php b/inc/modules/guest/what-register.php index ef95af5fec..422fbf7787 100644 --- a/inc/modules/guest/what-register.php +++ b/inc/modules/guest/what-register.php @@ -43,7 +43,7 @@ if (!defined('__SECURITY')) { // Add description as navigation point ADD_DESCR("guest", __FILE__); -global $_CONFIG, $DATA; +global $DATA; // Initialize variables $FAILED = false; $SHORT_PASS = false; $cats = 0; $IP_TIMEOUT = false;