// Multiply configured values with 100000 and divide with 100000 so we can also handle small values
// If we need more number behind the decimal dot then we just need to increase all these three
// numbers matching to the numbers behind the decimal dot. Simple! ;-)
- $points = mt_rand(($_CONFIG['beg_points'] * 100000), ($_CONFIG['beg_points_max'] * 100000)) / 100000;
+ $points = mt_rand((getConfig('beg_points') * 100000), (getConfig('beg_points_max') * 100000)) / 100000;
// Set nickname / userid for the template(s
define('__BEG_UID' , SQL_ESCAPE($_GET['uid']));
SQL_FREERESULT($result);
// User id valid and not webmaster's id?
- if (($uid > 0) && ($_CONFIG['beg_uid'] != $uid)) {
+ if (($uid > 0) && (getConfig('beg_uid') != $uid)) {
// Update counter
$result = SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_user_data` SET beg_clicks=beg_clicks+1 WHERE userid=%s AND status='CONFIRMED' LIMIT 1",
array($uid), __FILE__, __LINE__);
// Check for last entry for userid w/o IP number
- $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_beg_ips WHERE (timeout > (UNIX_TIMESTAMP() - ".$_CONFIG['beg_timeout'].") OR (timeout > (UNIX_TIMESTAMP() - ".$_CONFIG['beg_uid_timeout'].") AND userid=%s)) AND (remote_ip='%s' OR sid='%s') LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_beg_ips WHERE (timeout > (UNIX_TIMESTAMP() - ".getConfig('beg_timeout').") OR (timeout > (UNIX_TIMESTAMP() - ".getConfig('beg_uid_timeout').") AND userid=%s)) AND (remote_ip='%s' OR sid='%s') LIMIT 1",
array($uid, GET_REMOTE_ADDR(), session_id()), __FILE__, __LINE__);
// Entry not found, points set and not logged in?
- if (((SQL_NUMROWS($result) == 0) || (IS_ADMIN())) && ($points > 0) && (!IS_MEMBER()) && ($_CONFIG['beg_pay_mode'] == "NONE")) {
+ if (((SQL_NUMROWS($result) == 0) || (IS_ADMIN())) && ($points > 0) && (!IS_MEMBER()) && (getConfig('beg_pay_mode') == "NONE")) {
// Admin is testing?
if (!IS_ADMIN()) {
} elseif (IS_MEMBER()) {
// Logged in user found!
define('__BEG_MSG', LOAD_TEMPLATE("beg_login", true));
- } elseif ($_CONFIG['beg_pay_mode'] != "NONE") { // Other pay-mode active!
+ } elseif (getConfig('beg_pay_mode') != "NONE") { // Other pay-mode active!
// Prepare content for template
$content = array(
'clicks' => __BEG_CLICKS,
);
// Load message template depending on pay-mode
- define('__BEG_MSG', LOAD_TEMPLATE("beg_pay_mode_".strtolower($_CONFIG['beg_pay_mode']), true, $content));
+ define('__BEG_MSG', LOAD_TEMPLATE("beg_pay_mode_".strtolower(getConfig('beg_pay_mode')), true, $content));
$pay = true;
} else {
// Clicked received while reload lock is active
LOAD_TEMPLATE("beg_link");
// Tracker code enabled? (We don't track users here!
- if (($_CONFIG['beg_pay_mode'] != "NONE") && ($pay)) {
+ if ((getConfig('beg_pay_mode') != "NONE") && ($pay)) {
// Prepare content for template
$content = array(
);
// Include config-depending template
- LOAD_TEMPLATE("beg_pay_code_".strtolower($_CONFIG['beg_pay_mode']), false, $content);
+ LOAD_TEMPLATE("beg_pay_code_".strtolower(getConfig('beg_pay_mode')), false, $content);
} elseif ((!$pay) && (!defined('__BEG_MSG'))) {
// Cannot pay! :-(
define('__BEG_MSG', LOAD_TEMPLATE("beg_failed", true));
// Free memory
SQL_FREERESULT($result);
- } elseif ($uid == $_CONFIG['beg_uid']) {
+ } elseif ($uid == getConfig('beg_uid')) {
// Webmaster's ID cannot beg for points!
$msg = CODE_BEG_SAME_AS_OWN;
}
if ($data['status'] == "CONFIRMED") {
// Set mode depending on how many mails the member has to confirm
$locked = false;
- if (($data['ref_payout'] > 0) && ($_CONFIG['allow_direct_pay'] == "N")) $locked = true;
+ if (($data['ref_payout'] > 0) && (getConfig('allow_direct_pay') == "N")) $locked = true;
// Add points to account
unset($DEPTH);
- ADD_POINTS_REFSYSTEM("birthday_confirm", $uid, $data['points'], false, "0", $locked, strtolower($_CONFIG['birthday_mode']));
+ ADD_POINTS_REFSYSTEM("birthday_confirm", $uid, $data['points'], false, "0", $locked, strtolower(getConfig('birthday_mode')));
// Remove entry from table
$result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_birthday WHERE userid=%s AND chk_value='%s' LIMIT 1",
// If no account was found set default refid and status to CONFIRMED
if (empty($GLOBALS['refid'])) {
- $GLOBALS['refid'] = $_CONFIG['def_refid'];
+ $GLOBALS['refid'] = getConfig('def_refid');
$status = "CONFIRMED";
} // END - if
$_POST['points'] = bigintval(round(REVERT_COMMA($_POST['points'])));
// Probe for enough points
- $probe_points = (($_POST['points'] >= $_CONFIG['doubler_min']) && ($_POST['points'] <= $_CONFIG['doubler_max']));
+ $probe_points = (($_POST['points'] >= getConfig('doubler_min')) && ($_POST['points'] <= getConfig('doubler_max')));
// Check all together
if ((!empty($uid)) && ($password == generateHash($_POST['pass'], substr($password, 0, -40))) && ($status == "CONFIRMED") && ($probe_points)) {
$points = GET_TOTAL_DATA($uid, "user_points", "points") - GET_TOTAL_DATA($uid, "user_data", "used_points");
// So let's continue with probing his points amount
- if (($points - $_CONFIG['doubler_left'] - $_POST['points'] * $_CONFIG['doubler_charge']) >= 0)
+ if (($points - getConfig('doubler_left') - $_POST['points'] * getConfig('doubler_charge')) >= 0)
{
// Enough points are left so let's continue with the doubling process
// Create doubling "account" width *DOUBLED* points
SUB_POINTS("doubler", $uid, $_POST['points']);
// Add points to "total payed" including charge
- $points = $_POST['points'] - $_POST['points'] * $_CONFIG['doubler_charge'];
+ $points = $_POST['points'] - $_POST['points'] * getConfig('doubler_charge');
UPDATE_CONFIG("doubler_points", $points, "+");
- $_CONFIG['doubler_points'] += $points;
+ getConfig('doubler_points') += $points;
// Add second line for the referal but only when uid != refid
if (($GLOBALS['refid'] > 0) && ($GLOBALS['refid'] != $uid)) {
// Okay add a refid line and apply refid percents
$result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_doubler (userid,refid,points,remote_ip,timemark,completed,is_ref) VALUES ('%s',0,'%s','".GET_REMOTE_ADDR()."',UNIX_TIMESTAMP(),'N','Y')",
- array(bigintval($GLOBALS['refid']), bigintval($_POST['points'] * 2 * $_CONFIG['doubler_ref'])), __FILE__, __LINE__);
+ array(bigintval($GLOBALS['refid']), bigintval($_POST['points'] * 2 * getConfig('doubler_ref'))), __FILE__, __LINE__);
// And that's why we dont't want to you more than one referal level of doubler-points. ^^^
} // END - if
} elseif ($status == "LOCKED") {
// Account is locked by admin / holiday!
define('__ERROR_MSG', DOUBLER_FORM_STATUS_LOCKED);
- } elseif ($_POST['points'] < $_CONFIG['doubler_min']) {
+ } elseif ($_POST['points'] < getConfig('doubler_min')) {
// Not enougth points entered
define('__ERROR_MSG', DOUBLER_FORM_POINTS_MIN);
- } elseif ($_POST['points'] > $_CONFIG['doubler_max']) {
+ } elseif ($_POST['points'] > getConfig('doubler_max')) {
// Too much points entered
define('__ERROR_MSG', DOUBLER_FORM_POINTS_MAX);
} elseif ($probe_nickname) {
if (!defined('__ERROR_MSG')) define('__ERROR_MSG' , "");
// Shall I check for points immediately?
- if ($_CONFIG['doubler_send_mode'] == "DIRECT") require(PATH."inc/doubler_send.php");
+ if (getConfig('doubler_send_mode') == "DIRECT") require(PATH."inc/doubler_send.php");
// Output header
include(PATH."inc/header.php");
}
// Percent values etc.
- define('__CHARGE_VALUE', TRANSLATE_COMMA($_CONFIG['doubler_charge'] * 100));
- define('__REF_VALUE' , TRANSLATE_COMMA($_CONFIG['doubler_ref'] * 100));
- define('__TOTAL_VALUE' , TRANSLATE_COMMA($_CONFIG['doubler_points']));
- define('__MIN_VALUE' , TRANSLATE_COMMA($_CONFIG['doubler_min']));
- define('__MAX_VALUE' , TRANSLATE_COMMA($_CONFIG['doubler_max']));
+ define('__CHARGE_VALUE', TRANSLATE_COMMA(getConfig('doubler_charge') * 100));
+ define('__REF_VALUE' , TRANSLATE_COMMA(getConfig('doubler_ref') * 100));
+ define('__TOTAL_VALUE' , TRANSLATE_COMMA(getConfig('doubler_points')));
+ define('__MIN_VALUE' , TRANSLATE_COMMA(getConfig('doubler_min')));
+ define('__MAX_VALUE' , TRANSLATE_COMMA(getConfig('doubler_max')));
// Text "Enter login"
if (EXT_IS_ACTIVE("nickname")) {
}
// Which mail-send-mode did the admin setup?
- switch ($_CONFIG['doubler_send_mode'])
+ switch (getConfig('doubler_send_mode'))
{
case "DIRECT":
define('DOUBLER_PAYOUT_TIME', DOUBLER_PAYOUT_TIME_DIRECT);
define('__DOUBLER_PAYOUT_HISTORY', DOUBLER_GENERATE_TABLE("0", "Y", "N", "DESC"));
// Generate timemark
- define('__TIMEOUT_MARK', CREATE_FANCY_TIME($_CONFIG['doubler_timeout']));
+ define('__TIMEOUT_MARK', CREATE_FANCY_TIME(getConfig('doubler_timeout')));
// Usage counter
- define('__DOUBLER_COUNTER', $_CONFIG['doubler_counter']);
+ define('__DOUBLER_COUNTER', getConfig('doubler_counter'));
// Points left to doubler
define('__LEFT_VALUE', TRANSLATE_COMMA(DOUBLER_GET_TOTAL_POINTS_LEFT()));
}
// Abort if autopurge is not active or disabled by admin
-if ((!EXT_IS_ACTIVE("autopurge")) || ($_CONFIG['auto_purge_active'] == "N")) {
+if ((!EXT_IS_ACTIVE("autopurge")) || (getConfig('auto_purge_active') == "N")) {
// Abort here
return false;
}
-if (($_CONFIG['auto_purge_active'] == "Y") && ($_CONFIG['auto_purge'] > 0)) {
+if ((getConfig('auto_purge_active') == "Y") && (getConfig('auto_purge') > 0)) {
// First calculate the timestamp
if (function_exists('CREATE_TIME_SELECTIONS')) {
- $PURGE = $_CONFIG['auto_purge'];
+ $PURGE = getConfig('auto_purge');
} else {
- $PURGE = $_CONFIG['auto_purge'] * $_CONFIG['one_day'];
+ $PURGE = getConfig('auto_purge') * getConfig('one_day');
}
// Init variables
} // END - if
// Abort if autopurge is not active or disabled by admin
-if ((!EXT_IS_ACTIVE("autopurge")) || ($_CONFIG['auto_purge_active'] == "N")) {
+if ((!EXT_IS_ACTIVE("autopurge")) || (getConfig('auto_purge_active') == "N")) {
// Abort here
return false;
} // END - if
// Shall I look for inactive accounts and autopurge inactive accounts?
-if ($_CONFIG['autopurge_inactive'] == "Y") {
+if (getConfig('autopurge_inactive') == "Y") {
// Ok, let's have a look...
- $since = bigintval($_CONFIG['ap_inactive_since']);
+ $since = bigintval(getConfig('ap_inactive_since'));
// Init exclusion list
$EXCLUDE_LIST = "";
- if ($_CONFIG['def_refid'] > 0) {
- $EXCLUDE_LIST = " AND d.userid != ".$_CONFIG['def_refid'];
+ if (getConfig('def_refid') > 0) {
+ $EXCLUDE_LIST = " AND d.userid != ".getConfig('def_refid');
} // END - if
// Check for more extensions
- if (EXT_IS_ACTIVE("beg")) $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['beg_uid']."";
- if (EXT_IS_ACTIVE("bonus")) $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['bonus_uid']."";
- if (EXT_IS_ACTIVE("doubler")) $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['doubler_uid']."";
+ if (EXT_IS_ACTIVE("beg")) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('beg_uid')."";
+ if (EXT_IS_ACTIVE("bonus")) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('bonus_uid')."";
+ if (EXT_IS_ACTIVE("doubler")) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('doubler_uid')."";
// Check for new holiday extension
if (GET_EXT_VERSION("holiday") >= "0.1.3") {
if (SQL_NUMROWS($result_inactive) > 0) {
// Prepare variables and constants...
$UIDs = "";
- define('__INACTIVE_SINCE', ($_CONFIG['ap_inactive_since'] / 60 / 60));
- define('__INACTIVE_TIME' , ($_CONFIG['ap_in_time'] / 60 / 60));
+ define('__INACTIVE_SINCE', (getConfig('ap_inactive_since') / 60 / 60));
+ define('__INACTIVE_TIME' , (getConfig('ap_in_time') / 60 / 60));
// Mark found accounts as inactive and send an email
while(list($uid, $email, $last) = SQL_FETCHROW($result_inactive)) {
// Now let's have a look for inactive accounts we want to delete we newly use the same exclude list
// here for e.g. excluding holiday users
- $time = bigintval($_CONFIG['ap_in_time']);
+ $time = bigintval(getConfig('ap_in_time'));
$result_inactive = SQL_QUERY_ESC("SELECT d.userid, d.email, d.last_online
FROM `"._MYSQL_PREFIX."_user_data` AS d
WHERE status='CONFIRMED' AND joined < (UNIX_TIMESTAMP() - %s) AND last_online < (UNIX_TIMESTAMP() - %s) AND ap_notified < (UNIX_TIMESTAMP() - %s)
$UIDs = str_replace(", ", "\n", substr($UIDs, 0, -2));
// Send mail notification to admin
- if ($_CONFIG['ap_un_mail'] == "Y") {
+ if (getConfig('ap_in_notify') == "Y") {
SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_DELETE_SUBJECT, "admin_autopurge_delete", $UIDs, "");
} // END - if
} // END - if
} // END - if
// Abort if autopurge is not active or disabled by admin
-if ((!EXT_IS_ACTIVE("autopurge")) || ($_CONFIG['auto_purge_active'] == "N")) {
+if ((!EXT_IS_ACTIVE("autopurge")) || (getConfig('auto_purge_active') == "N")) {
// Abort here
return false;
} // END - if
// Search for mails from deleted members?
-if ($_CONFIG['ap_del_mails'] == "Y") {
+if (getConfig('ap_del_mails') == "Y") {
// Okay, let's check for them...
- $since = bigintval($_CONFIG['ap_dm_timeout']);
+ $since = bigintval(getConfig('ap_dm_timeout'));
$result_mails = SQL_QUERY_ESC("SELECT sender\
FROM "._MYSQL_PREFIX."_pool
WHERE data_type='DELETED' AND timestamp <= (UNIX_TIMESTAMP() - %s)
$DELETED += SQL_AFFECTEDROWS();
// Reset query (to prevent possible errors) ...
- $since = bigintval($_CONFIG['ap_dm_timeout']);
+ $since = bigintval(getConfig('ap_dm_timeout'));
$result_mails = SQL_QUERY_ESC("SELECT sender
FROM "._MYSQL_PREFIX."_pool
WHERE data_type='DELETED' AND timestamp <= (UNIX_TIMESTAMP() - %s)
SQL_FREERESULT($result_mails);
// Now let's check for stats entries as well
- $since = bigintval($_CONFIG['ap_dm_timeout']);
+ $since = bigintval(getConfig('ap_dm_timeout'));
$result_mails = SQL_QUERY_ESC("SELECT sender
FROM "._MYSQL_PREFIX."_user_stats
WHERE data_type='DELETED' AND timestamp_send <= (UNIX_TIMESTAMP() - %s)
$DELETED += SQL_AFFECTEDROWS();
// Reset query (to prevent possible errors) ...
- $since = bigintval($_CONFIG['ap_dm_timeout']);
+ $since = bigintval(getConfig('ap_dm_timeout'));
$result_mails = SQL_QUERY_ESC("SELECT sender
FROM "._MYSQL_PREFIX."_user_stats
WHERE data_type='DELETED' AND timestamp_send <= (UNIX_TIMESTAMP() - %s)
SQL_FREERESULT($result_mails);
// Do we have deleted mails and the admin want's to receive a notification
- if (($DELETED > 0) && ($_CONFIG['ap_dm_notify'] == "Y")) {
+ if (($DELETED > 0) && (getConfig('ap_dm_notify') == "Y")) {
// Send out email to admin
SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_DEL_MAILS_SUBJECT, "admin_autopurge_del_mails", $DELETED, "");
}
} // END - if
// Abort if autopurge is not active or disabled by admin
-if ((!EXT_IS_ACTIVE("autopurge")) || ($_CONFIG['auto_purge_active'] == "N")) {
+if ((!EXT_IS_ACTIVE("autopurge")) || (getConfig('auto_purge_active') == "N")) {
// Abort here
return false;
} // END - if
// Check version (must be > 0.0)
-if ((GET_EXT_VERSION("task") > "0.0") && ($_CONFIG['ap_tasks'] == "Y")) {
+if ((GET_EXT_VERSION("task") > "0.0") && (getConfig('ap_tasks') == "Y")) {
// Since when shall we purge?
- $since = bigintval($_CONFIG['ap_tasks_time']);
+ $since = bigintval(getConfig('ap_tasks_time'));
// Purge deleted tasks (no notification to admin)
$result = SQL_QUERY_ESC("DELETE LOW_PRIORITY
array($since), __FILE__, __LINE__);
$DELETED = SQL_AFFECTEDROWS();
- if (($DELETED > 0) && ($_CONFIG['ap_tasks_mail'] == "Y")) {
+ if (($DELETED > 0) && (getConfig('ap_tasks_notify') == "Y")) {
// Send out email to admin
SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_TASKS_SUBJECT, "admin_autopurge_tsks", $DELETED, "");
} // END - if
} // END - if
// Abort if autopurge is not active or disabled by admin
-if ((!EXT_IS_ACTIVE("autopurge")) || ($_CONFIG['auto_purge_active'] == "N")) {
+if ((!EXT_IS_ACTIVE("autopurge")) || (getConfig('auto_purge_active') == "N")) {
// Abort here
return false;
} // END - if
// Shall I auto-purge unconfirmed accounts?
-if ($_CONFIG['autopurge_unconfirmed'] == "Y") {
+if (getConfig('autopurge_unconfirmed') == "Y") {
// Init variables and find unconfirmed accounts which I shall auto-purge
- $time = bigintval($_CONFIG['ap_un_time']);
+ $time = bigintval(getConfig('ap_un_time'));
$result_uncon = SQL_QUERY_ESC("SELECT userid, email, joined
FROM "._MYSQL_PREFIX."_user_data
WHERE status='UNCONFIRMED' AND joined < (UNIX_TIMESTAMP() - %s)
if (SQL_NUMROWS($result_uncon) > 0) {
// Prepare variable...
$UIDs = "";
- define('__UNCONFIRMED_TIME' , ($_CONFIG['ap_un_time'] / 60 / 60));
+ define('__UNCONFIRMED_TIME' , (getConfig('ap_un_time') / 60 / 60));
// Delete inactive accounts
while (list($uid, $email, $joined) = SQL_FETCHROW($result_uncon)) {
$UIDs = str_replace(", ", "\n", substr($UIDs, 0, -2));
// Send mail notification to admin
- if ($_CONFIG['ap_un_mail'] == "Y") {
+ if (getConfig('ap_un_notify') == "Y") {
SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_UNCONFIRMED_SUBJECT, "admin_autopurge_unconfirmed", $UIDs, "");
} // END - if
} // END - if
require($INC);
}
-// 01 2 2 2 3321 12 3 32 2 21 1 2 21 1 2 21 1 2 21 1 10
-if ((date("d", $_CONFIG['last_update']) != date("d", time())) && ((!defined('mxchange_installing')) || (!mxchange_installing)) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')) && (!isset($_GET['register'])) && ($CSS != 1)) {
+// 01 2 3 32 2 3321 12 3 32 2 21 1 2 21 1 2 21 1 2 21 1 10
+if ((date("d", getConfig('last_update')) != date("d", time())) && ((!defined('mxchange_installing')) || (!mxchange_installing)) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')) && (!isset($_GET['register'])) && ($CSS != 1)) {
// Do daily things in external PHP file but only when script is completely setup
// Daily reset was run!
define('__DAILY_RESET', true);
//
// Timestamp for yesterday, today ... all at 00:00 am
-define('START_YDAY', MAKE_TIME(0, 0, 0, time() - $_CONFIG['one_day']));
+define('START_YDAY', MAKE_TIME(0, 0, 0, time() - getConfig('one_day')));
define('START_TDAY', MAKE_TIME(0, 0, 0, time()));
$COOKIES = substr(URL, strpos(substr(URL, 8), "/") + 8);
define('SERVER_URL', "http://www.mxchange.org");
// Current SVN revision
-define('CURR_SVN_REVISION', "640");
+define('CURR_SVN_REVISION', "641");
// Take a prime number which is long (if you know a longer one please try it out!)
define('_PRIME', 591623);
// Calculate "entropy" with the prime number (for code generation)
-define('_ADD', (_PRIME * _PRIME / (pi() * $_CONFIG['code_length'] + 1)));
+define('_ADD', (_PRIME * _PRIME / (pi() * getConfig('code_length') + 1)));
// Random number for e.g. "cache-buster" used in OpenX script
define('CACHE_BUSTER', mt_rand(1000000, 9999999));
$_CONFIG['db_last_query'] = $sql_string;
// Count this query
- if (!isset($_CONFIG['sql_count'])) $_CONFIG['sql_count'] = 0;
+ if (getConfig('sql_count') == null) $_CONFIG['sql_count'] = 0;
$_CONFIG['sql_count']++;
// Debug output
} // END - if
// Count DB hits
- if (!isset($_CONFIG['db_hits_run'])) {
+ if (getConfig('db_hits_run') == null) {
// Count in dummy variable
$_CONFIG['db_hits_run'] = 1;
} else {
} // END - if
// Do we need to update cache/db counter?
- //* DEBUG: */ echo "DB=".$_CONFIG['db_hits'].",CACHE=".$_CONFIG['cache_hits']."<br />\n";
- if ((GET_EXT_VERSION("cache") >= "0.0.7") && (isset($_CONFIG['db_hits'])) && (isset($_CONFIG['cache_hits'])) && (is_object($cacheInstance))) {
+ //* DEBUG: */ echo "DB=".getConfig('db_hits').",CACHE=".getConfig('cache_hits')."<br />\n";
+ if ((GET_EXT_VERSION("cache") >= "0.0.7") && (getConfig('db_hits') > 0) && (getConfig('cache_hits') > 0) && (is_object($cacheInstance))) {
// Add new hits
- $_CONFIG['db_hits'] += $_CONFIG['db_hits_run'];
+ $_CONFIG['db_hits'] += getConfig('db_hits_run');
// Update counter for db/cache
- UPDATE_CONFIG(array("db_hits", "cache_hits"), array(bigintval($_CONFIG['db_hits']), bigintval($_CONFIG['cache_hits'])));
+ UPDATE_CONFIG(array("db_hits", "cache_hits"), array(bigintval(getConfig('db_hits')), bigintval(getConfig('cache_hits'))));
} // END - if
// Close database link and forget the link
if (empty($DOUBLER_UID)) $DOUBLER_UID = 0;
// Check for doubles which we can pay out
-$min = bigintval($_CONFIG['doubler_min'] * 2);
+$min = bigintval(getConfig('doubler_min') * 2);
$result_total = SQL_QUERY_ESC("SELECT DISTINCT d.id, d.userid, d.points, d.remote_ip, d.timemark
FROM "._MYSQL_PREFIX."_doubler AS d
LEFT JOIN `"._MYSQL_PREFIX."_user_data` AS u
ON d.userid=u.userid
WHERE u.status='CONFIRMED' AND d.points <= %s AND d.points >= %s AND d.completed='N' AND d.is_ref='N'
ORDER BY d.timemark
-LIMIT %d", array($DOUBLER_POINTS, $min, $_CONFIG['doubler_max_sent']), __FILE__, __LINE__);
+LIMIT %d", array($DOUBLER_POINTS, $min, getConfig('doubler_max_sent')), __FILE__, __LINE__);
// Do we have entries found?
-if (((SQL_NUMROWS($result_total) > 0) && ($_CONFIG['doubler_sent_all'] == "Y")) || ((SQL_NUMROWS($result_main) == $_CONFIG['doubler_group_sent']) && ($_CONFIG['doubler_sent_all'] == "N"))) {
+if (((SQL_NUMROWS($result_total) > 0) && (getConfig('doubler_sent_all') == "Y")) || ((SQL_NUMROWS($result_main) == getConfig('doubler_group_sent')) && (getConfig('doubler_sent_all') == "N"))) {
// Switch to matching SQL resource
$result_load = $result_main;
- if ((SQL_NUMROWS($result_total) > 0) && ($_CONFIG['doubler_sent_all'] == "Y")) $result_load = $result_total;
+ if ((SQL_NUMROWS($result_total) > 0) && (getConfig('doubler_sent_all') == "Y")) $result_load = $result_total;
// At least one account was found
while(list($id, $uid, $points, $ip, $time) = SQL_FETCHROW($result_load)) {
}
// Exclude webmaster from doubling...
- if ($uid != $_CONFIG['doubler_uid']) {
+ if ($uid != getConfig('doubler_uid')) {
// Add points
- ADD_POINTS_REFSYSTEM(sprintf("doubler_%s", strtolower($_CONFIG['doubler_send_mode'])), $uid, $points, false, "0", false, "direct");
+ ADD_POINTS_REFSYSTEM(sprintf("doubler_%s", strtolower(getConfig('doubler_send_mode'))), $uid, $points, false, "0", false, "direct");
} // END - if
// Set entry as "payed"
$OK = false;
// Check for jackpot inclusion in doubling process
- if (($jackpot > 0) && ($jackpot >= $points) && ($_CONFIG['doubler_jackpot'] == "Y")) {
+ if (($jackpot > 0) && ($jackpot >= $points) && (getConfig('doubler_jackpot') == "Y")) {
// Subtract points from jackpot
SUB_JACKPOT($points);
$jackpot -= $points;
} // END - if
// Exclude also webmaster's ID in taking points from webmaster's account
- if (($user > 0) && ($user >= $points) && (!$OK) && ($_CONFIG['doubler_uid'] > 0) && ($uid != $_CONFIG['doubler_uid'])) {
+ if (($user > 0) && ($user >= $points) && (!$OK) && (getConfig('doubler_uid') > 0) && ($uid != getConfig('doubler_uid'))) {
// Add points to used points
- SUB_POINTS("doubler_payout", $_CONFIG['doubler_uid'], $points);
+ SUB_POINTS("doubler_payout", getConfig('doubler_uid'), $points);
// Okay, done!
$OK = true;
LOAD_EXTENSION($ext_name, "update", $ver, $dry_run);
// Do we have an update?
- if (((GET_EXT_VERSION("sql_patches") != "") && ($_CONFIG['verbose_sql'] == "Y")) || (!EXT_IS_ACTIVE("sql_patches"))) {
+ if (((GET_EXT_VERSION("sql_patches") != "") && (getConfig('verbose_sql') == "Y")) || (!EXT_IS_ACTIVE("sql_patches"))) {
if (!empty($UPDATE_NOTES)) {
// Update notes found
$NOTES .= ("<div class=\"update_notes\"><strong>v".$ver.":</strong><br />".$UPDATE_NOTES."</div>");
$active = $cacheArray['extensions']['ext_active'][$ext_name];
// Count cache hits
- if (isset($_CONFIG['cache_hits'])) $_CONFIG['cache_hits']++;
+ if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
} elseif (($ext_name == "cache") || (GET_EXT_VERSION("cache") == "")) {
//* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "DB! ext_name={$ext_name}");
// Load from database
$ret = $cacheArray['extensions']['ext_version'][$ext_name];
// Count cache hits
- if (isset($_CONFIG['cache_hits'])) $_CONFIG['cache_hits']++; else $_CONFIG['cache_hits'] = 1;
+ if (getConfig('cache_hits') > 0) $_CONFIG['cache_hits']++; else $_CONFIG['cache_hits'] = 1;
} elseif (!is_object($cacheInstance)) {
// Load from database
$result = SQL_QUERY_ESC("SELECT ext_version FROM "._MYSQL_PREFIX."_extensions WHERE ext_name='%s' LIMIT 1",
LOAD_EXTENSION($ext_name, "update", $ver, $dry_run);
// Add notes
- if ($_CONFIG['verbose_sql'] == "Y") {
+ if (getConfig('verbose_sql') == "Y") {
if (!empty($UPDATE_NOTES)) {
// Update notes found
$NOTES .= ("<div class=\"update_notes\"><strong>v".$ver.":</strong><br />".$UPDATE_NOTES."</div>");
$OUT = "";
// Do we have queries?
- if ((is_array($SQLs)) && (GET_EXT_VERSION("sql_patches") >= "0.0.7") && ($_CONFIG['verbose_sql'] == "Y")) {
+ if ((is_array($SQLs)) && (GET_EXT_VERSION("sql_patches") >= "0.0.7") && (getConfig('verbose_sql') == "Y")) {
$OUT = "<div align=\"center\">
<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"".$width."\" align=\"center\"".$dashed.">
<tr>
}
}
- if ((!$S) && (GET_EXT_VERSION("sql_patches") >= "0.0.7") && ($_CONFIG['verbose_sql'] == "Y")) {
+ if ((!$S) && (GET_EXT_VERSION("sql_patches") >= "0.0.7") && (getConfig('verbose_sql') == "Y")) {
// No addional SQL commands to run
$OUT .= "<tr>
<td colspan=\"2\" align=\"center\" class=\"switch_sw2 bottom2\" height=\"24\">
$ret = $cacheArray['extensions']['ext_name'][$ext_id];
// Count cache hits
- if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
} elseif (!EXT_IS_ACTIVE("cache")) {
// Load from database
$result = SQL_QUERY_ESC("SELECT ext_name FROM "._MYSQL_PREFIX."_extensions WHERE id=%s LIMIT 1",
$ret = $cacheArray['extensions']['ext_id'][$ext_name];
// Count cache hits
- if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
} elseif (!EXT_IS_ACTIVE("cache")) {
// Load from database
$result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_extensions WHERE ext_name='%s' LIMIT 1",
case "0.1.9": // SQL queries for v0.1.9
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD autopurge_tasks ENUM('Y','N') NOT NULL DEFAULT 'Y'";
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD ap_tasks_time BIGINT(20) UNSIGNED NOT NULL DEFAULT '".($_CONFIG['one_day']*7)."'";
+ $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD ap_tasks_time BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(getConfig('one_day')*7)."'";
// Update notes (these will be set as task text!)
$UPDATE_NOTES = "Bereinigung von zu löschenden Aufgaben klappt wieder. Zeitlimit für genanntes kann eingestellt werden (Default = 7 Tage).<br /><br /><U>Bitte aktualisieren Sie auch die Admin-Templates!</U>";
default: // Do stuff when extension is loaded
// Remove old entries
- $OLD = $_CONFIG['beg_timeout'];
- if ($_CONFIG['beg_uid_timeout'] > $OLD) $OLD = $_CONFIG['beg_uid_timeout'];
+ $OLD = getConfig('beg_timeout');
+ if (getConfig('beg_uid_timeout') > $OLD) $OLD = getConfig('beg_uid_timeout');
$result_ext = SQL_QUERY("DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_beg_ips` WHERE timeout < (UNIX_TIMESTAMP() -".($OLD + 60*60).")", __FILE__, __LINE__);
// Check for beg rallye is active and send mails out
- if (($_CONFIG['beg_rallye'] == "Y") && ($_CONFIG['beg_new_mem_notify'] == "Y")) {
+ if ((getConfig('beg_rallye') == "Y") && (getConfig('beg_new_mem_notify') == "Y")) {
// Include file for sending out mails
$INC_POOL[] = sprintf("%sinc/mails/beg_mails.php", PATH);
} // END - if
break;
default: // Do stuff when extension is loaded
- if ((isBooleanConstantAndTrue('__DAILY_RESET')) && ($_CONFIG['birthday_points'] > 0)) {
+ if ((isBooleanConstantAndTrue('__DAILY_RESET')) && (getConfig('birthday_points') > 0)) {
// Daily reset was run and we shall pay points so we start checking for members who
// has a birthday for today
$INC_POOL[] = sprintf("%sinc/mails/birthday_mails.php", PATH);
}
// Version of this extension
-$EXT_VERSION = "0.8.7";
+$EXT_VERSION = "0.8.8";
// Auto-set extension version
if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
// Version history array (add more with , "0.1" and so on)
-$EXT_VER_HISTORY = array("0.0", "0.1.6", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8", "0.3.9", "0.4.0", "0.4.1", "0.4.2", "0.4.3", "0.4.4", "0.4.5", "0.4.6", "0.4.7", "0.4.8", "0.4.9", "0.5.0", "0.5.1", "0.5.2", "0.5.3", "0.5.4", "0.5.5", "0.5.6", "0.5.7", "0.5.8", "0.5.9", "0.6.0", "0.6.1", "0.6.2", "0.6.3", "0.6.4", "0.6.5", "0.6.6", "0.6.7", "0.6.8", "0.6.9", "0.7.0", "0.7.1", "0.7.2", "0.7.3", "0.7.4", "0.7.5", "0.7.6", "0.7.7", "0.7.8", "0.7.9", "0.8.0", "0.8.1", "0.8.2", "0.8.3", "0.8.4", "0.8.5", "0.8.6", "0.8.7");
+$EXT_VER_HISTORY = array("0.0", "0.1.6", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8", "0.3.9", "0.4.0", "0.4.1", "0.4.2", "0.4.3", "0.4.4", "0.4.5", "0.4.6", "0.4.7", "0.4.8", "0.4.9", "0.5.0", "0.5.1", "0.5.2", "0.5.3", "0.5.4", "0.5.5", "0.5.6", "0.5.7", "0.5.8", "0.5.9", "0.6.0", "0.6.1", "0.6.2", "0.6.3", "0.6.4", "0.6.5", "0.6.6", "0.6.7", "0.6.8", "0.6.9", "0.7.0", "0.7.1", "0.7.2", "0.7.3", "0.7.4", "0.7.5", "0.7.6", "0.7.7", "0.7.8", "0.7.9", "0.8.0", "0.8.1", "0.8.2", "0.8.3", "0.8.4", "0.8.5", "0.8.6", "0.8.7", "0.8.8");
switch ($EXT_LOAD_MODE)
{
$SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`sort`,`descr`) VALUES VALUES ('setup','config_bonus','Bonus-{!POINTS!}',8,'Richten Sie Bonus-{!POINTS!} ein, die beim x'ten Klick auf die Mail verbucht werden sollen. Beispiele: Der 1. Klick sollte mehr {!POINTS!} zusätzlich bekommen, als der 10. Klick.')";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD login_bonus FLOAT(20,3) NOT NULL DEFAULT 10.000";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD turbo_bonus FLOAT(20,3) NOT NULL DEFAULT 100.000";
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD login_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT ".$_CONFIG['one_day']."";
+ $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD login_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT ".getConfig('one_day')."";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD turbo_rates VARCHAR(255) NOT NULL DEFAULT '50;20;10'";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD bonus_ranks TINYINT(3) UNSIGNED NOT NULL DEFAULT 10";
// Use actual month for this update
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD login_bonus FLOAT(20,3) NOT NULL DEFAULT 0.000";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD turbo_bonus FLOAT(20,3) NOT NULL DEFAULT 0.000";
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_stats ADD bonus_stats ENUM('Y','N') NOT NULL DEFAULT 'N'";
$SQLs[] = "UPDATE "._MYSQL_PREFIX."_extensions SET ext_has_css='Y' WHERE ext_name='bonus' AND ext_has_css='N' LIMIT 1";
// Update notes (these will be set as task text!)
break;
case "0.4.0": // SQL queries for v0.4.0
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD bonus_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT ".($_CONFIG['one_day']*7)."";
+ $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD bonus_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day')*7)."";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD bonus_lines BIGINT(20) UNSIGNED NOT NULL DEFAULT 10";
// Update notes (these will be set as task text!)
case "0.8.7": // SQL queries for v0.8.7
$SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('email','list_notifications','Benachrichtigungen','Listet alle an die Mitglieder ausgesandten Benachrichtigungen auf.', 10)";
+ // Update notes
+ $UPDATE_NOTES = "Benachrichtigungsmails für z.B. Bettel- oder Aktiv-Rallye werden nun angezeigt.";
+ break;
+
+ case "0.8.8": // SQL queries for v0.8.8
+ $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_stats ADD bonus_stats_active ENUM('Y','N') NOT NULL DEFAULT 'N'";
+
// Update notes
$UPDATE_NOTES = "Benachrichtigungsmails für z.B. Bettel- oder Aktiv-Rallye werden nun angezeigt.";
break;
default: // Do stuff when extension is loaded
if (isBooleanConstantAndTrue('__DAILY_RESET') && (!DEBUG_MODE) && ($CSS != 1)) {
// Daily reset was run so let's check if active rallye is activated
- if ($_CONFIG['bonus_active'] == "Y") {
+ if (getConfig('bonus_active') == "Y") {
// Run active rallye
- if($_CONFIG['bonus_stats'] > 0) $INC_POOL[] = sprintf("%sinc/stats_bonus.php", PATH);
+ if (getConfig('bonus_stats') > 0) $INC_POOL[] = sprintf("%sinc/stats_bonus.php", PATH);
$INC_POOL[] = sprintf("%sinc/monthly/monthly_bonus.php", PATH);
} else {
// Reset points
}
// Check for bonus rallye is active and send mails out
- if (($_CONFIG['bonus_active'] == "Y") && ($_CONFIG['bonus_new_mem_notify'] == "Y")) {
+ if ((getConfig('bonus_active') == "Y") && (getConfig('bonus_new_mem_notify') == "Y")) {
// Include file for sending out mails
$INC_POOL[] = sprintf("%sinc/mails/bonus_mails.php", PATH);
}
case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called)
// Configuration entries
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `booking_per_page` TINYINT(3) UNSIGNED NOT NULL DEFAULT 10";
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `booking_purge` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".($_CONFIG['one_day'] * 3)."";
+ $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `booking_purge` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day') * 3)."";
// Drop/create table for user bookings
$SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_user_book`";
global $cacheInstance;
// Initialize cache system only when it's needed
- $cacheInstance = new CacheSystem($_CONFIG['cache_update'], PATH."inc/".$_CONFIG['cache_path'], $_CONFIG['cache_tested']);
+ $cacheInstance = new CacheSystem(getConfig('cache_update'), PATH."inc/".getConfig('cache_path'), getConfig('cache_tested'));
if ($cacheInstance->getStatus() != "done") {
// Failed to initialize cache sustem
ADD_FATAL(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_CANNOT_INITIALIZE);
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `debug_mode` ENUM('CLIENT','RELAY','SERVER') NOT NULL DEFAULT 'CLIENT'";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `debug_new_log` ENUM('ACCEPT','FIRST','REG') NOT NULL DEFAULT 'FIRST'";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `debug_new_client` ENUM('ACTIVE','NEW','REG') NOT NULL DEFAULT 'NEW'";
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `debug_reject_log` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".($_CONFIG['one_day'] * 30)."";
+ $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `debug_reject_log` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day') * 30)."";
break;
case "remove": // Do stuff when removing extension
// --> This also means who fast the doubled points will be payed out!
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD doubler_send_mode ENUM('DIRECT','RESET') NOT NULL DEFAULT 'DIRECT'";
// Timeout for entries to be purged (default: one week)
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD doubler_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT ".($_CONFIG['one_day']*7)."";
+ $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD doubler_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day')*7)."";
// Number of newest entries to display
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD doubler_display_new TINYINT(3) UNSIGNED NOT NULL DEFAULT 10";
// Number of entries which will be payed out soon
break;
default: // Do stuff when extension is loaded
- if ((isBooleanConstantAndTrue('__DAILY_RESET')) && ($_CONFIG['doubler_send_mode'] == "RESET")) {
+ if ((isBooleanConstantAndTrue('__DAILY_RESET')) && (getConfig('doubler_send_mode') == "RESET")) {
// So let's check for points
$INC_POOL[] = sprintf("%sinc/doubler_send.php", PATH);
}
case "0.1.3": // SQL queries for v0.1.3
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD holiday_active ENUM('Y','N') NOT NULL DEFAULT 'N'";
$SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_max_receive WHERE value='0' LIMIT 1";
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD holiday_lock BIGINT(20) UNSIGNED NOT NULL DEFAULT '".($_CONFIG['one_day']*2)."'";
+ $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD holiday_lock BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(getConfig('one_day')*2)."'";
// Update notes (these will be set as task text!)
$UPDATE_NOTES = "Die Mitglieder-Accounts werden nicht mehr gesperrt, sondern nur auf <STRONG>Urlaub</STRONG> geschaltet. Lassen Sie sich nicht davon verwirren, dass sie "freigegeben" sind!";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD primera_min_withdraw BIGINT(20) UNSIGNED NOT NULL DEFAULT 5000";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD primera_api_name VARCHAR(255) NOT NULL DEFAULT ''";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD primera_api_md5 VARCHAR(32) NOT NULL DEFAULT ''";
+ $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD primera_refid VARCHAR(255) NOT NULL DEFAULT ''";
// User data
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD primera_userid VARCHAR(255) NOT NULL DEFAULT ''";
last_change VARCHAR(10) NOT NULL DEFAULT 0,
status ENUM('UNCONFIRMED','PENDING','CONFIRMED','LOCKED') NOT NULL DEFAULT 'UNCONFIRMED',
receive_warnings ENUM('Y','N') NOT NULL DEFAULT 'Y',
-warning_interval BIGINT(20) UNSIGNED NOT NULL DEFAULT '".($_CONFIG['one_day']*7)."',
+warning_interval BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(getConfig('one_day')*7)."',
points_amount FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
points_used FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
refid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
break;
case "0.0.2": // SQL queries for v0.0.2
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` CHANGE auto_purge auto_purge BIGINT(20) UNSIGNED NOT NULL DEFAULT ".($_CONFIG['one_day']*14)."";
+ $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` CHANGE auto_purge auto_purge BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day')*14)."";
// Update notes (these will be set as task text!)
$UPDATE_NOTES = "In der Tabelle <STRONG>"._MYSQL_PREFIX."_config</STRONG> musste die Spalte <STRONG>auto_purge</STRONG> (autom. Löschen von Bestätigungsmails angepasst werden (war auf dem Testsystem auf TINYINT(4) gesetzt.)";
case "0.1.1": // SQL queries for v0.1.1
$SQLs[] = "UPDATE `"._MYSQL_PREFIX."_admin_menu` SET title='Home-/Eingangsseite', descr='Stellen Sie hier ein, welcher Menüpunkt (what-welcome ist Standart) als Einstiegspunkt in das Menüsystem genutzt werden soll und wie die automatische Weiterleitung in der Eingangsseite funktionieren soll.' WHERE `what`='config_home' LIMIT 1";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD index_delay TINYINT(3) UNSIGNED NOT NULL DEFAULT '-1'";
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD index_cookie BIGINT(20) UNSIGNED NOT NULL DEFAULT ".($_CONFIG['one_day']*365)."";
+ $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD index_cookie BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day')*365)."";
// Update notes (these will be set as task text!)
$UPDATE_NOTES = "Sie können nun <A href=\"".URL."/modules.php?module=admin&`what`=config_home\">hier</A> die Verzögerungszeit in der <A href=\"".URL."/index.php\">Eingangsseite</A> einstellen.";
$_CONFIG['secret_key'] = "";
// Read key from secret file
- if ((empty($_CONFIG['file_hash'])) || (empty($_CONFIG['master_salt'])) || (empty($_CONFIG['pass_scramble']))) {
+ if ((getConfig('file_hash') == "") || (getConfig('master_salt') == "") || (getConfig('pass_scramble') == "")) {
// Maybe need setup of secret key!
require_once(PATH."inc/gen_sql_patches.php");
} // END - if
// Test again
- if ((!empty($_CONFIG['file_hash'])) && (!empty($_CONFIG['master_salt'])) && (!empty($_CONFIG['pass_scramble']))) {
+ if ((getConfig('file_hash') != "") && (getConfig('master_salt') != "") && (getConfig('pass_scramble') != "")) {
// File hash fas generated so we can also file the secret file... hopefully.
- $hashFile = sprintf("%sinc/.secret/.%s", PATH, $_CONFIG['file_hash']);
+ $hashFile = sprintf("%sinc/.secret/.%s", PATH, getConfig('file_hash'));
if (FILE_READABLE($hashFile)) {
// Read file
$_CONFIG['secret_key'] = implode("", file($hashFile));
} // END - if
// Transfer words/numbers to constants
- define('POINTS' , $_CONFIG['points_word']);
- define('MT_WORD' , $_CONFIG['mt_word']);
- define('MT_WORD2', $_CONFIG['mt_word2']);
- define('MT_WORD3', $_CONFIG['mt_word3']);
- define('_MAX' , $_CONFIG['rand_no']);
+ define('POINTS' , getConfig('points_word'));
+ define('MT_WORD' , getConfig('mt_word'));
+ define('MT_WORD2', getConfig('mt_word2'));
+ define('MT_WORD3', getConfig('mt_word3'));
+ define('_MAX' , getConfig('rand_no'));
} else {
// Set some lame ( ;-) ) default settings
$_CONFIG['def_refid'] = 0;
$_CONFIG['enable_title_deco'] = "N";
$_CONFIG['title_mod_show'] = "Y";
$_CONFIG['title_middle'] = "-";
- //$_CONFIG['verbose_sql'] = "N";
+ // @TODO Can we remove this? $_CONFIG['verbose_sql'] = "N";
define('MT_WORD' , DEFAULT_MT_WORD );
define('MT_WORD2', DEFAULT_MT_WORD2);
define('MT_WORD3', DEFAULT_MT_WORD3);
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_weekly_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_monthly_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_stats_reload` BIGINT(20) UNSIGNED NOT NULL DEFAULT 30";
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_purge_deleted` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".($_CONFIG['one_day']*7)."";
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_purge_migrated` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".($_CONFIG['one_day']*3)."";
+ $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_purge_deleted` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day')*7)."";
+ $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_purge_migrated` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day')*3)."";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_pause_mode` ENUM('INTERNAL','EXERNAL') NOT NULL DEFAULT 'INTERNAL'";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_pause_url` VARCHAR(255) NOT NULL DEFAULT ''";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_notify_limits` ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+ $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_notify_admin_unlock` ENUM('Y','N') NOT NULL DEFAULT 'Y'";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_warn_low_points` BIGINT(20) UNSIGNED NOT NULL DEFAULT 100";
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_low_interval` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".$_CONFIG['one_day']."";
+ $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_low_interval` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".getConfig('one_day')."";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_migrate_order` ENUM('Y','N') NOT NULL DEFAULT 'Y'";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_notification_mode` ENUM('INSTANT','RESET') NOT NULL DEFAULT 'INSTANT'";
// Add config values
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD transfer_max BIGINT(20) UNSIGNED NOT NULL DEFAULT '50'";
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD transfer_age BIGINT(20) UNSIGNED NOT NULL DEFAULT '".($_CONFIG['one_day']*28)."'";
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD transfer_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT '".$_CONFIG['one_day']."'";
+ $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD transfer_age BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(getConfig('one_day')*28)."'";
+ $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD transfer_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT '".getConfig('one_day')."'";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD transfer_balance BIGINT(20) UNSIGNED NOT NULL DEFAULT 100";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD transfer_code BIGINT(20) UNSIGNED NOT NULL DEFAULT 5";
break;
default: // Do stuff when extension is loaded
- if ((isBooleanConstantAndTrue('__DAILY_RESET')) && ($_CONFIG['ap_transfer'] == "Y")) {
+ if ((isBooleanConstantAndTrue('__DAILY_RESET')) && (getConfig('ap_transfer') == "Y")) {
// Automatically remove outdated or not displayed transactions
- TRANSFER_AUTPPURGE($_CONFIG['transfer_max'], $_CONFIG['transfer_age']);
+ TRANSFER_AUTPPURGE(getConfig('transfer_max'), getConfig('transfer_age'));
}
break;
}
case "0.3.5": // SQL queries for v0.3.5
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD `lock_reason` TINYTEXT";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD `lock_timestamp` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00'";
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `user_delete_purge` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".($_CONFIG['one_day'] * 30)."";
+ $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `user_delete_purge` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day') * 30)."";
$SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_user_del','Löschungen auflisten','Listet die Löschungen von Usern auf.', 9)";
$SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_user_del`";
$SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_user_del` (
} // END - if
// Shall we display the parsing time and number of queries?
- if ((isset($_CONFIG['show_timings'])) && ($_CONFIG['show_timings'] == "Y") && (empty($_GET['frame'])) && ($header == "2")) {
+ if ((getConfig('show_timings') == "Y") && (empty($_GET['frame'])) && ($header == "2")) {
// Then display it here
DISPLAY_PARSING_TIME_FOOTER();
} // END - if
$template = strtolower($template);
// Count the template load
- if (!isset($_CONFIG['num_templates'])) $_CONFIG['num_templates'] = 0;
- $_CONFIG['num_templates']++;
+ if (getConfig('num_templates') == null) {
+ $_CONFIG['num_templates'] = 1;
+ } else {
+ $_CONFIG['num_templates']++;
+ }
// Init some data
$ret = "";
// Is content an array?
if (is_array($content)) {
// Merge data
- $content = array_merge($content, SQL_FETCHARRAY($result));
+ $content = merge_array($content, SQL_FETCHARRAY($result));
// Translate gender
$content['gender'] = TRANSLATE_GENDER($content['gender']);
// Generate a password in a specified length or use default password length
function GEN_PASS($LEN = 0) {
global $_CONFIG;
- if ($LEN == 0) $LEN = $_CONFIG['pass_len'];
+ if ($LEN == 0) $LEN = getConfig('pass_len');
// Initialize array with all allowed chars
$ABC = explode(",", "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,0,1,2,3,4,5,6,7,8,9,-,+,_,/");
global $_CONFIG;
// Default is 3 you can change this in admin area "Misc -> Misc Options"
- if (empty($_CONFIG['max_comma'])) $_CONFIG['max_comma'] = "3";
+ if (getConfig('max_comma') == null) $_CONFIG['max_comma'] = "3";
// Use from config is default
- $maxComma = $_CONFIG['max_comma'];
+ $maxComma = getConfig('max_comma');
// Use from parameter?
if ($max > 0) $maxComma = $max;
$email = WEBMASTER;
// Expiration in a nice output format
- if ($_CONFIG['auto_purge'] == 0) {
+ if (getConfig('auto_purge') == 0) {
// Will never expire!
$EXPIRATION = MAIL_WILL_NEVER_EXPIRE;
} elseif (function_exists('CREATE_FANCY_TIME')) {
// Create nice date string
- $EXPIRATION = CREATE_FANCY_TIME($_CONFIG['auto_purge']);
+ $EXPIRATION = CREATE_FANCY_TIME(getConfig('auto_purge'));
} else {
// Display days only
- $EXPIRATION = round($_CONFIG['auto_purge']/60/60/24)." "._DAYS;
+ $EXPIRATION = round(getConfig('auto_purge')/60/60/24)." "._DAYS;
}
// Is content an array?
// Fetch and merge data
//* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):content()=".count($content)." - PRE<br />\n";
- $content = array_merge($content, SQL_FETCHARRAY($result));
+ $content = merge_array($content, SQL_FETCHARRAY($result));
//* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):content()=".count($content)." - AFTER<br />\n";
// Free result
// Use configured min age or fixed?
if (GET_EXT_VERSION("other") >= "0.2.1") {
// Configured
- $startYear = $YEAR - $_CONFIG['min_age'];
+ $startYear = $YEAR - getConfig('min_age');
} else {
// Fixed 16 years
$startYear = $YEAR - 16;
// Calculate earliest year depending on extension version
if (GET_EXT_VERSION("other") >= "0.2.1") {
// Use configured minimum age
- $YEAR = date('Y', time()) - $_CONFIG['min_age'];
+ $YEAR = date('Y', time()) - getConfig('min_age');
} else {
// Use fixed 16 years age
$YEAR = date('Y', time()) - 16;
{
switch ($yn)
{
- case 'Y': $yn = YES; break;
- case 'N': $yn = NO; break;
+ case "Y": $yn = YES; break;
+ case "N": $yn = NO; break;
default : $yn = "??? (".$yn.")"; break;
}
return $yn;
// Build key string
$keys = SITE_KEY.":".DATE_KEY;
- if (isset($_CONFIG['secret_key'])) $keys .= ":".$_CONFIG['secret_key'];
- if (isset($_CONFIG['file_hash'])) $keys .= ":".$_CONFIG['file_hash'];
- $keys .= ":".date("d-m-Y (l-F-T)", bigintval($_CONFIG['patch_ctime']));
- if (isset($_CONFIG['master_salt'])) $keys .= ":".$_CONFIG['master_salt'];
+ if (getConfig('secret_key') != null) $keys .= ":".getConfig('secret_key');
+ if (getConfig('file_hash') != null) $keys .= ":".getConfig('file_hash');
+ $keys .= ":".date("d-m-Y (l-F-T)", bigintval(getConfig('patch_ctime')));
+ if (getConfig('master_salt') != null) $keys .= ":".getConfig('master_salt');
// Build string from misc data
$data = $code.":".$uid.":".$DATA;
// Calculate number for generating the code
$a = $code + _ADD - 1;
- if (isset($_CONFIG['master_hash'])) {
+ if (getConfig('master_hash') != null) {
// Generate hash with master salt from modula of number with the prime number and other data
- $saltedHash = generateHash(($a % _PRIME).":".$server.":".$keys.":".$data.":".date("d-m-Y (l-F-T)", time()).":".$a, $_CONFIG['master_salt']);
+ $saltedHash = generateHash(($a % _PRIME).":".$server.":".$keys.":".$data.":".date("d-m-Y (l-F-T)", time()).":".$a, getConfig('master_salt'));
// Create number from hash
- $rcode = hexdec(substr($saltedHash, strlen($_CONFIG['master_salt']), 9)) / abs(_MAX - $a + sqrt(_ADD)) / pi();
+ $rcode = hexdec(substr($saltedHash, strlen(getConfig('master_salt')), 9)) / abs(_MAX - $a + sqrt(_ADD)) / pi();
} else {
// Generate hash with "hash of site key" from modula of number with the prime number and other data
$saltedHash = generateHash(($a % _PRIME).":".$server.":".$keys.":".$data.":".date("d-m-Y (l-F-T)", time()).":".$a, substr(sha1(SITE_KEY), 0, 8));
}
// At least 10 numbers shall be secure enought!
- $len = $_CONFIG['code_length'];
+ $len = getConfig('code_length');
if ($len == 0) $len = $length;
if ($len == 0) $len = 10;
function GENERATE_IMAGE($img_code, $header=true) {
global $_CONFIG;
- if ((strlen($img_code) > 6) || (empty($img_code)) || ($_CONFIG['code_length'] == 0)) {
+ if ((strlen($img_code) > 6) || (empty($img_code)) || (getConfig('code_length') == 0)) {
// Stop execution of function here because of over-sized code length
return;
} elseif (!$header) {
}
// Load image
- $img = sprintf("%s/theme/%s/images/code_bg.%s", PATH, GET_CURR_THEME(), $_CONFIG['img_type']);
+ $img = sprintf("%s/theme/%s/images/code_bg.%s", PATH, GET_CURR_THEME(), getConfig('img_type'));
if (FILE_READABLE($img)) {
// Switch image type
- switch ($_CONFIG['img_type'])
+ switch (getConfig('img_type'))
{
case "jpg":
// Okay, load image and hide all errors
imagestring($image, 5, 14, 2, $img_code, $text_color);
// Return to browser
- header ("Content-Type: image/".$_CONFIG['img_type']);
+ header ("Content-Type: image/".getConfig('img_type'));
// Output image with matching image factory
- switch ($_CONFIG['img_type']) {
+ switch (getConfig('img_type')) {
case "jpg": imagejpeg($image); break;
case "png": imagepng($image); break;
}
$M2 = date("m", (time() + $timestamp));
// If so and if current time is before 02/29 and estimated time is after 02/29 then add 86400 seconds (one day)
- if ((floor($TEST) == $TEST) && ($M1 == "02") && ($M2 > "02")) $SWITCH = $_CONFIG['one_day'];
+ if ((floor($TEST) == $TEST) && ($M1 == "02") && ($M2 > "02")) $SWITCH = getConfig('one_day');
// First of all years...
$Y = abs(floor($timestamp / (31536000 + $SWITCH)));
$M = abs(floor($timestamp / 2628000 - $Y * 12));
//* DEBUG: */ print("M={$M}<br />\n");
// Next weeks
- $W = abs(floor($timestamp / 604800 - $Y * ((365 + $SWITCH / $_CONFIG['one_day']) / 7) - ($M / 12 * (365 + $SWITCH / $_CONFIG['one_day']) / 7)));
+ $W = abs(floor($timestamp / 604800 - $Y * ((365 + $SWITCH / getConfig('one_day')) / 7) - ($M / 12 * (365 + $SWITCH / getConfig('one_day')) / 7)));
//* DEBUG: */ print("W={$W}<br />\n");
// Next days...
- $D = abs(floor($timestamp / 86400 - $Y * (365 + $SWITCH / $_CONFIG['one_day']) - ($M / 12 * (365 + $SWITCH / $_CONFIG['one_day'])) - $W * 7));
+ $D = abs(floor($timestamp / 86400 - $Y * (365 + $SWITCH / getConfig('one_day')) - ($M / 12 * (365 + $SWITCH / getConfig('one_day'))) - $W * 7));
//* DEBUG: */ print("D={$D}<br />\n");
// Next hours...
- $h = abs(floor($timestamp / 3600 - $Y * (365 + $SWITCH / $_CONFIG['one_day']) * 24 - ($M / 12 * (365 + $SWITCH / $_CONFIG['one_day']) * 24) - $W * 7 * 24 - $D * 24));
+ $h = abs(floor($timestamp / 3600 - $Y * (365 + $SWITCH / getConfig('one_day')) * 24 - ($M / 12 * (365 + $SWITCH / getConfig('one_day')) * 24) - $W * 7 * 24 - $D * 24));
//* DEBUG: */ print("h={$h}<br />\n");
// Next minutes..
- $m = abs(floor($timestamp / 60 - $Y * (365 + $SWITCH / $_CONFIG['one_day']) * 24 * 60 - ($M / 12 * (365 + $SWITCH / $_CONFIG['one_day']) * 24 * 60) - $W * 7 * 24 * 60 - $D * 24 * 60 - $h * 60));
+ $m = abs(floor($timestamp / 60 - $Y * (365 + $SWITCH / getConfig('one_day')) * 24 * 60 - ($M / 12 * (365 + $SWITCH / getConfig('one_day')) * 24 * 60) - $W * 7 * 24 * 60 - $D * 24 * 60 - $h * 60));
//* DEBUG: */ print("m={$m}<br />\n");
// And at last seconds...
- $s = abs(floor($timestamp - $Y * (365 + $SWITCH / $_CONFIG['one_day']) * 24 * 3600 - ($M / 12 * (365 + $SWITCH / $_CONFIG['one_day']) * 24 * 3600) - $W * 7 * 24 * 3600 - $D * 24 * 3600 - $h * 3600 - $m * 60));
+ $s = abs(floor($timestamp - $Y * (365 + $SWITCH / getConfig('one_day')) * 24 * 3600 - ($M / 12 * (365 + $SWITCH / getConfig('one_day')) * 24 * 3600) - $W * 7 * 24 * 3600 - $D * 24 * 3600 - $h * 3600 - $m * 60));
//* DEBUG: */ print("s={$s}<br />\n");
// Is seconds zero and time is < 60 seconds?
$TEST = date('Y', time()) / 4;
$M1 = date("m", time());
// If so and if current time is before 02/29 and estimated time is after 02/29 then add 86400 seconds (one day)
- if ((floor($TEST) == $TEST) && ($M1 == "02") && ($POST[$prefix."_mo"] > "02")) $SWITCH = $_CONFIG['one_day'];
+ if ((floor($TEST) == $TEST) && ($M1 == "02") && ($POST[$prefix."_mo"] > "02")) $SWITCH = getConfig('one_day');
// First add years...
$ret += $POST[$prefix."_ye"] * (31536000 + $SWITCH);
// Next months...
$useProxy = false;
// Are proxy settins set?
- if ((!empty($_CONFIG['proxy_host'])) && ($_CONFIG['proxy_port'] > 0)) {
+ if ((getConfig('proxy_host') != "") && (getConfig('proxy_port') > 0)) {
// Then use it
$useProxy = true;
} // END - if
// Open connection
//* DEBUG: */ die("SCRIPT=".$script."<br />\n");
if ($useProxy) {
- $fp = @fsockopen(COMPILE_CODE($_CONFIG['proxy_host']), $_CONFIG['proxy_port'], $errno, $errdesc, 30);
+ $fp = @fsockopen(COMPILE_CODE(getConfig('proxy_host')), getConfig('proxy_port'), $errno, $errdesc, 30);
} else {
$fp = @fsockopen($host, 80, $errno, $errdesc, 30);
}
$proxyTunnel .= "Host: ".$host."\r\n";
// Use login data to proxy? (username at least!)
- if (!empty($_CONFIG['proxy_username'])) {
+ if (getConfig('proxy_username') != "") {
// Add it as well
- $encodedAuth = base64_encode(COMPILE_CODE($_CONFIG['proxy_username']).":".COMPILE_CODE($_CONFIG['proxy_password']));
+ $encodedAuth = base64_encode(COMPILE_CODE(getConfig('proxy_username')).":".COMPILE_CODE(getConfig('proxy_password')));
$proxyTunnel .= "Proxy-Authorization: Basic ".$encodedAuth."\r\n";
} // END - if
} // END - if
// Do we miss an arry element here?
- if (!isset($_CONFIG['file_hash'])) {
+ if (getConfig('file_hash') == null) {
// Stop here
print("Missing file_hash in ".__FUNCTION__.". Backtrace:<pre>");
debug_print_backtrace();
$server = $_SERVER['PHP_SELF'].":".GET_USER_AGENT().":".getenv('SERVER_SOFTWARE').":".GET_REMOTE_ADDR().":".":".filemtime(PATH."inc/databases.php");
// Build key string
- $keys = SITE_KEY.":".DATE_KEY.":".$_CONFIG['secret_key'].":".$_CONFIG['file_hash'].":".date("d-m-Y (l-F-T)", bigintval($_CONFIG['patch_ctime'])).":".$_CONFIG['master_salt'];
+ $keys = SITE_KEY.":".DATE_KEY.":".getConfig('secret_key').":".getConfig('file_hash').":".date("d-m-Y (l-F-T)", bigintval(getConfig('patch_ctime'))).":".getConfig('master_salt');
// Additional data
$data = $plainText.":".uniqid(mt_rand(), true).":".time();
//* DEBUG: */ echo "Descrambled=".$sha1b." (".strlen($sha1b).")<br />";
// Generate the password salt string
- $salt = substr($sha1, 0, $_CONFIG['salt_length']);
+ $salt = substr($sha1, 0, getConfig('salt_length'));
//* DEBUG: */ echo $salt." (".strlen($salt).")<br />";
} else {
// Use given salt
- $salt = substr($salt, 0, $_CONFIG['salt_length']);
+ $salt = substr($salt, 0, getConfig('salt_length'));
//* DEBUG: */ echo "GIVEN={$salt}<br />\n";
}
return $str;
} elseif (strlen($str) == 40) {
// From database
- $scrambleNums = explode(":", $_CONFIG['pass_scramble']);
+ $scrambleNums = explode(":", getConfig('pass_scramble'));
} else {
// Generate new numbers
$scrambleNums = explode(":", genScrambleString(strlen($str)));
if (strlen($str) != 40) return $str;
// Load numbers from config
- $scrambleNums = explode(":", $_CONFIG['pass_scramble']);
+ $scrambleNums = explode(":", getConfig('pass_scramble'));
// Validate numbers
if (count($scrambleNums) != 40) return $str;
if ((!empty($_GET['refid'])) && (strpos($URL, "refid=") == 0)) {
// Cookie found in URL
$ADD .= $BIND."refid=".bigintval($_GET['refid']);
- } elseif ((GET_EXT_VERSION("sql_patches") != '') && ($_CONFIG['def_refid'] > 0)) {
+ } elseif ((GET_EXT_VERSION("sql_patches") != '') && (getConfig('def_refid') > 0)) {
// Not found! So let's set default here
- $ADD .= $BIND."refid=".$_CONFIG['def_refid'];
+ $ADD .= $BIND."refid=".getConfig('def_refid');
}
// Is there already added data? Then change the binder
$ret = $passHash;
// Is a secret key and master salt already initialized?
- if ((!empty($_CONFIG['secret_key'])) && (!empty($_CONFIG['master_salt']))) {
+ if ((getConfig('secret_key') != "") && (getConfig('master_salt') != "")) {
// Only calculate when the secret key is generated
$newHash = ""; $start = 9;
for ($idx = 0; $idx < 10; $idx++) {
$part1 = hexdec(substr($passHash, $start, 4));
- $part2 = hexdec(substr($_CONFIG['secret_key'], $start, 4));
+ $part2 = hexdec(substr(getConfig('secret_key'), $start, 4));
$mod = dechex($idx);
if ($part1 > $part2) {
$mod = dechex(sqrt(($part1 - $part2) * _PRIME / pi()));
} // END - for
//* DEBUG: */ print($passHash."<br />".$newHash." (".strlen($newHash).")");
- $ret = generateHash($newHash, $_CONFIG['master_salt']);
+ $ret = generateHash($newHash, getConfig('master_salt'));
//* DEBUG: */ print($ret."<br />\n");
} else {
// Hash it simple
// Display parsing time and number of SQL queries in footer
function DISPLAY_PARSING_TIME_FOOTER() {
global $_CONFIG;
- $endTime = microtime(true);
// Is the timer started?
if (!isset($GLOBALS['startTime'])) {
// Abort here
return false;
- }
+ } // END - if
+
+ // Get end time
+ $endTime = microtime(true);
// "Explode" both times
$start = explode(" ", $GLOBALS['startTime']);
// Prepare output
$content = array(
'runtime' => $runTime,
- 'numSQLs' => ($_CONFIG['sql_count'] + 1),
- 'numTemplates' => ($_CONFIG['num_templates'] + 1)
+ 'numSQLs' => (getConfig('sql_count') + 1),
+ 'numTemplates' => (getConfig('num_templates') + 1)
);
// Load the template
$currWeek = date("W", time());
// Has it changed?
- if ($_CONFIG['last_week'] != $currWeek) {
+ if (getConfig('last_week') != $currWeek) {
// Include weekly reset scripts
- $INC_POOL = array_merge($INC_POOL, GET_DIR_AS_ARRAY(PATH."inc/weekly/", "weekly_"));
+ $INC_POOL = merge_array($INC_POOL, GET_DIR_AS_ARRAY(PATH."inc/weekly/", "weekly_"));
// Update config
if (!defined('DEBUG_WEEKLY')) UPDATE_CONFIG("last_week", $currWeek);
$currMonth = date("m", time());
// Has it changed?
- if ($_CONFIG['last_month'] != $currMonth) {
+ if (getConfig('last_month') != $currMonth) {
// Include monthly reset scripts
- $INC_POOL = array_merge($INC_POOL, GET_DIR_AS_ARRAY(PATH."inc/monthly/", "monthly_"));
+ $INC_POOL = merge_array($INC_POOL, GET_DIR_AS_ARRAY(PATH."inc/monthly/", "monthly_"));
// Update config
if (!defined('DEBUG_MONTHLY')) UPDATE_CONFIG("last_month", $currMonth);
// If we have an array simply use it and pre-extend it with our value
if (is_array($extraValue)) {
// Make the new args array
- $args = array_merge(array($value), $extraValue);
+ $args = merge_array(array($value), $extraValue);
} // END - if
// Call the multi-parameter call-back
}
// Purge admin menu cache
function CACHE_PURGE_ADMIN_MENU ($id=0, $action="", $what="", $str="") {
- global $_CONFIG, $cacheInstance;
+ global $cacheInstance;
// Is the cache extension enabled or no cache instance or admin menu cache disabled?
if (!EXT_IS_ACTIVE("cache")) {
// No cache instance!
DEBUG_LOG(__FUNCTION__, __LINE__, " No cache instance found.");
return false;
- } elseif ((!isset($_CONFIG['cache_admin_menu'])) || ($_CONFIG['cache_admin_menu'] == "N")) {
+ } elseif ((getConfig('cache_admin_menu') == null) || (getConfig('cache_admin_menu') == "N")) {
// Caching disabled (currently experiemental!)
return false;
}
} elseif ((isSessionVariableSet('refid')) && (get_session('refid') != 0)) {
// Set session refid als global
$GLOBALS['refid'] = bigintval(get_session('refid'));
- } elseif ((GET_EXT_VERSION("sql_patches") != "") && ($_CONFIG['def_refid'] > 0)) {
+ } elseif ((GET_EXT_VERSION("sql_patches") != "") && (getConfig('def_refid') > 0)) {
// Set default refid as refid in URL
- $GLOBALS['refid'] = bigintval($_CONFIG['def_refid']);
- } elseif ((GET_EXT_VERSION("user") >= "0.3.4") && ($_CONFIG['select_user_zero_refid']) == "Y") {
+ $GLOBALS['refid'] = bigintval(getConfig('def_refid'));
+ } elseif ((GET_EXT_VERSION("user") >= "0.3.4") && (getConfig('select_user_zero_refid')) == "Y") {
// Select a random user which has confirmed enougth mails
$GLOBALS['refid'] = SELECT_RANDOM_REFID();
} else {
}
// Set cookie when default refid > 0
- if (!isSessionVariableSet('refid') || (!empty($GLOBALS['refid'])) || ((get_session('refid') == "0") && (isset($_CONFIG['def_refid'])) && ($_CONFIG['def_refid'] > 0))) {
+ if (!isSessionVariableSet('refid') || (!empty($GLOBALS['refid'])) || ((get_session('refid') == "0") && (getConfig('def_refid') > 0))) {
// Set cookie
set_session('refid', $GLOBALS['refid']);
} // END - if
return (((function_exists('apache_get_modules')) && (in_array($apacheModule, apache_get_modules()))) || (!function_exists('apache_get_modules')));
}
+// Getter for $_CONFIG entries
+function getConfig ($entry) {
+ global $_CONFIG;
+
+ // Default value
+ $value = null;
+
+ // Is the entry there?
+ if (isset($_CONFIG[$entry])) {
+ // Then use it
+ $value = $_CONFIG[$entry];
+ } // END - if
+
+ // Return it
+ return $value;
+}
+
//////////////////////////////////////////////////
// //
// AUTOMATICALLY RE-GENERATED MISSING FUNCTIONS //
if (GET_EXT_VERSION("sql_patches") < "0.3.6") return false;
// Check if there is no scrambling string
-if (empty($_CONFIG['pass_scramble'])) {
+if (getConfig('pass_scramble') == "") {
// Generate 40 chars long scramble string
$scrambleString = genScrambleString(40);
} // END - if
// Check if there is no master salt string
-if (empty($_CONFIG['master_salt'])) {
+if (getConfig('master_salt') == "") {
// Generate the master salt which is the first chars minus 40 chars of this random hash
// We do an extra scrambling here...
$masterSalt = scrambleString(substr(generateHash(GEN_PASS(mt_rand(128, 256))), 0, -40));
unset($masterSalt);
} // END - if
-if (empty($_CONFIG['file_hash'])) {
+if (getConfig('file_hash') == "") {
// Create filename from hashed random string
$file_hash = generateHash(sha1(GEN_PASS(mt_rand(128, 256))));
$file = PATH."inc/.secret/.".$file_hash;
// Config and database connection valid?
if ((isset($_CONFIG)) && (is_array($_CONFIG)) && (count($_CONFIG) > 1) && (is_resource($link)) && (isset($db))) {
// Title decoration enabled?
- if (($_CONFIG['enable_title_deco'] == "Y") && (!empty($_CONFIG['title_left']))) $TITLE .= trim($_CONFIG['title_left'])." ";
+ if ((getConfig('enable_title_deco') == "Y") && (getConfig('title_left') != "")) $TITLE .= trim(getConfig('title_left'))." ";
// Do we have some extra title?
if (!empty($EXTRA_TITLE)) {
$TITLE .= MAIN_TITLE;
// Add title of module? (middle decoration will also be added!)
- if (isset($_CONFIG['enable_mod_title'])) {
- if (($_CONFIG['enable_mod_title'] == "Y") || ((empty($GLOBALS['what'])) && (empty($GLOBALS['action']))) || ($GLOBALS['module'] == "admin")) $TITLE .= " ".trim($_CONFIG['title_middle'])." ".ADD_MODULE_TITLE($GLOBALS['module']);
- } // END - if
+ if ((getConfig('enable_mod_title') == "Y") || ((empty($GLOBALS['what'])) && (empty($GLOBALS['action']))) || ($GLOBALS['module'] == "admin")) $TITLE .= " ".trim(getConfig('title_middle'))." ".ADD_MODULE_TITLE($GLOBALS['module']);
// Add title from what file
$MODE = "";
if ($GLOBALS['module'] == "login") $MODE = "member";
elseif ($GLOBALS['module'] == "index") $MODE = "guest";
- if ((!empty($MODE)) && (isset($_CONFIG['enable_what_title'])) && ($_CONFIG['enable_what_title'] == "Y")) $TITLE .= " ".trim($_CONFIG['title_middle'])." ".GET_MOD_DESCR($MODE, $GLOBALS['what']);
+ if ((!empty($MODE)) && (getConfig('enable_what_title') == "Y")) $TITLE .= " ".trim(getConfig('title_middle'))." ".GET_MOD_DESCR($MODE, $GLOBALS['what']);
// Add title decorations? (right)
- if (($_CONFIG['enable_title_deco'] == "Y") && (!empty($_CONFIG['title_right']))) $TITLE .= " ".trim($_CONFIG['title_right']);
+ if ((getConfig('enable_title_deco') == "Y") && (getConfig('title_right') != "")) $TITLE .= " ".trim(getConfig('title_right'));
// Remember title in constant for the template
define('__PAGE_TITLE', html_entity_decode($TITLE));
$sql = str_replace("\n\n", "\n", $sql);
// And split it up against ;\n ...
- $SQLs = array_merge($SQLs, explode(";\n", $sql));
+ $SQLs = merge_array($SQLs, explode(";\n", $sql));
} // END - if
} // END - foreach
define('GUEST_STATS_YONLINE', "Gestern Online gewesen");
define('GUEST_STATS_TREGISTER', "Heutige Anmeldungen");
define('GUEST_STATS_YREGISTER', "Gestrige Anmeldungen");
+define('GUEST_STATS_INACTIVE', "Mitgliederstatistik deaktiviert");
define('CHANGE_MENUS', "Ändern");
define('CHANGE_MEMBER_MENU', "Verdecken, anzeigen, deaktivieren, aktivieren des Mitgliedsmenüs");
define('CHANGE_MENU_1', "Ändern von <strong>");
define('SVN_CHECKOUT_COMMAND', "SVN auschecken mit:");
define('DOWNLOAD_NOW', "Jetzt downloaden!");
define('ADMIN_MEMBER_STATS_TITLE', "Einstellungen an der Mitglieder-Statistik");
-define('ADMIN_MEMBER_STATS_LIMIT', "Anzahl Mailbuchungen pro Seite");
+define('ADMIN_MEMBER_STATS_LIMIT', "Anzahl Mailbuchungen pro Seite (<strong>Nicht verwendet!</strong>)");
define('MEMBER_NO_THEMES_FOUND', "Keine Design gefunden!");
define('MEMBER_THEME_LIST_NOTE', "Wenn Sie Fragen zu einem der Designs haben, wenden Sie sich bitte an den jeweiligen Autor!");
define('MEMBER_SAVE_THEME', "Design speichern");
define('PRIMERA_ADMIN_MIN_WITHDRAW', "Minimumguthaben für Einzahlungen.");
define('PRIMERA_ADMIN_API_NAME', "Primus-Nickname");
define('PRIMERA_ADMIN_API_MD5', "Primera-Passwort (Wird als MD5-Hash gespeichert)");
+define('PRIMERA_ADMIN_API_REFID', "Primus-Referal-ID (???)");
define('PRIMERA_ADMIN_CONFIG_NOTE', "<A href=\"http://www.primusportal.de/r/Quix0r\" target=\"_blank\">Hier</A> können Sie sich ein Primus-Portal-Account holen. <strong>Geben Sie immer Ihren Usernamen von Primus-Portal ein und überprüfen Sie diesen mehrmals! Er wird zum Überweisen von Primera benötigt.");
define('PRIMERA_ADMIN_NO_TRANSFERS', "Derzeit keine Primera transferiert!");
define('PRIMERA_ADMIN_ACCOUNT', "Account bei Primus-Portal");
define('ADMIN_CONFIG_SURFBAR_PAUSE_MODE_INTERNAL', "Auf interne Pausenseite umleiten.");
define('ADMIN_CONFIG_SURFBAR_PAUSE_MODE_EXTERNAL', "Auf externe Seite umleiten.<br /><span class=\"admin_note\">(Bitte angeben)</span>");
define('ADMIN_CONFIG_SURFBAR_PAUSE_URL', "Externe Pausenseite: (leer lassen, wenn auf interne umgeleitet werden soll)");
-define('ADMIN_CONFIG_SURFBAR_NOTIFY_LIMITS', "Soll das Mitglied per Mail benachrichtigt werden, wenn aufrufbegrenzte URLs abgelaufen und auf "pausierend" gesetzt sind?");
+define('ADMIN_CONFIG_SURFBAR_NOTIFY_LIMITS', "Soll das Mitglied per Mail benachrichtigt werden, wenn aufrufbegrenzte URLs abgelaufen und auf "pausierend" gesetzt sind? (<strong>Derzeit nicht verwendet!</strong>)");
+define('ADMIN_CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK', "Soll der Administrator auch bei durch ihn freigegebene URLs benachrichtigt werden?");
define('ADMIN_CONFIG_SURFBAR_WARN_LOW_POINTS', "Mitglied warnen, wenn {!POINTS!}-Guthaben unterschritten ist: (0=keine Warnung aussenden)");
define('ADMIN_CONFIG_SURFBAR_MIGRATE_ORDER', "Sollen URLs aus Mailfreischaltungen in die Surfbar migriert werden? (Diese sind nicht sofort freigegeben)");
define('ADMIN_CONFIG_SURFBAR_LOW_INTERVAL', "Wiederholungsinterval für Nachrichten wegen niedrigem {!POINTS!}-Guthaben:");
}
if ($lines == 1) {
// Count cache hits
- if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
break;
}
}
// Set mode depending on how many mails the member has to confirm
$locked = false;
- if (($_CONFIG['ref_payout'] > 0) && ($_CONFIG['allow_direct_pay'] == "N")) $locked = true;
+ if ((getConfig('ref_payout') > 0) && (getConfig('allow_direct_pay') == "N")) $locked = true;
// Is begging rallye active?
- if ($_CONFIG['beg_rallye'] == "Y") {
+ if (getConfig('beg_rallye') == "Y") {
// Add points to rallye account
SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_user_data` SET beg_points=beg_points+%s WHERE userid=%s LIMIT 1",
array($points, $uid), __FILE__, __LINE__);
} else {
// Add points to account
unset($DEPTH);
- ADD_POINTS_REFSYSTEM("beg", $uid, $points, false, "0", $locked, strtolower($_CONFIG['beg_mode']));
+ ADD_POINTS_REFSYSTEM("beg", $uid, $points, false, "0", $locked, strtolower(getConfig('beg_mode')));
}
// Subtract begged points from member account if the admin has selected one
- if ($_CONFIG['beg_uid'] > 0) {
+ if (getConfig('beg_uid') > 0) {
// Subtract from this account
- SUB_POINTS("beg_payout", $_CONFIG['beg_uid'], $points);
+ SUB_POINTS("beg_payout", getConfig('beg_uid'), $points);
} // END - if
}
global $_CONFIG;
// Shall we add bonus points?
- if ($_CONFIG['bonus_active'] == "N") return false;
+ if (getConfig('bonus_active') == "N") return false;
// Init variables
$SQL = ""; $bonys = 0; $mail = 0; $column = "";
// Which rank?
if ($rank == 1) {
// First rank!
- $points = $_CONFIG['turbo_bonus'];
+ $points = getConfig('turbo_bonus');
} else {
// Anything else so let's explode all entered rank points
- $test = explode(";", $_CONFIG['turbo_rates']);
+ $test = explode(";", getConfig('turbo_rates'));
if (!empty($test[$rank - 2])) {
// Level found
$points = $test[$rank - 2];
$result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_bonus_turbo (userid, mail_id, bonus_id, level, points, timemark) VALUES ('%s', '%s', '%s', '%s', '%s', UNIX_TIMESTAMP())",
array(bigintval($uid), bigintval($mail), bigintval($bonus), $rank, $points), __FILE__, __LINE__);
- if ((GET_EXT_VERSION("bonus") >= "0.3.5") && ($_CONFIG['bonus_mode'] != "ADD") && ($points > 0)) BONUS_POINTS_HANDLER($points);
+ if ((GET_EXT_VERSION("bonus") >= "0.3.5") && (getConfig('bonus_mode') != "ADD") && ($points > 0)) BONUS_POINTS_HANDLER($points);
}
//
function BONUS_MAKE_RANK_ROWS ($data, $type, $uid) {
$self = false; $OUT = "";
// How many ranks do we have?
- $ranks = sizeof(explode(";", $_CONFIG['turbo_rates'])) + 1;
+ $ranks = sizeof(explode(";", getConfig('turbo_rates'))) + 1;
// Load current user's data
$result = SQL_QUERY_ESC("SELECT level, points, timemark FROM "._MYSQL_PREFIX."_bonus_turbo WHERE %s=%s AND userid=%s LIMIT 1",
// Load rankings
$result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_bonus_turbo WHERE %s=%s ORDER BY level LIMIT %s",
- array($type, $data, $_CONFIG['bonus_lines']), __FILE__, __LINE__);
+ array($type, $data, getConfig('bonus_lines')), __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
// Start generating the ranking list
$max = SQL_NUMROWS($result);
return $OUT;
}
//
-function BONUS_POINTS_HANDLER($MODE) {
+function BONUS_POINTS_HANDLER ($MODE) {
global $_CONFIG;
// Shall we add bonus points?
- if ($_CONFIG['bonus_active'] == "N") return;
+ if (getConfig('bonus_active') == "N") return;
// Switch to jackpot-mode when no UID is supplied but userid-mode is selected
- if (($_CONFIG['bonus_mode'] == "UID") && ($_CONFIG['bonus_uid'] == "0")) {
+ if ((getConfig('bonus_mode') == "UID") && (getConfig('bonus_uid') == "0")) {
// Update database
UPDATE_CONFIG(array('bonus_mode'), array("JACKPOT"));
// Update configuration
- $_CONFIG['bonus_mode'] = "JACKPOT";
+ getConfig('bonus_mode') = "JACKPOT";
} // END - if
if ($MODE == "login_bonus") {
// Login bonus detected
- $points = $_CONFIG['login_bonus'];
+ $points = getConfig('login_bonus');
} else {
// Direct points supplied
$points = $MODE;
}
// Subtract points from...
- switch ($_CONFIG['bonus_mode'])
+ switch (getConfig('bonus_mode'))
{
case "JACKPOT": // ... jackpot
- if ((SUB_JACKPOT($points) == -1) && ($_CONFIG['bonus_uid'] > 0)) {
+ if ((SUB_JACKPOT($points) == -1) && (getConfig('bonus_uid') > 0)) {
// Check points amount first...
- $TOTAL = GET_TOTAL_DATA($_CONFIG['bonus_uid'], "user_points", "points") - GET_TOTAL_DATA($_CONFIG['bonus_uid'], "user_data", "used_points");
+ $TOTAL = GET_TOTAL_DATA(getConfig('bonus_uid'), "user_points", "points") - GET_TOTAL_DATA(getConfig('bonus_uid'), "user_data", "used_points");
if ($TOTAL >= $points) {
// Subtract points from userid's account
- SUB_POINTS("bonus_payout_jackpot", $_CONFIG['bonus_uid'], $points);
+ SUB_POINTS("bonus_payout_jackpot", getConfig('bonus_uid'), $points);
} // END - if
} // END - if
break;
case "UID": // ... userid's account
// Check his amount first
- $TOTAL = GET_TOTAL_DATA($_CONFIG['bonus_uid'], "user_points", "points") - GET_TOTAL_DATA($_CONFIG['bonus_uid'], "user_data", "used_points");
+ $TOTAL = GET_TOTAL_DATA(getConfig('bonus_uid'), "user_points", "points") - GET_TOTAL_DATA(getConfig('bonus_uid'), "user_data", "used_points");
if ($TOTAL >= $points) {
// Subtract points from userid's account
- SUB_POINTS("bonus_payout_uid", $_CONFIG['bonus_uid'], $points);
+ SUB_POINTS("bonus_payout_uid", getConfig('bonus_uid'), $points);
} else {
// Try to subtract from jackpot
$dummy = SUB_JACKPOT($points);
global $_CONFIG;
// Remove entries
- $result = SQL_QUERY("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_bonus_turbo WHERE timemark < (UNIX_TIMESTAMP() - ".$_CONFIG['bonus_timeout'].")", __FILE__, __LINE__);
+ $result = SQL_QUERY("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_bonus_turbo WHERE timemark < (UNIX_TIMESTAMP() - ".getConfig('bonus_timeout').")", __FILE__, __LINE__);
if (SQL_AFFECTEDROWS() > 0) {
// Send out email to admin
SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_TURBO_SUBJECT, "admin_autopurge_turbo", SQL_AFFECTEDROWS(), "");
}
//
-function DOUBLER_GENERATE_TABLE($uid="0", $done='N', $ref='N', $sort="ASC")
-{
+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)
- {
+ 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;
- }
- else
- {
+ } else {
// Guest mode!
$MODE = "guest"; $COLS = "3"; $DT_MODE = "3";
$NOT_FOUND = DOUBLER_GUEST_NO_ENTRIES_FOUND;
}
- if (($done == "Y") && ($sort == "ASC"))
- {
+ if (($done == "Y") && ($sort == "ASC")) {
// Already payed out points (latest payouts first)
- $limit = $_CONFIG['doubler_display_old'];
- }
- elseif ($sort == "ASC")
- {
+ $limit = getConfig('doubler_display_old');
+ } elseif ($sort == "ASC") {
// List entries which will receive their payout soon
- $limit = $_CONFIG['doubler_display_pay'];
- }
- elseif ($sort == "DESC")
- {
+ $limit = getConfig('doubler_display_pay');
+ } elseif ($sort == "DESC") {
// Newest entries
- $limit = $_CONFIG['doubler_display_new'];
+ $limit = getConfig('doubler_display_new');
}
// List entries
ORDER BY timemark ".$sort."
LIMIT ".$limit, __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0)
- {
+ if (SQL_NUMROWS($result) > 0) {
// List entries
$OUT = ""; $SW = 2;
- while(list($uid, $rid, $points, $time) = SQL_FETCHROW($result))
- {
- if (IS_ADMIN())
- {
+ while(list($uid, $rid, $points, $time) = SQL_FETCHROW($result)) {
+ if (IS_ADMIN()) {
// Set links to admin area
if ($uid > 0) { $uid = ADMIN_USER_PROFILE_LINK($uid); } else { $uid = "---"; }
if ($rid > 0) { $rid = ADMIN_USER_PROFILE_LINK($rid); } else { $rid = "---"; }
// Free memory
SQL_FREERESULT($result);
- }
- else
- {
+ } else {
// List no entries
$OUT = "<TR>
<TD colspan=\"".$COLS."\" align=\"center\" class=\"doubler_big_row bottom2\">
// Return template
return LOAD_TEMPLATE($MODE."_doubler_list", true, $OUT);
}
+
//
-function DOUBLER_GET_TOTAL_POINTS_LEFT()
-{
- global $_CONFIG;
+function DOUBLER_GET_TOTAL_POINTS_LEFT() {
// Initialize variables
$points = 0;
- if ($_CONFIG['doubler_own'] == "Y")
- {
+ if (getConfig('doubler_own') == "Y") {
// Take points from doubler's own account
- $points += $_CONFIG['doubler_points'] - $_CONFIG['doubler_used'];
+ $points += getConfig('doubler_points') - getConfig('doubler_used');
}
- if ($_CONFIG['doubler_jackpot'] == "Y")
- {
+ if (getConfig('doubler_jackpot') == "Y") {
// Load jackpot
$result = SQL_QUERY("SELECT points FROM "._MYSQL_PREFIX."_jackpot WHERE ok='ok' LIMIT 1", __FILE__, __LINE__);
list($jackpot) = SQL_FETCHROW($result);
if (!empty($jackpot)) $points += $jackpot;
}
- if ($_CONFIG['doubler_uid'] > 0)
- {
+ if (getConfig('doubler_uid') > 0) {
// Get user's points
- $user = GET_TOTAL_DATA($_CONFIG['doubler_uid'], "user_points", "points");
+ $user = GET_TOTAL_DATA(getConfig('doubler_uid'), "user_points", "points");
$points += $user;
}
global $_CONFIG;
// Get new instance
- $api = new PrimeraApi($_CONFIG['primera_api_name'], $_CONFIG['primera_api_md5']);
+ $api = new PrimeraApi(getConfig('primera_api_name'), getConfig('primera_api_md5'));
// Prepare purpose
$eval = "\$purpose = \"".COMPILE_CODE(sprintf(PRIMERA_API_PURPOSE_PAYOUT, $GLOBALS['userid']))."\";";
LEFT JOIN `"._MYSQL_PREFIX."_user_data` AS d
ON p.userid=d.userid
WHERE d.status='CONFIRMED' AND d.max_mails > 0 AND d.mails_confirmed >= %s AND p.ref_depth=1 AND p.points > 0 AND d.userid=%s",
- array($_CONFIG['ref_payout'], bigintval($uid)), __FILE__, __LINE__);
+ array(getConfig('ref_payout'), bigintval($uid)), __FILE__, __LINE__);
list($cpoints) = SQL_FETCHROW($result_ref);
SQL_FREERESULT($result_ref);
LEFT JOIN `"._MYSQL_PREFIX."_user_data` AS d
ON p.userid=d.userid
WHERE d.userid=%s AND d.status='CONFIRMED' AND p.ref_depth=1 AND d.max_mails > 0 AND d.mails_confirmed >= %s
-LIMIT 1", array(bigintval($uid), $_CONFIG['ref_payout']), __FILE__, __LINE__);
+LIMIT 1", array(bigintval($uid), getConfig('ref_payout')), __FILE__, __LINE__);
list($refpoints) = SQL_FETCHROW($result_ref);
SQL_FREERESULT($result_ref);
global $_CONFIG;
// Fix zero points to 0.00000
- if ($_CONFIG['ref_payout'] == "0") $_CONFIG['ref_payout'] = "0.00000";
+ if (getConfig('ref_payout') == "0") getConfig('ref_payout') = "0.00000";
// Init multi array
$users = array(
LEFT JOIN `"._MYSQL_PREFIX."_user_data` AS d
ON p.userid=d.userid
WHERE d.status='CONFIRMED' AND d.max_mails > 0 AND d.mails_confirmed >= %s AND p.ref_depth=1 AND p.points > 0 AND d.userid=%s",
- array($_CONFIG['ref_payout'], bigintval($uid)), __FILE__, __LINE__);
+ array(getConfig('ref_payout'), bigintval($uid)), __FILE__, __LINE__);
list($refpoints) = SQL_FETCHROW($result_ref);
SQL_FREERESULT($result_ref);
global $DATA, $_CONFIG;
// Check for expired rallyes
- $EXPIRE = $_CONFIG['one_day'] * 3; // @TODO The hard-coded value...
+ $EXPIRE = getConfig('one_day') * 3; // @TODO The hard-coded value...
$result_rallye = SQL_QUERY_ESC("SELECT id, title, start_time, end_time
FROM "._MYSQL_PREFIX."_rallye_data
WHERE end_time <= (UNIX_TIMESTAMP() - %s) AND expired='Y'",
if ($cnt > 0) {
// Count cache hits
- if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
// Remove old refs
//* DEBUG: */ echo "+".$cnt."/".$old."+<br />";
'id' => $id,
);
- if (($_POST['cat'][$id] == "Y") || (($_CONFIG['register_default'] == "Y") && (empty($_POST['cat'][$id])))) {
+ if (($_POST['cat'][$id] == "Y") || ((getConfig('register_default') == "Y") && (empty($_POST['cat'][$id])))) {
$content['def_y'] = " checked=\"checked\"";
} else {
$content['def_n'] = " checked=\"checked\"";
// "Getter" for anonymous remote IP number
function GET_ANONYMOUS_REMOTE_ADDR ($remoteAddr) {
- global $_CONFIG;
-
// Is config enabled?
- if ($_CONFIG['removeip_anon_ip'] == "Y") {
+ if (getConfig('removeip_anon_ip') == "Y") {
// Switch way do we like?
- switch ($_CONFIG['anonymous_ip']) {
+ switch (getConfig('anonymous_ip')) {
case "127.0.0.1": // mod_removeip style
case "0.0.0.0": // Some people may prefer this...
- $remoteAddr = $_CONFIG['anonymous_ip'];
+ $remoteAddr = getConfig('anonymous_ip');
break;
case "RANDOM": // Pseudo-random IP number
}
// "Getter" for anonymous remote hostname
function GET_ANONYMOUS_REMOTE_HOST ($remoteHost) {
- global $_CONFIG;
-
// Is config enabled?
- if ($_CONFIG['removeip_anon_host'] == "Y") {
+ if (getConfig('removeip_anon_host') == "Y") {
// Set anon hostname
$remoteHost = "localhost.localnet";
} // END - if
}
// "Getter" for anonymous user agent
function GET_ANONYMOUS_USER_AGENT ($userAgent) {
- global $_CONFIG;
-
// Is config enabled?
- if ($_CONFIG['removeip_anon_ua'] == "Y") {
+ if (getConfig('removeip_anon_ua') == "Y") {
// Set anon user agent
$userAgent = "-";
} // END - if
}
// "Getter" for anonymous referer
function GET_ANONYMOUS_REFERER ($referer) {
- global $_CONFIG;
-
// Is config enabled?
- if ($_CONFIG['removeip_anon_ref'] == "Y") {
+ if (getConfig('removeip_anon_ref') == "Y") {
// Set anon user agent
$referer = "-";
} // END - if
}
// Adds informations about anonymity/privacy to the menu
function REMOVEIP_ADD_INFOS () {
- global $_CONFIG;
-
// "Base-privacy" is by default low (we add more later)
$anonymity = 0;
// Is some data anonymized?
- if ($_CONFIG['removeip_anon_ip'] == "Y") $anonymity++;
- if ($_CONFIG['removeip_anon_host'] == "Y") $anonymity++;
- if ($_CONFIG['removeip_anon_ua'] == "Y") $anonymity++;
- if ($_CONFIG['removeip_anon_ref'] == "Y") $anonymity++;
+ if (getConfig('removeip_anon_ip') == "Y") $anonymity++;
+ if (getConfig('removeip_anon_host') == "Y") $anonymity++;
+ if (getConfig('removeip_anon_ua') == "Y") $anonymity++;
+ if (getConfig('removeip_anon_ref') == "Y") $anonymity++;
// Calculate anonymity level
$level = round($anonymity / 4 * 3);
}
//
-function REWRITE_LINKS($HTML)
-{
+function REWRITE_LINKS ($HTML) {
global $_CONFIG;
// Skip rewriting for the admin area (which search engine may enter here???)
- if (ereg($GLOBALS['module'], $_CONFIG['rewrite_skip'])) return $HTML;
+ if (ereg($GLOBALS['module'], getConfig('rewrite_skip'))) return $HTML;
// Strip slashes with double-backslashes for the preg_replace() function
$URL = str_replace("/", "\\/", URL);
// Convert modules.php?module=...
$test = preg_replace("/".$URL."\\/modules.php\\?module=/i", $target, $HTML);
- if (eregi(SERVER_URL, $test))
- {
+ if (eregi(SERVER_URL, $test)) {
// Konvert URLs from my server
$URL = str_replace("/", "\\/", SERVER_URL);
$test = preg_replace("/".$URL."\\/modules.php\\?module=/i", SERVER_URL."/cms/", $test);
- }
+ } // END - if
// Strip slashes as above for the main URL
$target2 = str_replace("/", "\\/", $target);
$target2 = str_replace("/", "\\/", $target);
$test = preg_replace("/".$target2."(.*)&what=/i", $wht, $test);
- if ((EXT_IS_ACTIVE("rallye")) && (eregi("rallye=", $test)))
- {
+ if ((EXT_IS_ACTIVE("rallye")) && (eregi("rallye=", $test))) {
// Replace data when rallye extension is active
// Add more if you need more like these entries
$REPLACE = array("rallye", "activate", "auto", "notify", "sub");
- foreach ($REPLACE as $var)
- {
+ foreach ($REPLACE as $var) {
// This will replace "&var=" to "/var/"
$test = preg_replace("/&".$var."=/i", "/".$var."/", $test);
- }
- }
+ } // END - foreach
+ } // END - if
// Simple from->to replacements
$REPLACE = array(
'replace' => array("u" , "url", "page", "offset", "m" , "b" , "s" , "h")
);
- if ((EXT_IS_ACTIVE("admins")) && (eregi("admin=", $test)))
- {
+ if ((EXT_IS_ACTIVE("admins")) && (eregi("admin=", $test))) {
// Replace &admin= with "/aid/"
$REPLACE['search'][] = "admin";
$REPLACE['replace'][] = "aid";
- }
+ } // END - if
// Replace all array elements through
- foreach ($REPLACE['search'] as $k => $v)
- {
- if (eregi("$v=", $test))
- {
+ foreach ($REPLACE['search'] as $k => $v) {
+ if (eregi("$v=", $test)) {
// Replace &u_id= with /u/
$test = preg_replace("/&".$v."=/i", "/".$REPLACE['replace'][$k]."/", $test);
- }
- }
+ } // END - if
+ } // END - foreach
// Repair missed &what=??? entries
- while (preg_match("/&what=(.*)\/(.*)\/(.*)/i", $test))
- {
+ while (preg_match("/&what=(.*)\/(.*)\/(.*)/i", $test)) {
$test = preg_replace("/&what=(.*)\/(.*)\/(.*)/i", "/wht/\$1/\$2/\$3", $test);
- }
+ } // END - while
// Return rewritten code
return $test;
// Calculate cookie lifetime, maybe we have to change this so the admin can setup a
// seperate timeout for these two cookies?
- $life = (time() + $_CONFIG['online_timeout']);
+ $life = (time() + getConfig('online_timeout'));
// Is confirmed so both is fine and we can continue with login procedure
$login = ((setcookie("sponsorid" , bigintval($_COOKIE['sponsorid']), $life, COOKIE_PATH)) &&
$URLs[$formData['id']]['new_status'] = $SURFBAR_CACHE['new_status'];
// Extract URL data for call-back
- $urlData = array(array_merge($URLs[$formData['id']], array($action => $formData)));
+ $urlData = array(merge_array($URLs[$formData['id']], array($action => $formData)));
// Action found so execute it
$performed = call_user_func_array($functionName, $urlData);
global $_CONFIG;
// Get all userids
- $UIDs = SURFBAR_DETERMINE_DEPLETED_USERIDS($_CONFIG['surfbar_warn_low_points']);
+ $UIDs = SURFBAR_DETERMINE_DEPLETED_USERIDS(getConfig('surfbar_warn_low_points'));
// "Walk" through all URLs
foreach ($UIDs['uid'] as $uid => $dummy) {
// Is the last notification far enougth away to notify again?
- if ((time() - $UIDs['notified'][$uid]) >= $_CONFIG['surfbar_low_interval']) {
+ if ((time() - $UIDs['notified'][$uid]) >= getConfig('surfbar_low_interval')) {
// Prepare content
$content = array(
'uid' => $uid,
- 'low' => TRANSLATE_COMMA($_CONFIG['surfbar_warn_low_points']),
+ 'low' => TRANSLATE_COMMA(getConfig('surfbar_warn_low_points')),
'points' => TRANSLATE_COMMA($UIDs['points'][$uid]),
'notified' => MAKE_DATETIME($UIDs['notified'][$uid]),
- 'interval' => CREATE_FANCY_TIME($_CONFIG['surfbar_low_interval'])
+ 'interval' => CREATE_FANCY_TIME(getConfig('surfbar_low_interval'))
);
// Notify this user
if ($addMode == "reg") $status = "PENDING";
// Prepare content
- $content = array_merge($extraFields, array(
+ $content = merge_array($extraFields, array(
'url' => $url,
'frametester' => FRAMETESTER($url),
'uid' => $uid,
$content['limit'] = SURFBAR_TRANSLATE_LIMIT($content['limit']);
// If in reg-mode we notify admin
- if (($addMode == "reg") || ($_CONFIG['surfbar_notify_admin_unlock'] == "Y")) {
+ if (($addMode == "reg") || (getConfig('surfbar_notify_admin_unlock') == "Y")) {
// Notify admin even when he as unlocked an email
SURFBAR_NOTIFY_ADMIN("url_{$addMode}", $content);
} // END - if
global $_CONFIG;
// Static values are default
- $reward = $_CONFIG['surfbar_static_reward'];
+ $reward = getConfig('surfbar_static_reward');
// Do we have static or dynamic?
- if ($_CONFIG['surfbar_pay_model'] == "DYNAMIC") {
+ if (getConfig('surfbar_pay_model') == "DYNAMIC") {
// "Calculate" dynamic reward
if ($onlyMin) {
$reward += SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE();
global $_CONFIG;
// Static costs is default
- $costs = $_CONFIG['surfbar_static_costs'];
+ $costs = getConfig('surfbar_static_costs');
// Do we have static or dynamic?
- if ($_CONFIG['surfbar_pay_model'] == "DYNAMIC") {
+ if (getConfig('surfbar_pay_model') == "DYNAMIC") {
// "Calculate" dynamic costs
if ($onlyMin) {
$costs += SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE();
$isFull = true;
// Cache static reload lock
- $SURFBAR_CACHE['surf_lock'] = $_CONFIG['surfbar_static_lock'];
- //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "Fixed surf lock is ".$_CONFIG['surfbar_static_lock']."", false);
+ $SURFBAR_CACHE['surf_lock'] = getConfig('surfbar_static_lock');
+ //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "Fixed surf lock is ".getConfig('surfbar_static_lock')."", false);
// Do we have dynamic model?
- if ($_CONFIG['surfbar_pay_model'] == "DYNAMIC") {
+ if (getConfig('surfbar_pay_model') == "DYNAMIC") {
// "Calculate" dynamic lock
$SURFBAR_CACHE['surf_lock'] += SURFBAR_CALCULATE_DYNAMIC_ADD();
} // END - if
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")) < $_CONFIG['surfbar_max_order']));
+ 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="") {
$uid = $GLOBALS['userid'];
} elseif ($uid == 0) {
// Error!
- return ($_CONFIG['surfbar_max_order'] + 1);
+ return (getConfig('surfbar_max_order') + 1);
}
// Default is all URLs
FROM "._MYSQL_PREFIX."_surfbar_urls
WHERE userid=%s".$ADD."
LIMIT %s",
- array($uid, $_CONFIG['surfbar_max_order']), __FILE__, __LINE__
+ array($uid, getConfig('surfbar_max_order')), __FILE__, __LINE__
);
// Fetch row
$SURFBAR_CACHE['salt'] = "INVALID";
// Get code length from config
- $length = $_CONFIG['code_length'];
+ $length = getConfig('code_length');
// Fix length to 10
if ($length == 0) $length = 10;
// 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) {
- SUB_POINTS(sprintf("surfbar_%s", $_CONFIG['surfbar_pay_model']), SURFBAR_GET_USERID(), SURFBAR_GET_COSTS());
+ SUB_POINTS(sprintf("surfbar_%s", getConfig('surfbar_pay_model')), SURFBAR_GET_USERID(), SURFBAR_GET_COSTS());
} // END - if
// Book it to the user
//* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "uid=".$GLOBALS['userid'].",reward=".SURFBAR_GET_REWARD()."", false);
- ADD_POINTS_REFSYSTEM(sprintf("surfbar_%s", $_CONFIG['surfbar_pay_model']), $GLOBALS['userid'], SURFBAR_GET_DATA('reward'));
+ ADD_POINTS_REFSYSTEM(sprintf("surfbar_%s", getConfig('surfbar_pay_model')), $GLOBALS['userid'], SURFBAR_GET_DATA('reward'));
}
// Updates the statistics of current URL/userid
function SURFBAR_UPDATE_INSERT_STATS_RECORD () {
FROM "._MYSQL_PREFIX."_surfbar_stats
WHERE (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(last_online)) <= %s
GROUP BY userid",
- array($_CONFIG['online_timeout']), __FILE__, __LINE__);
+ array(getConfig('online_timeout')), __FILE__, __LINE__);
// Fetch count
$cnt = SQL_NUMROWS($result);
}
// Determine waiting time for one URL
function SURFBAR_DETERMINE_WAIT_TIME () {
- global $_CONFIG;
-
// Get fixed reload lock
$fixed = SURFBAR_GET_FIXED_RELOAD();
} // END - if
// Static time is default
- $time = $_CONFIG['surfbar_static_time'];
+ $time = getConfig('surfbar_static_time');
// Which payment model do we have?
- if ($_CONFIG['surfbar_pay_model'] == "DYNAMIC") {
+ if (getConfig('surfbar_pay_model') == "DYNAMIC") {
// "Calculate" dynamic time
$time += SURFBAR_CALCULATE_DYNAMIC_ADD();
} // END - if
// Prepare content for notification routines
$data[$urlId]['uid'] = $data[$urlId]['userid'];
$data[$urlId]['frametester'] = FRAMETESTER($data[$urlId]['url']);
- $data[$urlId]['reward'] = TRANSLATE_COMMA($_CONFIG['surfbar_static_reward']);
- $data[$urlId]['costs'] = TRANSLATE_COMMA($_CONFIG['surfbar_static_costs']);
+ $data[$urlId]['reward'] = TRANSLATE_COMMA(getConfig('surfbar_static_reward'));
+ $data[$urlId]['costs'] = TRANSLATE_COMMA(getConfig('surfbar_static_costs'));
- // Do some dirt fixing here:
+ // Do some dirty fixing here:
if (($data[$urlId]['status'] == "STOPPED") && ($newStatus == "pending")) {
// Fix for template change
$newStatus = "continued";
$addon = 0;
// Percentage part
- $percent = abs(log($_CONFIG['surfbar_dynamic_percent'] / 100 + 1));
+ $percent = abs(log(getConfig('surfbar_dynamic_percent') / 100 + 1));
// Get total users
$totalUsers = GET_TOTAL_DATA("CONFIRMED", "user_data", "userid", "status", true);
$max = log(2);
// Percentage part
- $percent = abs(log($_CONFIG['surfbar_dynamic_percent'] / 100 + 1));
+ $percent = abs(log(getConfig('surfbar_dynamic_percent') / 100 + 1));
// Get total users
$totalUsers = GET_TOTAL_DATA("CONFIRMED", "user_data", "userid", "status", true);
GROUP BY sbu.id", __FILE__, __LINE__);
// Log last query
- //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "lastQuery=".$_CONFIG['db_last_query']."|numRows=".SQL_NUMROWS($result)."|Affected=".SQL_AFFECTEDROWS()."", false);
+ //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "lastQuery=".getConfig('db_last_query')."|numRows=".SQL_NUMROWS($result)."|Affected=".SQL_AFFECTEDROWS()."", false);
// Fetch max rand
$maxRand = SQL_NUMROWS($result);
}
// Reload to configured stop page
function SURFBAR_RELOAD_TO_STOP_PAGE($page="stop") {
- global $_CONFIG;
-
// Internal or external?
- if (($_CONFIG['surfbar_pause_mode'] == "INTERNAL") || (empty($_CONFIG['surfbar_pause_url']))) {
+ if ((getConfig('surfbar_pause_mode') == "INTERNAL") || (getConfig('surfbar_pause_url') == "")) {
// Reload to internal page
LOAD_URL("surfbar.php?frame=".$page);
} else {
// Reload to external page
- LOAD_URL($_CONFIG['surfbar_pause_url']);
+ LOAD_URL(getConfig('surfbar_pause_url'));
}
}
}
// Is there an id number?
- //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "lastQuery=".$_CONFIG['db_last_query']."|numRows=".SQL_NUMROWS($result)."|Affected=".SQL_AFFECTEDROWS()."", false);
+ //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "lastQuery=".getConfig('db_last_query')."|numRows=".SQL_NUMROWS($result)."|Affected=".SQL_AFFECTEDROWS()."", false);
if (SQL_NUMROWS($result) == 1) {
// Load/cache data
//* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "count(".count($SURFBAR_CACHE).") - BEFORE", false);
//* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "BASE/STATIC - reward=".SURFBAR_GET_REWARD()."|costs=".SURFBAR_GET_COSTS()."", false);
// Only in dynamic model add the dynamic bonus!
- if ($_CONFIG['surfbar_pay_model'] == "DYNAMIC") {
+ if (getConfig('surfbar_pay_model') == "DYNAMIC") {
// Calculate dynamic reward/costs and add it
$SURFBAR_CACHE['reward'] += SURFBAR_CALCULATE_DYNAMIC_ADD();
$SURFBAR_CACHE['costs'] += SURFBAR_CALCULATE_DYNAMIC_ADD();
if (EXT_IS_ACTIVE("autopurge")) {
// Start finding them...
- $since = $_CONFIG['ap_inactive_since'];
+ $since = getConfig('ap_inactive_since');
$EXCLUDE_LIST = "";
- if ($_CONFIG['def_refid'] > 0) {
- $EXCLUDE_LIST = " AND d.userid != ".$_CONFIG['def_refid']."";
+ if (getConfig('def_refid') > 0) {
+ $EXCLUDE_LIST = " AND d.userid != ".getConfig('def_refid')."";
} // END - if
// Check for more extensions
- if (EXT_IS_ACTIVE("beg")) $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['beg_uid']."";
- if (EXT_IS_ACTIVE("bonus")) $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['bonus_uid']."";
- if (EXT_IS_ACTIVE("doubler")) $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['doubler_uid']."";
+ if (EXT_IS_ACTIVE("beg")) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('beg_uid')."";
+ if (EXT_IS_ACTIVE("bonus")) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('bonus_uid')."";
+ if (EXT_IS_ACTIVE("doubler")) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('doubler_uid')."";
if (GET_EXT_VERSION("holiday") >= "0.1.3") $EXCLUDE_LIST .= " AND d.holiday_active='N'";
// Check for all accounts
if (GET_EXT_VERSION("bonus") >= "0.6.9") {
// Add more bonus points here
$USE = "(0";
- if ($_CONFIG['bonus_click_yn'] == "Y") $USE .= " + turbo_bonus";
- if ($_CONFIG['bonus_login_yn'] == "Y") $USE .= " + login_bonus";
- if ($_CONFIG['bonus_order_yn'] == "Y") $USE .= " + bonus_order";
- if ($_CONFIG['bonus_stats_yn'] == "Y") $USE .= " + bonus_stats";
- if ($_CONFIG['bonus_ref_yn'] == "Y") $USE .= " + bonus_ref";
+ if (getConfig('bonus_click_yn') == "Y") $USE .= " + turbo_bonus";
+ if (getConfig('bonus_login_yn') == "Y") $USE .= " + login_bonus";
+ if (getConfig('bonus_order_yn') == "Y") $USE .= " + bonus_order";
+ if (getConfig('bonus_stats_yn') == "Y") $USE .= " + bonus_stats";
+ if (getConfig('bonus_ref_yn') == "Y") $USE .= " + bonus_ref";
$USE .= ")";
} else {
// Old version ???
// Autopurge installed?
$LAST = "";
- if ((EXT_IS_ACTIVE("autopurge")) && ($_CONFIG['autopurge_inactive'] == "Y") && ($_CONFIG['ap_inactive_since'] > 0)) {
+ if ((EXT_IS_ACTIVE("autopurge")) && (getConfig('autopurge_inactive') == "Y") && (getConfig('ap_inactive_since') > 0)) {
// Use last online timestamp to keep inactive members away from here
- $LAST = sprintf(" AND last_online >= (UNIX_TIMESTAMP() - %s)", $_CONFIG['ap_inactive_since']);
+ $LAST = sprintf(" AND last_online >= (UNIX_TIMESTAMP() - %s)", getConfig('ap_inactive_since'));
}
$SQLs[] = "SELECT ".$USE." AS points
// Autopurge installed?
$LAST = "";
- if ((EXT_IS_ACTIVE("autopurge")) && ($_CONFIG['autopurge_inactive'] == "Y") && ($_CONFIG['ap_inactive_since'] > 0)) {
+ if ((EXT_IS_ACTIVE("autopurge")) && (getConfig('autopurge_inactive') == "Y") && (getConfig('ap_inactive_since') > 0)) {
// Use last online timestamp to keep inactive members away from here
- $LAST = sprintf(" AND last_online >= (UNIX_TIMESTAMP() - %s)", $_CONFIG['ap_inactive_since']);
+ $LAST = sprintf(" AND last_online >= (UNIX_TIMESTAMP() - %s)", getConfig('ap_inactive_since'));
}
$SQLs[] = "SELECT userid FROM "._MYSQL_PREFIX."_user_data
$ret = "default";
// Load default theme if not empty from configuration
- if (!empty($_CONFIG['default_theme'])) $ret = $_CONFIG['default_theme'];
+ if (getConfig('default_theme') != "") $ret = getConfig('default_theme');
if (!isSessionVariableSet('mxchange_theme')) {
// Set default theme
// Installation mode active
if ((!empty($_GET['theme'])) && (FILE_READABLE($theme))) {
// Set cookie from URL data
- set_session("mxchange_theme", $_GET['theme']);
+ set_session("mxchange_theme", SQL_ESCAPE($_GET['theme']));
} elseif (FILE_READABLE(sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($_POST['theme'])))) {
// Set cookie from posted data
- set_session("mxchange_theme", $_POST['theme']);
+ set_session("mxchange_theme", SQL_ESCAPE($_POST['theme']));
}
// Set return value
$cver = $cacheArray['themes']['theme_ver'][$name];
// Count up
- if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
} 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",
$id = $cacheArray['themes']['id'][$name];
// Count up
- if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
} 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",
$active = ($cacheArray['themes']['theme_active'][$name] == "Y");
// Count up
- if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
} 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",
$name = $cacheArray['themes']['theme_name'][$name];
// Count up
- if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
} 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",
$OUT .= "&letter=".$ltr."&sortby=".$sortby.$ADD."\">".$ltr."</A>";
}
- if ((($counter / $_CONFIG['user_alpha']) == round($counter / $_CONFIG['user_alpha'])) && ($counter > 0)) {
+ if ((($counter / getConfig('user_alpha')) == round($counter / getConfig('user_alpha'))) && ($counter > 0)) {
$OUT .= " ]<br />[ ";
} elseif ( $counter != $num ) {
$OUT .= " | ";
// Is the extension version fine?
if (GET_EXT_VERSION("user") >= "0.3.4") {
// Get all user ids
- $totalUsers = GET_TOTAL_DATA("CONFIRMED", "user_data", "userid", "status", true, " AND `rand_confirmed` >= ".$_CONFIG['user_min_confirmed']."");
+ $totalUsers = GET_TOTAL_DATA("CONFIRMED", "user_data", "userid", "status", true, " AND `rand_confirmed` >= ".getConfig('user_min_confirmed')."");
// Do we have at least one?
if ($totalUsers > 0) {
// Look for random user
$result = SQL_QUERY_ESC("SELECT `userid` FROM `"._MYSQL_PREFIX."_user_data` WHERE `status`='CONFIRMED' AND `rand_confirmed` >= %s ORDER BY `rand_confirmed` DESC LIMIT %s, 1",
- array($_CONFIG['user_min_confirmed'], $randNum), __FILE__, __LINE__);
+ array(getConfig('user_min_confirmed'), $randNum), __FILE__, __LINE__);
// Do we have one entry there?
if (SQL_NUMROWS($result) == 1) {
// Sends out a request to the API and returns it's result
function WERNIS_SEND_REQUEST ($scriptName, $requestData = array()) {
- global $_CONFIG;
-
// Is the requestData an array?
if (!is_array($requestData)) {
// Then abort here!
} // END - if
// Is the API id and MD5 hash there?
- if ((empty($_CONFIG['wernis_api_id'])) || (empty($_CONFIG['wernis_api_md5']))) {
+ if ((getConfig('wernis_api_id') == "") || (getConfig('wernis_api_md5') == "")) {
// Abort here...
return array(
'status' => "failed_general",
} // END - if
// Add more request data
- $requestData['api_id'] = bigintval($_CONFIG['wernis_api_id']);
- $requestData['api_key'] = $_CONFIG['wernis_api_md5'];
+ $requestData['api_id'] = bigintval(getConfig('wernis_api_id'));
+ $requestData['api_key'] = getConfig('wernis_api_md5');
// Construct the request string
- $requestString = $_CONFIG['wernis_api_url'] . $scriptName;
+ $requestString = getConfig('wernis_api_url') . $scriptName;
// Get the raw response from the lower function
$response = POST_URL($requestString, $requestData);
// Tests the function by calling balance.php on the API
function WERNIS_TEST_API () {
- // Get config first
- global $_CONFIG;
+ // Result is always failed
$result = false;
// Return the result from the lower functions
// Widthdraw this amount
function WERNIS_EXECUTE_WITHDRAW ($wdsId, $userMd5, $amount) {
- global $_CONFIG;
-
// Is the sponsor extension installed?
- if ($_CONFIG['wernis_withdraw_active'] == "N") {
+ if (getConfig('wernis_withdraw_active') == "N") {
if (!EXT_IS_ACTIVE("sponsor")) {
// No, abort here
return false;
'sub_request' => "receive",
't_uid' => bigintval($wdsId),
't_md5' => $userMd5,
- 'r_uid' => $_CONFIG['wernis_refid'],
+ 'r_uid' => getConfig('wernis_refid'),
'amount' => bigintval($amount),
'purpose' => urlencode(base64_encode($purpose))
);
// Prepare the request data
$requestData = array(
'sub_request' => "send",
- 't_uid' => $_CONFIG['wernis_refid'],
+ 't_uid' => getConfig('wernis_refid'),
't_md5' => $_CONFIG['wernis_pass_md5'],
'r_uid' => bigintval($wdsId),
'amount' => bigintval($amount),
// Take fees and factor
function WERNIS_TAKE_FEE ($points, $mode) {
- global $_CONFIG;
-
// Payout or withdraw are allowed modes!
//* DEBUG: */ echo "mode={$mode},points={$points}<br />\n";
if (!in_array($mode, array('payout', 'withdraw'))) {
} // END - if
// Is there a percentage or fixed fee?
- if ($_CONFIG['wernis_'.$mode.'_fee_percent'] > 0) {
+ if (getConfig('wernis_'.$mode.'_fee_percent') > 0) {
// Percentage fee
- $points -= $points * $_CONFIG['wernis_'.$mode.'_fee_percent'] / 100;
- } elseif ($_CONFIG['wernis_'.$mode.'_fee_fix'] > 0) {
+ $points -= $points * getConfig('wernis_'.$mode.'_fee_percent') / 100;
+ } elseif (getConfig('wernis_'.$mode.'_fee_fix') > 0) {
// Fixed fee
- $points -= $_CONFIG['wernis_'.$mode.'_fee_fix'];
+ $points -= getConfig('wernis_'.$mode.'_fee_fix');
}
// Divide/multiply the factor
if ($mode == "payout") {
// Divide for payout
- $points = $points / $_CONFIG['wernis_payout_factor'];
+ $points = $points / getConfig('wernis_payout_factor');
} else {
// Multiply for withdraw
- $points = $points * $_CONFIG['wernis_withdraw_factor'];
+ $points = $points * getConfig('wernis_withdraw_factor');
}
// Return value
// Add withdraw fees and factor
function WERNIS_ADD_WITHDRAW_FEE ($points) {
- global $_CONFIG;
-
// Is there a percentage or fixed fee?
- if ($_CONFIG['wernis_withdraw_fee_percent'] > 0) {
+ if (getConfig('wernis_withdraw_fee_percent') > 0) {
// Percentage fee
- $points += $points * $_CONFIG['wernis_withdraw_fee_percent'] / 100;
- } elseif ($_CONFIG['wernis_withdraw_fee_fix'] > 0) {
+ $points += $points * getConfig('wernis_withdraw_fee_percent') / 100;
+ } elseif (getConfig('wernis_withdraw_fee_fix') > 0) {
// Fixed fee
- $points += $_CONFIG['wernis_withdraw_fee_fix'];
+ $points += getConfig('wernis_withdraw_fee_fix');
}
// Return value
// Add all fees to the array
function WERNIS_ADD_FEES_TO_ARRAY (&$array) {
- global $_CONFIG;
-
// Is the array an array? ;-)
if (!is_array($array)) {
// Log error and return
} // END - if
// Add both factors
- $array['payout_factor'] = TRANSLATE_COMMA($_CONFIG['wernis_payout_factor']);
- $array['withdraw_factor'] = TRANSLATE_COMMA($_CONFIG['wernis_withdraw_factor']);
+ $array['payout_factor'] = TRANSLATE_COMMA(getConfig('wernis_payout_factor'));
+ $array['withdraw_factor'] = TRANSLATE_COMMA(getConfig('wernis_withdraw_factor'));
// Add all fees
- $array['payout_fee_percent'] = TRANSLATE_COMMA($_CONFIG['wernis_payout_fee_percent']);
- $array['withdraw_fee_percent'] = TRANSLATE_COMMA($_CONFIG['wernis_withdraw_fee_percent']);
- $array['payout_fee_fix'] = TRANSLATE_COMMA($_CONFIG['wernis_payout_fee_fix']);
- $array['withdraw_fee_fix'] = TRANSLATE_COMMA($_CONFIG['wernis_withdraw_fee_fix']);
+ $array['payout_fee_percent'] = TRANSLATE_COMMA(getConfig('wernis_payout_fee_percent'));
+ $array['withdraw_fee_percent'] = TRANSLATE_COMMA(getConfig('wernis_withdraw_fee_percent'));
+ $array['payout_fee_fix'] = TRANSLATE_COMMA(getConfig('wernis_payout_fee_fix'));
+ $array['withdraw_fee_fix'] = TRANSLATE_COMMA(getConfig('wernis_withdraw_fee_fix'));
}
//
} // END - if
// Transfer config data
- $_CONFIG = array_merge($_CONFIG, $data);
+ $_CONFIG = merge_array($_CONFIG, $data);
// Temporary allow maximum
- $_CONFIG['yoomedia_tm_max_reload'] = 1000;
- $_CONFIG['yoomedia_tm_min_wait'] = 0;
- $_CONFIG['yoomedia_tm_clicks_remain'] = 10;
- $_CONFIG['yoomedia_tm_min_pay'] = 0;
- $_CONFIG['yoomedia_erotic_allowed'] = 1;
+ getConfig('yoomedia_tm_max_reload') = 1000;
+ getConfig('yoomedia_tm_min_wait') = 0;
+ getConfig('yoomedia_tm_clicks_remain') = 10;
+ getConfig('yoomedia_tm_min_pay') = 0;
+ getConfig('yoomedia_erotic_allowed') = 1;
// Query the API with a test request without couting it
// If zero reply comes back the data is invalid!
// Log the response if failed
if (count($response) == 0) {
// Queries depleted (as we count here!)
- DEBUG_LOG(__FUNCTION__, __LINE__, " Requested depleted. Maxmimum was: ".$_CONFIG['yoomedia_requests_total']);
+ DEBUG_LOG(__FUNCTION__, __LINE__, " Requested depleted. Maxmimum was: ".getConfig('yoomedia_requests_total'));
} elseif (count($response) <= 10) {
// Log serialized raw response
DEBUG_LOG(__FUNCTION__, __LINE__, " Raw response=".base64_encode(serialize($response)));
// Queries the given Yoo!Media API 2.0 script
function YOOMEDIA_QUERY_API ($script, $countQuery = true) {
- global $_CONFIG;
-
// Init response array
$response = array();
// Enougth queries left?
- if (($_CONFIG['yoomedia_requests_remain'] > 0) || (!$countQuery)) {
+ if ((getConfig('yoomedia_requests_remain') > 0) || (!$countQuery)) {
// Prepare the low-level request
$requestString = sprintf("http://www.yoomedia.de/interface_2.0/%s?id=%s&sid=%s&pw=%s&reload=%s&ma=%s&uebrig=%s&verguetung=%s&erotik=%s",
$script,
- bigintval($_CONFIG['yoomedia_id']),
- bigintval($_CONFIG['yoomedia_sid']),
- $_CONFIG['yoomedia_passwd'],
- bigintval($_CONFIG['yoomedia_tm_max_reload']),
- bigintval($_CONFIG['yoomedia_tm_min_wait']),
- bigintval($_CONFIG['yoomedia_tm_clicks_remain']),
- bigintval($_CONFIG['yoomedia_tm_min_pay']),
- bigintval($_CONFIG['yoomedia_erotic_allowed'])
+ bigintval(getConfig('yoomedia_id')),
+ bigintval(getConfig('yoomedia_sid')),
+ getConfig('yoomedia_passwd'),
+ bigintval(getConfig('yoomedia_tm_max_reload')),
+ bigintval(getConfig('yoomedia_tm_min_wait')),
+ bigintval(getConfig('yoomedia_tm_clicks_remain')),
+ bigintval(getConfig('yoomedia_tm_min_pay')),
+ bigintval(getConfig('yoomedia_erotic_allowed'))
);
// Run the query
// Prepares a bonus mail for delivery. Works only if extension "bonus" is active
function YOOMEDIA_PREPARE_MAIL_DELIVERY ($data) {
- global $_CONFIG;
-
// Is this an admin?
if (!IS_ADMIN()) {
// Abort here
if ($data['reward'] < 1) $data['reward'] = 1;
// Add website id
- $data['sid'] = $_CONFIG['yoomedia_sid'];
+ $data['sid'] = getConfig('yoomedia_sid');
// Add total receivers
$data['all'] = TRANSLATE_COMMA(GET_TOTAL_RECEIVERS());
// Adds the mail to the bonus mail pool
function YOOMEDIA_SEND_BONUS_MAIL ($data, $mode) {
- global $_CONFIG;
-
// Is this an admin?
if (!IS_ADMIN()) {
// Abort here
}
// Do we need to init the cache?
- if (($cacheMode == "init") && ($_CONFIG['cache_exts'] == "Y")) {
+ if (($cacheMode == "init") && (getConfig('cache_exts') == "Y")) {
// Init cache file
$cacheInstance->init("EXTENSIONS");
$cacheInstance->storeExtensionVersion("sql_patches");
- } elseif ($_CONFIG['cache_exts'] == "N") {
+ } elseif (getConfig('cache_exts') == "N") {
// Cache will not be created for extensions
$cacheMode = "skip";
}
$cacheInstance->destroyCacheFile();
unset($cacheArray['admins']);
}
-} elseif (($_CONFIG['cache_admins'] == "Y") && ($CSS != "1") && ($CSS != "-1")) {
+} elseif ((getConfig('cache_admins') == "Y") && ($CSS != "1") && ($CSS != "-1")) {
// Create cache file
$cacheInstance->init("ADMINS");
$cacheInstance->storeExtensionVersion("admins");
// Load referal system from cache
global $cacheArray;
$cacheArray['admin_acls'] = $cacheInstance->getArrayFromCache();
- } elseif (($_CONFIG['cache_acls'] == "Y") && ($CSS != "1") && ($CSS != "-1")) {
+ } elseif ((getConfig('cache_acls') == "Y") && ($CSS != "1") && ($CSS != "-1")) {
// Create cache file here
$cacheInstance->init("ADMINS_ACLS");
$cacheInstance->storeExtensionVersion("admins");
$cacheArray['config'] = $cacheInstance->getArrayFromCache();
// TODO: Do we really need to cache the config???
-} elseif (($_CONFIG['cache_config'] == "Y") && ($CSS != "1") && ($CSS != "-1")) {
+} elseif ((getConfig('cache_config') == "Y") && ($CSS != "1") && ($CSS != "-1")) {
// Create cache file here
$cacheInstance->init("CONFIG");
$cacheInstance->storeExtensionVersion("sql_patches");
} // END - if
} // END - foreach
unset($modArray);
-} elseif (($_CONFIG['cache_modreg'] == "Y") && ($CSS != "1") && ($CSS != "-1")) {
+} elseif ((getConfig('cache_modreg') == "Y") && ($CSS != "1") && ($CSS != "-1")) {
// Create cache file here
$cacheInstance->init("MODULES");
$cacheInstance->storeExtensionVersion("sql_patches");
// Load referal system from cache
global $cacheArray;
$cacheArray['ref_depths'] = $cacheInstance->getArrayFromCache();
-} elseif (($_CONFIG['cache_refdepth'] == "Y") && ($CSS != "1") && ($CSS != "-1")) {
+} elseif ((getConfig('cache_refdepth') == "Y") && ($CSS != "1") && ($CSS != "-1")) {
// Create cache file here
$cacheInstance->init("REFDEPTHS");
$cacheInstance->storeExtensionVersion("sql_patches");
// Load referal system from cache
global $cacheArray;
$cacheArray['ref_system'] = $cacheInstance->getArrayFromCache();
-} elseif (($_CONFIG['cache_refsys'] == "Y") && ($CSS != "1") && ($CSS != "-1")) {
+} elseif ((getConfig('cache_refsys') == "Y") && ($CSS != "1") && ($CSS != "-1")) {
// Create cache file here
$cacheInstance->init("REFSYSTEM");
$cacheInstance->storeExtensionVersion("sql_patches");
// Remove dummy array
unset($cache);
-} elseif (($_CONFIG['cache_refsys'] == "Y") && ($CSS != "1") && ($CSS != "-1")) {
+} elseif ((getConfig('cache_themes') == "Y") && ($CSS != "1") && ($CSS != "-1")) {
// Create cache file here
$cacheInstance->init("THEMES");
$cacheInstance->storeExtensionVersion("theme");
if ($CSS == 1) return;
// Create timemark from saved month
-$mark = mktime(0, 0, 0, $_CONFIG['last_month'], date("d", time()), date('Y', time()));
+$mark = mktime(0, 0, 0, getConfig('last_month'), date("d", time()), date('Y', time()));
$SQL = ""; $MODE = "";
// Shall I sent activation or deactivation mail?
$SQL = "SELECT userid, email FROM `"._MYSQL_PREFIX."_user_data` WHERE (beg_ral_notify ";
-switch ($_CONFIG['beg_rallye'])
+switch (getConfig('beg_rallye'))
{
-case 'Y': // Begging rallye is activated
- if ($_CONFIG['beg_ral_en_notify'] == "Y")
+case "Y": // Begging rallye is activated
+ if (getConfig('beg_ral_en_notify') == "Y")
{
// Okay, let's check for member accounts
$SQL .= "= 0 OR (beg_ral_notify > 0 AND beg_ral_en_notify < beg_ral_di_notify)";
}
break;
-case 'N': // Begging rallye is deactivated
- if ($_CONFIG['beg_ral_di_notify'] == "Y")
+case "N": // Begging rallye is deactivated
+ if (getConfig('beg_ral_di_notify') == "Y")
{
// Okay, let's check for member accounts
$SQL .= " > 0 AND beg_ral_di_notify < beg_ral_en_notify";
$SQL .= ") AND status='CONFIRMED' ORDER BY last_online ASC";
// Prepare data for the template
- define('__BEG_MIN_POINTS' , TRANSLATE_COMMA($_CONFIG['beg_points']));
- define('__BEG_MAX_POINTS' , TRANSLATE_COMMA($_CONFIG['beg_points_max']));
- define('__BEG_MAX_WINNERS', round($_CONFIG['beg_ranks']));
- if ($_CONFIG['beg_ip_timeout'] == 0)
+ define('__BEG_MIN_POINTS' , TRANSLATE_COMMA(getConfig('beg_points')));
+ define('__BEG_MAX_POINTS' , TRANSLATE_COMMA(getConfig('beg_points_max')));
+ define('__BEG_MAX_WINNERS', round(getConfig('beg_ranks')));
+ if (getConfig('beg_ip_timeout') == 0)
{
// No IP locking setuped!
define('__BEG_IP_LOCKER', BEG_NO_LIMITATION);
else
{
// Create timemark
- define('__BEG_IP_LOCKER', CREATE_FANCY_TIME($_CONFIG['beg_ip_timeout']));
+ define('__BEG_IP_LOCKER', CREATE_FANCY_TIME(getConfig('beg_ip_timeout')));
}
// Check for accounts to be notified
$result_main = SQL_QUERY($SQL, __FILE__, __LINE__);
if (SQL_NUMROWS($result_main) > 0) {
// Normal notification mails or bonus mails?
- $MAIL_MODE = (($_CONFIG['beg_notify_bonus'] > 0) && ($MODE == "en") && (EXT_IS_ACTIVE("bonus")));
+ $MAIL_MODE = ((getConfig('beg_notify_bonus') > 0) && ($MODE == "en") && (EXT_IS_ACTIVE("bonus")));
// Generate subject line
$SUBJECT = constant('BEG_RALLYE_'.strtoupper($MODE).'_NOTIFY');
$url = URL."/modules.php?module=index&what=login";
// Insert mail
- ADD_BONUS_MAIL_TO_QUEUE($SUBJECT, $MSG, $RECEIVER, $_CONFIG['beg_notify_bonus'], $_CONFIG['beg_notify_wait'], $url, 0, "normal", SQL_NUMROWS($result_main));
+ ADD_BONUS_MAIL_TO_QUEUE($SUBJECT, $MSG, $RECEIVER, getConfig('beg_notify_bonus'), getConfig('beg_notify_wait'), $url, 0, "normal", SQL_NUMROWS($result_main));
} // END - if
} // END - if
// Shall I include only active members?
$ADD = "%s"; $VALUE = "";
-if (($_CONFIG['birthday_active']) && (EXT_IS_ACTIVE("autopurge")) && ($_CONFIG['autopurge_inactive'] == "Y") && ($_CONFIG['ap_inactive_since'] > 0)) {
+if ((getConfig('birthday_active')) && (EXT_IS_ACTIVE("autopurge")) && (getConfig('autopurge_inactive') == "Y") && (getConfig('ap_inactive_since') > 0)) {
$ADD = " AND last_online >= (UNIX_TIMESTAP() - %s)";
- $VALUE = $_CONFIG['ap_inactive_since'];
+ $VALUE = getConfig('ap_inactive_since');
}
// Only confirmed members shall receive birthday mails...
$result_birthday = SQL_QUERY_ESC("SELECT userid, email, birth_year
FROM "._MYSQL_PREFIX."_user_data
-WHERE status='CONFIRMED' AND birth_day=%s AND birth_month=%s AND birthday_sent < (UNIX_TIMESTAMP() - ".($_CONFIG['one_day'] * 364).")".$ADD."
+WHERE status='CONFIRMED' AND birth_day=%s AND birth_month=%s AND birthday_sent < (UNIX_TIMESTAMP() - ".(getConfig('one_day') * 364).")".$ADD."
ORDER BY userid",
array($DAY, $MONTH, $VALUE), __FILE__, __LINE__);
// Simply subtract both values and you got the age... :)
$AGE = $NOW - $BD;
- if ($_CONFIG['birthday_points'] > 0) {
+ if (getConfig('birthday_points') > 0) {
// Prepare array for loading template
$content = array(
'age' => $AGE,
- 'points' => TRANSLATE_COMMA($_CONFIG['birthday_points']),
+ 'points' => TRANSLATE_COMMA(getConfig('birthday_points')),
'check' => "",
);
// Insert row into database
$result_insert = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_birthday (userid, points, chk_value) VALUES ('%s','%s','%s' )",
- array(bigintval($uid), $_CONFIG['birthday_points'], $content['check']), __FILE__, __LINE__);
+ array(bigintval($uid), getConfig('birthday_points'), $content['check']), __FILE__, __LINE__);
// Load email template with confirmation link
$msg = LOAD_EMAIL_TEMPLATE("member_birthday_confirm", $content, bigintval($uid));
if ($CSS == 1) return;
// Create timemark from saved month
-$mark = mktime(0, 0, 0, $_CONFIG['last_month'], date("d", time()), date('Y', time()));
+$mark = mktime(0, 0, 0, getConfig('last_month'), date("d", time()), date('Y', time()));
$SQL = ""; $MODE = "";
// Shall I sent activation or deactivation mail?
$SQL = "SELECT userid, email FROM `"._MYSQL_PREFIX."_user_data` WHERE (bonus_ral_notify ";
-switch ($_CONFIG['bonus_active'])
+switch (getConfig('bonus_active'))
{
-case 'Y': // Active rallye is activated
- if ($_CONFIG['bonus_en_notify'] == "Y") {
+case "Y": // Active rallye is activated
+ if (getConfig('bonus_en_notify') == "Y") {
// Okay, let's check for member accounts
$SQL .= "= 0 OR (bonus_ral_notify > 0 AND bonus_ral_en_notify < bonus_ral_di_notify)";
$MODE = "en";
}
break;
-case 'N': // Active rallye is deactivated
- if ($_CONFIG['bonus_di_notify'] == "Y") {
+case "N": // Active rallye is deactivated
+ if (getConfig('bonus_di_notify') == "Y") {
// Okay, let's check for member accounts
$SQL .= " > 0 AND bonus_ral_di_notify < bonus_ral_en_notify";
$MODE = "di";
$SQL .= ") AND status='CONFIRMED' ORDER BY last_online ASC";
// Normal notification mails or bonus mails?
- $MAIL_MODE = (($_CONFIG['bonus_notify_points'] > 0) && ($MODE == "en") && (EXT_IS_ACTIVE("bonus")));
+ $MAIL_MODE = ((getConfig('bonus_notify_points') > 0) && ($MODE == "en") && (EXT_IS_ACTIVE("bonus")));
// Generate subject line
$SUBJECT = constant('BONUS_RALLYE_'.strtoupper($MODE).'_NOTIFY');
$url = URL."/modules.php?module=index&what=login";
// Insert mail
- ADD_BONUS_MAIL_TO_QUEUE($SUBJECT, $MSG, $RECEIVER, $_CONFIG['bonus_notify_points'], $_CONFIG['bonus_notify_wait'], $url, 0, "normal", SQL_NUMROWS($result_main));
+ ADD_BONUS_MAIL_TO_QUEUE($SUBJECT, $MSG, $RECEIVER, getConfig('bonus_notify_points'), getConfig('bonus_notify_wait'), $url, 0, "normal", SQL_NUMROWS($result_main));
} // END - if
} // END - if
}
// When type of admin menu is not set fallback to old menu system
- if (empty($_CONFIG['admin_menu'])) $_CONFIG['admin_menu'] = "OLD";
+ if (getConfig('admin_menu') == null) getConfig('admin_menu') = "OLD";
// Check for version and switch between old menu system and new "intelligent menu system"
if ((ADMIN_CHECK_MENU_MODE() == "NEW") && (FILE_READABLE(PATH."inc/modules/admin/lasys-inc.php"))) {
// Get password from cache
$data['password'] = $cacheArray['admins']['password'][$aid];
$ret = "pass";
- if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
// Include more admins data?
if (GET_EXT_VERSION("admins") >= "0.7.0") {
$menuTitle = array();
// Is there a cache instance?
- if ((is_object($cacheInstance)) && (isset($_CONFIG['cache_admin_menu'])) && ($_CONFIG['cache_admin_menu'] == "Y")) {
+ if ((is_object($cacheInstance)) && (getConfig('cache_admin_menu') == "Y")) {
// Create cache name
$cacheName = "admin_".$act."_".$wht."_".GET_LANGUAGE()."_".strtolower(get_session('admin_login'));
eval($eval);
// Is there a cache instance again?
- if ((is_object($cacheInstance)) && (isset($_CONFIG['cache_admin_menu'])) && ($_CONFIG['cache_admin_menu'] == "Y")) {
+ if ((is_object($cacheInstance)) && (getConfig('cache_admin_menu') == "Y")) {
// Init cache
$cacheInstance->init($cacheName);
global $_CONFIG, $cacheArray;
// Set the global mode as the mode for all admins
- $MODE = $_CONFIG['admin_menu']; $ADMIN = $MODE;
+ $MODE = getConfig('admin_menu');
+ $ADMIN = $MODE;
// Get admin id
$aid = GET_CURRENT_ADMIN_ID();
if (isset($cacheArray['admins']['la_mode'][$aid])) {
// Load from cache
$ADMIN = $cacheArray['admins']['la_mode'][$aid];
- if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
} 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",
- array($aid), __FILE__, __LINE__);
+ array($aid), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Load data
list($ADMIN) = SQL_FETCHROW($result);
global $_CONFIG;
// Set temporary the new settings
- $_CONFIG = array_merge($_CONFIG, $settingsArray);
+ $_CONFIG = merge_array($_CONFIG, $settingsArray);
// Now get the test URL
$content = GET_URL("check-updates3.php");
$title = TASK_NO_TITLE;
// Shall I list SQL commands assigned to an extension installation or update task?
- if (((GET_EXT_VERSION("sql_patches") != '') && ($_CONFIG['verbose_sql'] == "Y")) || (!EXT_IS_ACTIVE("sql_patches"))) {
+ if (((GET_EXT_VERSION("sql_patches") != '') && (getConfig('verbose_sql') == "Y")) || (!EXT_IS_ACTIVE("sql_patches"))) {
$ext_name = substr($subj, 1, strpos($subj, ":") - 1);
if ($type == "EXTENSION") {
// Load SQL commands for registering
// Add SQLs to a table
if (empty($SQLs)) $SQLs = array();
if (empty($title)) $title = "";
- if ((!empty($ext_name)) && (GET_EXT_VERSION("sql_patches")) && ($_CONFIG['verbose_sql'] == "Y")) {
+ if ((!empty($ext_name)) && (GET_EXT_VERSION("sql_patches")) && (getConfig('verbose_sql') == "Y")) {
// Add verbose SQL table
$text .= EXTENSION_VERBOSE_TABLE($SQLs, $title, " class=\"admin_table top2 left2 right2\"", true, "100%")."<br />\n";
} // END - if
define('_START_YEAR' , ADD_SELECTION("year" , date('Y', time()), "start"));
// Calcualte ending date
-$D = date("d", time() + ($_CONFIG['one_day'] * 7));
-$M = date("m", time() + ($_CONFIG['one_day'] * 7));
-$Y = date('Y', time() + ($_CONFIG['one_day'] * 7));
+$D = date("d", time() + (getConfig('one_day') * 7));
+$M = date("m", time() + (getConfig('one_day') * 7));
+$Y = date('Y', time() + (getConfig('one_day') * 7));
// Ending day
define('_END_SEC' , ADD_SELECTION("sec" , "0" , "end"));
SPONSOR_HANDLE_SPONSOR($_POST);
} else {
// Prepare constants for the template
- define('__SPONSOR_MIN_VALUE', $_CONFIG['sponsor_min_points']);
+ define('__SPONSOR_MIN_VALUE', getConfig('sponsor_min_points'));
// Output form
LOAD_TEMPLATE("admin_add_sponsor");
<?php
-/************************************************************************
- * MXChange v0.2.1 Start: 06/25/2004 *
- * ================ Last change: 06/25/2004 *
- * *
- * -------------------------------------------------------------------- *
- * File : what-autopurge.php *
- * -------------------------------------------------------------------- *
- * Short description : AutoPurge configuration *
- * -------------------------------------------------------------------- *
- * Kurzbeschreibung : AutoPurge-Konfiguration *
- * -------------------------------------------------------------------- *
- * *
- * -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder *
- * For more information visit: http://www.mxchange.org *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the Free Software *
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
- * MA 02110-1301 USA *
- ************************************************************************/
-
-// Some security stuff...
-if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
- $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
- require($INC);
-}
-
-// Add description as navigation point
-ADD_DESCR("admin", __FILE__);
-
-if (isset($_POST['ok'])) {
- // Data was submitted so we store it
- ADMIN_SAVE_SETTINGS($_POST);
-} else {
- // Setup constants for the template
- switch ($_CONFIG['autopurge_inactive']) {
- case 'Y':
- define('__YES_IN', " checked=\"checked\"");
- define('__NO_IN' , "");
- break;
-
- case 'N':
- define('__YES_IN', "");
- define('__NO_IN' , " checked=\"checked\"");
- break;
- }
-
- switch ($_CONFIG['autopurge_unconfirmed']) {
- case 'Y':
- define('__YES_UN', " checked=\"checked\"");
- define('__NO_UN' , "");
- break;
-
- case 'N':
- define('__YES_UN', "");
- define('__NO_UN' , " checked=\"checked\"");
- break;
- }
-
- define('__AP_IN_SINCE', $_CONFIG['ap_inactive_since']);
- define('__AP_IN_TIME' , $_CONFIG['ap_in_time']);
- define('__AP_UN_TIME' , $_CONFIG['ap_un_time']);
-
- // Output template
- LOAD_TEMPLATE("admin_config_autopurge");
-}
-//
+// DEPRECATED!
?>
ADD_DESCR("admin", __FILE__);
// Calculate total hits
-$totalHits = ($_CONFIG['db_hits'] + $_CONFIG['cache_hits']);
+$totalHits = (getConfig('db_hits') + getConfig('cache_hits'));
// Prepare data for the template
-define('__DB_HITS' , TRANSLATE_COMMA($_CONFIG['db_hits']));
-define('__CACHE_HITS', TRANSLATE_COMMA($_CONFIG['cache_hits']));
+define('__DB_HITS' , TRANSLATE_COMMA(getConfig('db_hits')));
+define('__CACHE_HITS', TRANSLATE_COMMA(getConfig('cache_hits')));
define('__TOTAL_HITS', TRANSLATE_COMMA($totalHits));
-define('__CACHE_PERC', TRANSLATE_COMMA(($_CONFIG['cache_hits'] / $totalHits * 100)));
+define('__CACHE_PERC', TRANSLATE_COMMA((getConfig('cache_hits') / $totalHits * 100)));
// Load template
LOAD_TEMPLATE("admin_cache_stats");
ADMIN_SAVE_SETTINGS($_POST);
} else {
// Minimum mails / active
- define('__LIMIT_VALUE', $_CONFIG['active_limit']);
+ define('__LIMIT_VALUE', getConfig('active_limit'));
// Load template
LOAD_TEMPLATE("admin_config_active");
ADMIN_SAVE_SETTINGS($_POST);
} else {
// Prepare data for the template
- switch ($_CONFIG['admin_menu'])
+ switch (getConfig('admin_menu'))
{
case "NEW":
define('__ADMIN_MENU_NEW', " checked=\"checked\"");
ADMIN_SAVE_SETTINGS($_POST);
} else {
// Output de-/activation selections
- define('__AP_INACTIVE_SELECTION' , ADD_SELECTION("yn", $_CONFIG['autopurge_inactive'] , "autopurge_inactive"));
- define('__AP_UNCONFIRMED_SELECTION', ADD_SELECTION("yn", $_CONFIG['autopurge_unconfirmed'], "autopurge_unconfirmed"));
- define('__AP_TASKS_SELECTION' , ADD_SELECTION("yn", $_CONFIG['ap_tasks'] , "autopurge_tasks"));
- define('__AP_DEL_MAILS_SELECTION' , ADD_SELECTION("yn", $_CONFIG['ap_del_mails'] , "ap_del_mails"));
+ define('__AP_INACTIVE_SELECTION' , ADD_SELECTION("yn", getConfig('autopurge_inactive') , "autopurge_inactive"));
+ define('__AP_UNCONFIRMED_SELECTION', ADD_SELECTION("yn", getConfig('autopurge_unconfirmed'), "autopurge_unconfirmed"));
+ define('__AP_TASKS_SELECTION' , ADD_SELECTION("yn", getConfig('ap_tasks') , "autopurge_tasks"));
+ define('__AP_DEL_MAILS_SELECTION' , ADD_SELECTION("yn", getConfig('ap_del_mails') , "ap_del_mails"));
// Output notification selections
- define('__AP_NOTIFY_INACTIVE' , ADD_SELECTION("yn", $_CONFIG['ap_in_mail'] , "ap_in_notify"));
- define('__AP_NOTIFY_UNCONFIRMED' , ADD_SELECTION("yn", $_CONFIG['ap_un_mail'] , "ap_un_notify"));
- define('__AP_NOTIFY_TASKS' , ADD_SELECTION("yn", $_CONFIG['ap_tasks_mail'], "ap_tasks_notify"));
- define('__AP_NOTIFY_DEL_MAILS' , ADD_SELECTION("yn", $_CONFIG['ap_dm_notify'] , "ap_dm_notify"));
+ define('__AP_NOTIFY_INACTIVE' , ADD_SELECTION("yn", getConfig('ap_in_notify') , "ap_in_notify"));
+ define('__AP_NOTIFY_UNCONFIRMED' , ADD_SELECTION("yn", getConfig('ap_un_notify') , "ap_un_notify"));
+ define('__AP_NOTIFY_TASKS' , ADD_SELECTION("yn", getConfig('ap_tasks_notify'), "ap_tasks_notify"));
+ define('__AP_NOTIFY_DEL_MAILS' , ADD_SELECTION("yn", getConfig('ap_dm_notify') , "ap_dm_notify"));
// Output time selection boxes
- define('__AP_IN_SINCE' , CREATE_TIME_SELECTIONS($_CONFIG['ap_inactive_since'], "ap_inactive_since" , "MWDh"));
- define('__AP_IN_TIME' , CREATE_TIME_SELECTIONS($_CONFIG['ap_in_time'] , "ap_inactive_time" , "MWDh"));
- define('__AP_UN_TIME' , CREATE_TIME_SELECTIONS($_CONFIG['ap_un_time'] , "ap_unconfirmed_time", "MWDh"));
- define('__AP_TASK_TIME' , CREATE_TIME_SELECTIONS($_CONFIG['ap_tasks_time'] , "ap_tasks_time" , "MWDh"));
- define('__AP_DEL_MAILS_TIME', CREATE_TIME_SELECTIONS($_CONFIG['ap_dm_timeout'] , "ap_dm_timeout" , "MWDh"));
+ define('__AP_IN_SINCE' , CREATE_TIME_SELECTIONS(getConfig('ap_inactive_since'), "ap_inactive_since" , "MWDh"));
+ define('__AP_IN_TIME' , CREATE_TIME_SELECTIONS(getConfig('ap_in_time') , "ap_inactive_time" , "MWDh"));
+ define('__AP_UN_TIME' , CREATE_TIME_SELECTIONS(getConfig('ap_un_time') , "ap_unconfirmed_time", "MWDh"));
+ define('__AP_TASK_TIME' , CREATE_TIME_SELECTIONS(getConfig('ap_tasks_time') , "ap_tasks_time" , "MWDh"));
+ define('__AP_DEL_MAILS_TIME', CREATE_TIME_SELECTIONS(getConfig('ap_dm_timeout') , "ap_dm_timeout" , "MWDh"));
// Mail confirmation links
- define('_CFG_AUTO_PURGE', CREATE_TIME_SELECTIONS($_CONFIG['auto_purge'], "auto_purge", "MWD"));
- if ($_CONFIG['auto_purge_active'] == "N") {
+ define('_CFG_AUTO_PURGE', CREATE_TIME_SELECTIONS(getConfig('auto_purge'), "auto_purge", "MWD"));
+ if (getConfig('auto_purge_active') == "N") {
define('_CFG_AP_ACTIVE_N', " checked=\"checked\"");
define('_CFG_AP_ACTIVE_Y', "");
} else {
$_CONFIG['beg_ral_di_notify'] = $_POST['beg_ral_di_notify'];
} else {
// Prepare constants for the template
- define('__BEG_POINTS' , TRANSLATE_COMMA($_CONFIG['beg_points'] , false));
- define('__BEG_POINTS_MAX' , TRANSLATE_COMMA($_CONFIG['beg_points_max'] , false));
- define('__BEG_NOTIFY_BONUS' , TRANSLATE_COMMA($_CONFIG['beg_notify_bonus'], false));
- define('__BEG_TIMEOUT' , CREATE_TIME_SELECTIONS($_CONFIG['beg_timeout'] , "beg_timeout" , "Dhm"));
- define('__BEG_UID_TIMEOUT' , CREATE_TIME_SELECTIONS($_CONFIG['beg_uid_timeout'], "beg_uid_timeout", "Dhm"));
- define('__BEG_REMOTE_IP_TIMEOUT', CREATE_TIME_SELECTIONS($_CONFIG['beg_ip_timeout'] , "beg_ip_timeout" , "Dhm"));
- define('__WAIT_SELECTION' , CREATE_TIME_SELECTIONS($_CONFIG['beg_notify_wait'], "beg_notify_wait", "ms" ));
- define('__BEG_RANKS', $_CONFIG['beg_ranks']);
+ define('__BEG_POINTS' , TRANSLATE_COMMA(getConfig('beg_points') , false));
+ define('__BEG_POINTS_MAX' , TRANSLATE_COMMA(getConfig('beg_points_max') , false));
+ define('__BEG_NOTIFY_BONUS' , TRANSLATE_COMMA(getConfig('beg_notify_bonus'), false));
+ define('__BEG_TIMEOUT' , CREATE_TIME_SELECTIONS(getConfig('beg_timeout') , "beg_timeout" , "Dhm"));
+ define('__BEG_UID_TIMEOUT' , CREATE_TIME_SELECTIONS(getConfig('beg_uid_timeout'), "beg_uid_timeout", "Dhm"));
+ define('__BEG_REMOTE_IP_TIMEOUT', CREATE_TIME_SELECTIONS(getConfig('beg_ip_timeout') , "beg_ip_timeout" , "Dhm"));
+ define('__WAIT_SELECTION' , CREATE_TIME_SELECTIONS(getConfig('beg_notify_wait'), "beg_notify_wait", "ms" ));
+ define('__BEG_RANKS' , getConfig('beg_ranks'));
// Activate / Deactivate beg rallye (Y/N)
- switch ($_CONFIG['beg_rallye'])
+ switch (getConfig('beg_rallye'))
{
- case 'Y':
+ case "Y":
define('__BEG_RALLYE_Y', " checked=\"checked\"");
define('__BEG_RALLYE_N', "");
break;
- case 'N':
+ case "N":
define('__BEG_RALLYE_Y', "");
define('__BEG_RALLYE_N', " checked=\"checked\"");
break;
}
- switch ($_CONFIG['beg_active'])
+ switch (getConfig('beg_active'))
{
- case 'Y':
+ case "Y":
define('__BEG_ACTIVE_Y', " checked=\"checked\"");
define('__BEG_ACTIVE_N', "");
break;
- case 'N':
+ case "N":
define('__BEG_ACTIVE_Y', "");
define('__BEG_ACTIVE_N', " checked=\"checked\"");
break;
}
- switch ($_CONFIG['beg_mode'])
+ switch (getConfig('beg_mode'))
{
case "DIRECT":
define('__BEG_MODE_DIRECT', " checked=\"checked\"");
break;
}
- switch ($_CONFIG['beg_ral_en_notify'])
+ switch (getConfig('beg_ral_en_notify'))
{
- case 'Y':
+ case "Y":
define('__BEG_RAL_EN_NOTIFY_Y', " checked=\"checked\"");
define('__BEG_RAL_EN_NOTIFY_N', "");
break;
- case 'N':
+ case "N":
define('__BEG_RAL_EN_NOTIFY_Y', "");
define('__BEG_RAL_EN_NOTIFY_N', " checked=\"checked\"");
break;
}
- switch ($_CONFIG['beg_ral_di_notify'])
+ switch (getConfig('beg_ral_di_notify'))
{
- case 'Y':
+ case "Y":
define('__BEG_RAL_DI_NOTIFY_Y', " checked=\"checked\"");
define('__BEG_RAL_DI_NOTIFY_N', "");
break;
- case 'N':
+ case "N":
define('__BEG_RAL_DI_NOTIFY_Y', "");
define('__BEG_RAL_DI_NOTIFY_N', " checked=\"checked\"");
break;
}
- switch ($_CONFIG['beg_new_mem_notify'])
+ switch (getConfig('beg_new_mem_notify'))
{
- case 'Y':
+ case "Y":
define('__BEG_NEW_MEMBER_NOTIFY_Y', " checked=\"checked\"");
define('__BEG_NEW_MEMBER_NOTIFY_N', "");
break;
- case 'N':
+ case "N":
define('__BEG_NEW_MEMBER_NOTIFY_Y', "");
define('__BEG_NEW_MEMBER_NOTIFY_N', " checked=\"checked\"");
break;
}
- switch ($_CONFIG['beg_include_own'])
+ switch (getConfig('beg_include_own'))
{
- case 'Y':
+ case "Y":
define('__BEG_INCLUDE_OWN_Y', " checked=\"checked\"");
define('__BEG_INCLUDE_OWN_N', "");
break;
- case 'N':
+ case "N":
define('__BEG_INCLUDE_OWN_Y', "");
define('__BEG_INCLUDE_OWN_N', " checked=\"checked\"");
break;
}
- switch ($_CONFIG['beg_pay_mode']) {
+ switch (getConfig('beg_pay_mode')) {
case "IMG":
define('__BEG_PAY_MODE_IMG' , " selected=\"selected\"");
define('__BEG_PAY_MODE_JS' , "");
}
// Add data to constant __MEMBER_SELECTION
- define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX($_CONFIG['beg_uid'], false, true, true, "beg_uid"));
+ define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX(getConfig('beg_uid'), false, true, true, "beg_uid"));
// Load form template
LOAD_TEMPLATE("admin_config_beg");
ADMIN_SAVE_SETTINGS($_POST);
} else {
// Prepare data for the template
- define('__POINTS_VALUE', $_CONFIG['birthday_points']);
- switch ($_CONFIG['birthday_active'])
+ define('__POINTS_VALUE', getConfig('birthday_points'));
+ switch (getConfig('birthday_active'))
{
- case 'Y':
+ case "Y":
define('__BIRTHDAY_ACTIVE_Y', " checked=\"checked\"");
define('__BIRTHDAY_ACTIVE_N', "");
break;
- case 'N':
+ case "N":
define('__BIRTHDAY_ACTIVE_Y', "");
define('__BIRTHDAY_ACTIVE_N', " checked=\"checked\"");
break;
}
- switch ($_CONFIG['birthday_mode'])
+ switch (getConfig('birthday_mode'))
{
case "DIRECT":
define('__BIRTHDAY_MODE_DIRECT', " checked=\"checked\"");
unset($_POST['rate']);
// Automatically calculate bonus points for ranks 2 and 3 when not set
- if (empty($_POST['turbo_rates'])) $_POST['turbo_rates'] = "".round($_CONFIG['turbo_bonus'] / 2).";".round($_CONFIG['turbo_bonus'] / 4)."";
+ if (empty($_POST['turbo_rates'])) $_POST['turbo_rates'] = "".round(getConfig('turbo_bonus') / 2).";".round(getConfig('turbo_bonus') / 4)."";
// Save data
ADMIN_SAVE_SETTINGS($_POST);
// Remember new settings
- $_CONFIG['bonus_active'] = $_POST['bonus_active'];
+ getConfig('bonus_active') = $_POST['bonus_active'];
$_CONFIG['bonus_en_notify'] = $_POST['bonus_en_notify'];
$_CONFIG['bonus_di_notify'] = $_POST['bonus_di_notify'];
} else {
// Prepare contants for the template
- define('__LOGIN_VALUE' , TRANSLATE_COMMA($_CONFIG['login_bonus'] , false));
- define('__TURBO_VALUE' , TRANSLATE_COMMA($_CONFIG['turbo_bonus'] , false));
- define('__ORDER_VALUE' , TRANSLATE_COMMA($_CONFIG['bonus_order'] , false));
- define('__REF_VALUE' , TRANSLATE_COMMA($_CONFIG['bonus_ref'] , false));
- define('__STATS_VALUE' , TRANSLATE_COMMA($_CONFIG['bonus_stats'] , false));
- define('__NOTIFY_VALUE', TRANSLATE_COMMA($_CONFIG['bonus_notify_points'], false));
- define('__TRANKS_VALUE', $_CONFIG['bonus_ranks']);
- define('__TLINES_VALUE', $_CONFIG['bonus_lines']);
+ define('__LOGIN_VALUE' , TRANSLATE_COMMA(getConfig('login_bonus') , false));
+ define('__TURBO_VALUE' , TRANSLATE_COMMA(getConfig('turbo_bonus') , false));
+ define('__ORDER_VALUE' , TRANSLATE_COMMA(getConfig('bonus_order') , false));
+ define('__REF_VALUE' , TRANSLATE_COMMA(getConfig('bonus_ref') , false));
+ define('__STATS_VALUE' , TRANSLATE_COMMA(getConfig('bonus_stats') , false));
+ define('__NOTIFY_VALUE', TRANSLATE_COMMA(getConfig('bonus_notify_points'), false));
+ define('__TRANKS_VALUE', getConfig('bonus_ranks'));
+ define('__TLINES_VALUE', getConfig('bonus_lines'));
// Transfer options to template __MEMBER_SELECTION
- define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX($_CONFIG['bonus_uid'], false, true, true, "bonus_uid"));
+ define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX(getConfig('bonus_uid'), false, true, true, "bonus_uid"));
// Initialize array for the points list
- //die("*".$_CONFIG['turbo_rates']."*");
- $RANKS = explode(";", $_CONFIG['turbo_rates']);
+ //die("*".getConfig('turbo_rates')."*");
+ $RANKS = explode(";", getConfig('turbo_rates'));
// Automatically calculate bonus points for ranks 2 and 3 when not set
- if (empty($_CONFIG['turbo_rates'])) $RANKS = array(round($_CONFIG['turbo_bonus'] / 2), round($_CONFIG['turbo_bonus'] / 4));
+ if (getConfig('turbo_rates') == "") $RANKS = array(round(getConfig('turbo_bonus') / 2), round(getConfig('turbo_bonus') / 4));
// Generate list
$OUT = "<OL start=\"2\">\n";
$OUT .= "</OL>\n";
define('__TRATES_LIST', $OUT);
- define('__LOGIN_TIMEOUT_SELECTION', CREATE_TIME_SELECTIONS($_CONFIG['login_timeout'] , "login_timeout" , "WDh"));
- define('__BONUS_TIMEOUT_SELECTION', CREATE_TIME_SELECTIONS($_CONFIG['bonus_timeout'] , "bonus_timeout" , "WDh"));
- define('__WAIT_SELECTION' , CREATE_TIME_SELECTIONS($_CONFIG['bonus_notify_wait'], "bonus_notify_wait", "ms" ));
+ define('__LOGIN_TIMEOUT_SELECTION', CREATE_TIME_SELECTIONS(getConfig('login_timeout') , "login_timeout" , "WDh"));
+ define('__BONUS_TIMEOUT_SELECTION', CREATE_TIME_SELECTIONS(getConfig('bonus_timeout') , "bonus_timeout" , "WDh"));
+ define('__WAIT_SELECTION' , CREATE_TIME_SELECTIONS(getConfig('bonus_notify_wait'), "bonus_notify_wait", "ms" ));
// Activate / Deactivate bonus active rallye (Y/N)
- switch ($_CONFIG['bonus_active'])
+ switch (getConfig('bonus_active'))
{
- case 'Y':
+ case "Y":
define('__BONUS_ACTIVE_Y', " checked=\"checked\"");
define('__BONUS_ACTIVE_N', "");
break;
- case 'N':
+ case "N":
define('__BONUS_ACTIVE_Y', "");
define('__BONUS_ACTIVE_N', " checked=\"checked\"");
break;
}
// Other bonus to de-/activate
- switch ($_CONFIG['bonus_login_yn'])
+ switch (getConfig('bonus_login_yn'))
{
- case 'Y':
+ case "Y":
define('__BONUS_LOGIN_Y', " checked=\"checked\"");
define('__BONUS_LOGIN_N', "");
break;
- case 'N':
+ case "N":
define('__BONUS_LOGIN_Y', "");
define('__BONUS_LOGIN_N', " checked=\"checked\"");
break;
}
- switch ($_CONFIG['bonus_stats_yn'])
+ switch (getConfig('bonus_stats_yn'))
{
- case 'Y':
+ case "Y":
define('__BONUS_STATS_Y', " checked=\"checked\"");
define('__BONUS_STATS_N', "");
break;
- case 'N':
+ case "N":
define('__BONUS_STATS_Y', "");
define('__BONUS_STATS_N', " checked=\"checked\"");
break;
}
- switch ($_CONFIG['bonus_order_yn'])
+ switch (getConfig('bonus_order_yn'))
{
- case 'Y':
+ case "Y":
define('__BONUS_ORDER_Y', " checked=\"checked\"");
define('__BONUS_ORDER_N', "");
break;
- case 'N':
+ case "N":
define('__BONUS_ORDER_Y', "");
define('__BONUS_ORDER_N', " checked=\"checked\"");
break;
}
- switch ($_CONFIG['bonus_ref_yn'])
+ switch (getConfig('bonus_ref_yn'))
{
- case 'Y':
+ case "Y":
define('__BONUS_REF_Y', " checked=\"checked\"");
define('__BONUS_REF_N', "");
break;
- case 'N':
+ case "N":
define('__BONUS_REF_Y', "");
define('__BONUS_REF_N', " checked=\"checked\"");
break;
}
- switch ($_CONFIG['bonus_click_yn'])
+ switch (getConfig('bonus_click_yn'))
{
- case 'Y':
+ case "Y":
define('__BONUS_CLICK_Y', " checked=\"checked\"");
define('__BONUS_CLICK_N', "");
break;
- case 'N':
+ case "N":
define('__BONUS_CLICK_Y', "");
define('__BONUS_CLICK_N', " checked=\"checked\"");
break;
}
- switch ($_CONFIG['bonus_en_notify'])
+ switch (getConfig('bonus_en_notify'))
{
- case 'Y':
+ case "Y":
define('__BONUS_EN_NOTIFY_Y', " checked=\"checked\"");
define('__BONUS_EN_NOTIFY_N', "");
break;
- case 'N':
+ case "N":
define('__BONUS_EN_NOTIFY_Y', "");
define('__BONUS_EN_NOTIFY_N', " checked=\"checked\"");
break;
}
- switch ($_CONFIG['bonus_di_notify'])
+ switch (getConfig('bonus_di_notify'))
{
- case 'Y':
+ case "Y":
define('__BONUS_DI_NOTIFY_Y', " checked=\"checked\"");
define('__BONUS_DI_NOTIFY_N', "");
break;
- case 'N':
+ case "N":
define('__BONUS_DI_NOTIFY_Y', "");
define('__BONUS_DI_NOTIFY_N', " checked=\"checked\"");
break;
}
- switch ($_CONFIG['bonus_new_mem_notify'])
+ switch (getConfig('bonus_new_mem_notify'))
{
- case 'Y':
+ case "Y":
define('__BONUS_NEW_MEMBER_NOTIFY_Y', " checked=\"checked\"");
define('__BONUS_NEW_MEMBER_NOTIFY_N', "");
break;
- case 'N':
+ case "N":
define('__BONUS_NEW_MEMBER_NOTIFY_Y', "");
define('__BONUS_NEW_MEMBER_NOTIFY_N', " checked=\"checked\"");
break;
}
- switch ($_CONFIG['bonus_include_own'])
+ switch (getConfig('bonus_include_own'))
{
- case 'Y':
+ case "Y":
define('__BONUS_INCLUDE_OWN_Y', " checked=\"checked\"");
define('__BONUS_INCLUDE_OWN_N', "");
break;
- case 'N':
+ case "N":
define('__BONUS_INCLUDE_OWN_Y', "");
define('__BONUS_INCLUDE_OWN_N', " checked=\"checked\"");
break;
$_POST['cache_tested'] = "N";
// Check if path has been changed
- if ($_POST['cache_path'] != $_CONFIG['cache_path']) {
+ if ($_POST['cache_path'] != getConfig('cache_path')) {
// Okay, cache path has been altered so we have to test it again!
$_POST['cache_tested'] = "Y";
}
ADMIN_SAVE_SETTINGS($_POST);
} else {
// Prepare data
- switch ($_CONFIG['cache_admins']) {
- case 'Y':
+ switch (getConfig('cache_admins')) {
+ case "Y":
define('__ADMINS_Y', " checked=\"checked\"");
define('__ADMINS_N', "");
break;
- case 'N':
+ case "N":
define('__ADMINS_Y', "");
define('__ADMINS_N', " checked=\"checked\"");
break;
}
- switch ($_CONFIG['cache_acls']) {
- case 'Y':
+ switch (getConfig('cache_acls')) {
+ case "Y":
define('__ACLS_Y', " checked=\"checked\"");
define('__ACLS_N', "");
break;
- case 'N':
+ case "N":
define('__ACLS_Y', "");
define('__ACLS_N', " checked=\"checked\"");
break;
}
- switch ($_CONFIG['cache_exts']) {
- case 'Y':
+ switch (getConfig('cache_exts')) {
+ case "Y":
define('__EXTS_Y', " checked=\"checked\"");
define('__EXTS_N', "");
break;
- case 'N':
+ case "N":
define('__EXTS_Y', "");
define('__EXTS_N', " checked=\"checked\"");
break;
}
- switch ($_CONFIG['cache_config']) {
- case 'Y':
+ switch (getConfig('cache_config')) {
+ case "Y":
define('__CONFIG_Y', " checked=\"checked\"");
define('__CONFIG_N', "");
break;
- case 'N':
+ case "N":
define('__CONFIG_Y', "");
define('__CONFIG_N', " checked=\"checked\"");
break;
}
- switch ($_CONFIG['cache_modreg']) {
- case 'Y':
+ switch (getConfig('cache_modreg')) {
+ case "Y":
define('__MODREG_Y', " checked=\"checked\"");
define('__MODREG_N', "");
break;
- case 'N':
+ case "N":
define('__MODREG_Y', "");
define('__MODREG_N', " checked=\"checked\"");
break;
}
- switch ($_CONFIG['cache_refdepth']) {
- case 'Y':
+ switch (getConfig('cache_refdepth')) {
+ case "Y":
define('__REFDEPTH_Y', " checked=\"checked\"");
define('__REFDEPTH_N', "");
break;
- case 'N':
+ case "N":
define('__REFDEPTH_Y', "");
define('__REFDEPTH_N', " checked=\"checked\"");
break;
}
- switch ($_CONFIG['cache_refsys']) {
- case 'Y':
+ switch (getConfig('cache_refsys')) {
+ case "Y":
define('__REFSYS_Y', " checked=\"checked\"");
define('__REFSYS_N', "");
break;
- case 'N':
+ case "N":
define('__REFSYS_Y', "");
define('__REFSYS_N', " checked=\"checked\"");
break;
}
- switch ($_CONFIG['cache_themes']) {
- case 'Y':
+ switch (getConfig('cache_themes')) {
+ case "Y":
define('__THEMES_Y', " checked=\"checked\"");
define('__THEMES_N', "");
break;
- case 'N':
+ case "N":
define('__THEMES_Y', "");
define('__THEMES_N', " checked=\"checked\"");
break;
}
- switch ($_CONFIG['cache_admin_menu']) {
- case 'Y':
+ switch (getConfig('cache_admin_menu')) {
+ case "Y":
define('__ADMIN_MENU_Y', " checked=\"checked\"");
define('__ADMIN_MENU_N', "");
break;
- case 'N':
+ case "N":
define('__ADMIN_MENU_Y', "");
define('__ADMIN_MENU_N', " checked=\"checked\"");
break;
}
- define('__PATH', $_CONFIG['cache_path']);
+ define('__PATH', getConfig('cache_path'));
// Load template
LOAD_TEMPLATE("admin_config_cache");
} else {
// Prepare data for the template
// - Charge rate
- define('__DOUBLER_CHARGE', TRANSLATE_COMMA(($_CONFIG['doubler_charge'] * 100), false));
+ define('__DOUBLER_CHARGE', TRANSLATE_COMMA((getConfig('doubler_charge') * 100), false));
// - Referal rate
- define('__DOUBLER_REFERRAL', TRANSLATE_COMMA(($_CONFIG['doubler_ref'] * 100), false));
+ define('__DOUBLER_REFERRAL', TRANSLATE_COMMA((getConfig('doubler_ref') * 100), false));
// - Minimum points to double
- define('__DOUBLER_MINIMUM', TRANSLATE_COMMA($_CONFIG['doubler_min'], false));
+ define('__DOUBLER_MINIMUM', TRANSLATE_COMMA(getConfig('doubler_min'), false));
// - Maximum points to double
- define('__DOUBLER_MAXIMUM', TRANSLATE_COMMA($_CONFIG['doubler_max'], false));
+ define('__DOUBLER_MAXIMUM', TRANSLATE_COMMA(getConfig('doubler_max'), false));
// - Points left on users account after doubling
- define('__DOUBLER_LEFT', TRANSLATE_COMMA($_CONFIG['doubler_left'], false));
+ define('__DOUBLER_LEFT', TRANSLATE_COMMA(getConfig('doubler_left'), false));
// - Max payouts to check per click/reset
- define('__DOUBLER_MAX_SENT', $_CONFIG['doubler_max_sent']);
+ define('__DOUBLER_MAX_SENT', getConfig('doubler_max_sent'));
// - Group sending
- define('__DOUBLER_GROUP_SENT', $_CONFIG['doubler_group_sent']);
+ define('__DOUBLER_GROUP_SENT', getConfig('doubler_group_sent'));
// Take points from jackpot (Y/N)
- switch ($_CONFIG['doubler_jackpot'])
+ switch (getConfig('doubler_jackpot'))
{
- case 'Y':
+ case "Y":
define('__DOUBLER_JACKPOT_Y', " checked=\"checked\"");
define('__DOUBLER_JACKPOT_N', "");
break;
- case 'N':
+ case "N":
define('__DOUBLER_JACKPOT_Y', "");
define('__DOUBLER_JACKPOT_N', " checked=\"checked\"");
break;
}
// Take points from own account (Y/N)
- switch ($_CONFIG['doubler_own'])
+ switch (getConfig('doubler_own'))
{
- case 'Y':
+ case "Y":
define('__DOUBLER_OWN_Y', " checked=\"checked\"");
define('__DOUBLER_OWN_N', "");
break;
- case 'N':
+ case "N":
define('__DOUBLER_OWN_Y', "");
define('__DOUBLER_OWN_N', " checked=\"checked\"");
break;
}
// Mail send mode
- switch ($_CONFIG['doubler_send_mode'])
+ switch (getConfig('doubler_send_mode'))
{
case "DIRECT":
define('__DOUBLER_SEND_DIRECT', " checked=\"checked\"");
}
// Take points from own account (Y/N)
- switch ($_CONFIG['doubler_sent_all'])
+ switch (getConfig('doubler_sent_all'))
{
- case 'Y':
+ case "Y":
define('__DOUBLER_SENT_ALL_Y', " checked=\"checked\"");
define('__DOUBLER_SENT_ALL_N', "");
break;
- case 'N':
+ case "N":
define('__DOUBLER_SENT_ALL_Y', "");
define('__DOUBLER_SENT_ALL_N', " checked=\"checked\"");
break;
}
// Transfer options (!!!) to __MEMBER_SELECTION
- define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX($_CONFIG['doubler_uid'], false, true, true, "doubler_uid"));
+ define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX(getConfig('doubler_uid'), false, true, true, "doubler_uid"));
// Number of rows to display (option lines!!!)
- define('__DOUBLER_DISPLAY_NEW', ADD_OPTION_LINES("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), $_CONFIG['doubler_display_new']));
- define('__DOUBLER_DISPLAY_PAY', ADD_OPTION_LINES("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), $_CONFIG['doubler_display_pay']));
- define('__DOUBLER_DISPLAY_OLD', ADD_OPTION_LINES("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), $_CONFIG['doubler_display_old']));
+ define('__DOUBLER_DISPLAY_NEW', ADD_OPTION_LINES("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_new')));
+ define('__DOUBLER_DISPLAY_PAY', ADD_OPTION_LINES("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_pay')));
+ define('__DOUBLER_DISPLAY_OLD', ADD_OPTION_LINES("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_old')));
// Timeout selection box or input box?
- define('__DOUBLER_TIMEOUT', CREATE_TIME_SELECTIONS($_CONFIG['doubler_timeout'] , "doubler_timeout" , "WDh"));
+ define('__DOUBLER_TIMEOUT', CREATE_TIME_SELECTIONS(getConfig('doubler_timeout') , "doubler_timeout" , "WDh"));
// Load template
LOAD_TEMPLATE("admin_config_doubler");
ADMIN_SAVE_SETTINGS($_POST);
} else {
// Prepare data
- switch ($_CONFIG['verbose_sql']) {
- case 'Y':
+ switch (getConfig('verbose_sql')) {
+ case "Y":
define('__VERBOSE_Y', " checked=\"checked\"");
define('__VERBOSE_N', "");
break;
- case 'N':
+ case "N":
define('__VERBOSE_Y', "");
define('__VERBOSE_N', " checked=\"checked\"");
break;
else
{
// Prepare constants for the template
- define('__MAX_VALUE', $_CONFIG['holiday_max']);
- define('__LOCKED' , CREATE_TIME_SELECTIONS($_CONFIG['holiday_lock'] , "holiday_lock" , "WDh"));
+ define('__MAX_VALUE', getConfig('holiday_max'));
+ define('__LOCKED' , CREATE_TIME_SELECTIONS(getConfig('holiday_lock') , "holiday_lock" , "WDh"));
- switch ($_CONFIG['holiday_mode']) {
+ switch (getConfig('holiday_mode')) {
case "RESET":
define('__RESET_DEFAULT' , " checked=\"checked\"");
define('__DIRECT_DEFAULT', "");
break;
case "settings": // Settings related to the index page
- if (isset($_POST['ok']))
- {
+ if (isset($_POST['ok'])) {
// Save settings
ADMIN_SAVE_SETTINGS($_POST);
OUTPUT_HTML("<A href=\"".URL."/modules.php?module=admin&what=config_home&sub=settings\">".ADMIN_CONTINUE_TO_CONFIG."</A>");
- }
- else
- {
+ } else {
// Prepare data for the template
$content = array_fill(-1, 60, "");
- $content[$_CONFIG['index_delay']] = " selected=\"selected\"";
+ $content[getConfig('index_delay')] = " selected=\"selected\"";
- define('__INDEX_COOKIE_SELECTION', CREATE_TIME_SELECTIONS($_CONFIG['index_cookie'], "index_cookie", "YMWD"));
+ define('__INDEX_COOKIE_SELECTION', CREATE_TIME_SELECTIONS(getConfig('index_cookie'), "index_cookie", "YMWD"));
LOAD_TEMPLATE("admin_config_home_settings", false, $content);
}
break;
if (isset($_GET['home'])) {
// Set new home
UPDATE_CONFIG("index_home", $_GET['home']);
- $_CONFIG['index_home'] = SQL_ESCAPE($_GET['home']);
+ getConfig('index_home') = SQL_ESCAPE($_GET['home']);
} // END - if
// Load all what menu points
while (list($id, $wht, $wtitle) = SQL_FETCHROW($result))
{
$LINK = "<A href=\"".URL."/modules.php?module=admin&what=config_home&sub=target&home=".$wht."\">"._IS_NEW_HOME."</A>";
- if ($wht == $_CONFIG['index_home'])
+ if ($wht == getConfig('index_home'))
{
// Is current home
$LINK = "<STRONG class=\"admin_note\">"._IS_CURRENT_HOME."</STRONG>";
else
{
// Start of this exchange
- if ($_CONFIG['mt_start'] > 0)
+ if (getConfig('mt_start') > 0)
{
// Only show start
- define('__MT_START', "<STRONG>".MAKE_DATETIME($_CONFIG['mt_start'], "3")."</STRONG>");
+ define('__MT_START', "<STRONG>".MAKE_DATETIME(getConfig('mt_start'), "3")."</STRONG>");
}
else
{
}
// Next stage of this MT
- define('__MT_STAGE', $_CONFIG['mt_stage']);
+ define('__MT_STAGE', getConfig('mt_stage'));
// Load template
LOAD_TEMPLATE("admin_config_mediadata");
ADMIN_SAVE_SETTINGS($_POST);
} else {
// Prepare contants for the template
- define('__CHARGE_VALUE' , TRANSLATE_COMMA($_CONFIG['nl_charge'], false));
+ define('__CHARGE_VALUE' , TRANSLATE_COMMA(getConfig('nl_charge'), false));
// Prepare constants and load template
LOAD_TEMPLATE("admin_config_newsletter", false);
ADMIN_SAVE_SETTINGS($_POST);
} else {
// Prepare constants for the template
- switch ($_CONFIG['order_max_full'])
+ switch (getConfig('order_max_full'))
{
case "ORDER":
define('__ORDER_DEFAULT', " checked=\"checked\"");
}
// Minimum mails / order
- define('__MIN_VALUE', $_CONFIG['order_min']);
+ define('__MIN_VALUE', getConfig('order_min'));
// Sorting mode (ascending / descending)
- switch ($_CONFIG['order_mode'])
+ switch (getConfig('order_mode'))
{
case "ASC":
define('__ASC_DEFAULT' , " selected=\"selected\"");
}
// Transfer other config data into constants for the template (DO NOT set $_CONFIG as global in LOAD_TEMPLATE!!!)
- define('_CFG_UNCONFIRMED' , $_CONFIG['unconfirmed']);
- define('_CFG_MAX_TLENGTH' , $_CONFIG['max_tlength']);
+ define('_CFG_UNCONFIRMED' , getConfig('unconfirmed'));
+ define('_CFG_MAX_TLENGTH' , getConfig('max_tlength'));
- if ($_CONFIG['test_text'] == "N") {
+ if (getConfig('test_text') == "N") {
define('_CFG_TEST_TEXT_N', " checked=\"checked\"");
define('_CFG_TEST_TEXT_Y', "");
} else {
define('_CFG_TEST_TEXT_Y', " checked=\"checked\"");
}
- switch ($_CONFIG['repay_deleted_mails']) {
+ switch (getConfig('repay_deleted_mails')) {
case "REPAY":
define('_CFG_REPAY_POINTS_REPAY' , " selected=\"selected\"");
define('_CFG_REPAY_POINTS_JACKPOT', "");
break;
}
- if ($_CONFIG['test_subj'] == "N") {
+ if (getConfig('test_subj') == "N") {
define('_CFG_TEST_SUBJ_N', " checked=\"checked\"");
define('_CFG_TEST_SUBJ_Y', "");
} else {
define('_CFG_TEST_SUBJ_Y', " checked=\"checked\"");
}
- if ($_CONFIG['url_blacklist'] == "N") {
+ if (getConfig('url_blacklist') == "N") {
define('_CFG_URL_BLIST_N', " checked=\"checked\"");
define('_CFG_URL_BLIST_Y', "");
} else {
}
// Selection list
- define('__ORDER_SELECT', ORDER_SELECT_OPTION_LIST($_CONFIG['order_select']));
+ define('__ORDER_SELECT', ORDER_SELECT_OPTION_LIST(getConfig('order_select')));
// Load template
LOAD_TEMPLATE("admin_config_order");
ADMIN_SAVE_SETTINGS($_POST);
} else {
// Transfer config data into constants for the template (DO NOT set $_CONFIG as global in LOAD_TEMPLATE!!!)
- define('_CFG_CODE_LENGTH' , $_CONFIG['code_length']);
- define('_CFG_ACT_SYSTEM' , $_CONFIG['activate_xchange']);
- define('_CFG_MAX_SEND' , $_CONFIG['max_send']);
- define('_CFG_REJECT_URL' , $_CONFIG['reject_url']);
- define('_CFG_MIN_AGE' , $_CONFIG['min_age']);
+ define('_CFG_CODE_LENGTH', getConfig('code_length'));
+ define('_CFG_ACT_SYSTEM' , getConfig('activate_xchange'));
+ define('_CFG_MAX_SEND' , getConfig('max_send'));
+ define('_CFG_REJECT_URL' , getConfig('reject_url'));
+ define('_CFG_MIN_AGE' , getConfig('min_age'));
// Is there the pro-version function avaiable to create selection boxes instead of input boxes?
if (function_exists('CREATE_TIME_SELECTIONS')) {
// Only pro versions: time selection boxes
- define('_CFG_ONLINE_TIMEOUT', CREATE_TIME_SELECTIONS($_CONFIG['online_timeout'], "ip_timeout" , "ms"));
- define('_CFG_URL_TLOCK' , CREATE_TIME_SELECTIONS($_CONFIG['url_tlock'] , "url_tlock" , "WDh"));
- define('_CFG_PROFILE_LOCK' , CREATE_TIME_SELECTIONS($_CONFIG['profile_lock'] , "profile_lock" , "WDh"));
- define('_CFG_PROFILE_UPDATE', CREATE_TIME_SELECTIONS($_CONFIG['profile_update'], "profile_update" , "YM"));
- define('_CFG_PROF_REUPDATE' , CREATE_TIME_SELECTIONS($_CONFIG['resend_profile_update'] , "resend_profile_update", "MWD"));
+ define('_CFG_ONLINE_TIMEOUT', CREATE_TIME_SELECTIONS(getConfig('online_timeout'), "ip_timeout" , "ms"));
+ define('_CFG_URL_TLOCK' , CREATE_TIME_SELECTIONS(getConfig('url_tlock') , "url_tlock" , "WDh"));
+ define('_CFG_PROFILE_LOCK' , CREATE_TIME_SELECTIONS(getConfig('profile_lock') , "profile_lock" , "WDh"));
+ define('_CFG_PROFILE_UPDATE', CREATE_TIME_SELECTIONS(getConfig('profile_update'), "profile_update" , "YM"));
+ define('_CFG_PROF_REUPDATE' , CREATE_TIME_SELECTIONS(getConfig('resend_profile_update') , "resend_profile_update", "MWD"));
} else {
// Normal input boxes
- define('_CFG_ONLINE_TIMEOUT', "<INPUT type=\"text\" name=\"online_timeout\" class=\"admin_normal\" size=\"6\" maxlength=\"255\" value=\"".$_CONFIG['online_timeout']."\"> <FONT class=\"tiny\">("._SECONDS.")</FONT>");
- define('_CFG_URL_TLOCK' , "<INPUT type=\"text\" name=\"url_tlock\" class=\"admin_normal\" size=\"6\" maxlength=\"255\" value=\"".$_CONFIG['url_tlock'] ."\"> <FONT class=\"tiny\">("._SECONDS.")</FONT>");
- define('_CFG_PROFILE_LOCK' , "<INPUT type=\"text\" name=\"profile_lock\" class=\"admin_normal\" size=\"6\" maxlength=\"255\" value=\"".$_CONFIG['profile_lock'] ."\"> <FONT class=\"tiny\">("._SECONDS.")</FONT>");
- define('_CFG_PROFILE_UPDATE', "<INPUT type=\"text\" name=\"profile_update\" class=\"admin_normal\" size=\"10\" maxlength=\"255\" value=\"".$_CONFIG['profile_update']."\"> <FONT class=\"tiny\">("._SECONDS.")</FONT>");
- define('_CFG_PROF_REUPDATE' , "<INPUT type=\"text\" name=\"resend_profile_update\" class=\"admin_normal\" size=\"6\" maxlength=\"255\" value=\"".$_CONFIG['resend_profile_update'] ."\"> <FONT class=\"tiny\">("._SECONDS.")</FONT>");
+ define('_CFG_ONLINE_TIMEOUT', "<INPUT type=\"text\" name=\"online_timeout\" class=\"admin_normal\" size=\"6\" maxlength=\"255\" value=\"".getConfig('online_timeout')."\"> <FONT class=\"tiny\">("._SECONDS.")</FONT>");
+ define('_CFG_URL_TLOCK' , "<INPUT type=\"text\" name=\"url_tlock\" class=\"admin_normal\" size=\"6\" maxlength=\"255\" value=\"".getConfig('url_tlock') ."\"> <FONT class=\"tiny\">("._SECONDS.")</FONT>");
+ define('_CFG_PROFILE_LOCK' , "<INPUT type=\"text\" name=\"profile_lock\" class=\"admin_normal\" size=\"6\" maxlength=\"255\" value=\"".getConfig('profile_lock') ."\"> <FONT class=\"tiny\">("._SECONDS.")</FONT>");
+ define('_CFG_PROFILE_UPDATE', "<INPUT type=\"text\" name=\"profile_update\" class=\"admin_normal\" size=\"10\" maxlength=\"255\" value=\"".getConfig('profile_update')."\"> <FONT class=\"tiny\">("._SECONDS.")</FONT>");
+ define('_CFG_PROF_REUPDATE' , "<INPUT type=\"text\" name=\"resend_profile_update\" class=\"admin_normal\" size=\"6\" maxlength=\"255\" value=\"".getConfig('resend_profile_update') ."\"> <FONT class=\"tiny\">("._SECONDS.")</FONT>");
}
- if ($_CONFIG['order_multi_page'] == "N") {
+ if (getConfig('order_multi_page') == "N") {
define('_CFG_ORDER_MULTI_N', " checked=\"checked\"");
define('_CFG_ORDER_MULTI_Y', "");
} else {
define('_CFG_ORDER_MULTI_Y', " checked=\"checked\"");
}
- if ($_CONFIG['autosend_active'] == "N") {
+ if (getConfig('autosend_active') == "N") {
define('_CFG_AUTOSEND_ACTIVE_N', " checked=\"checked\"");
define('_CFG_AUTOSEND_ACTIVE_Y', "");
} else {
define('_CFG_AUTOSEND_ACTIVE_Y', " checked=\"checked\"");
}
- if ($_CONFIG['send_prof_update'] == "N") {
+ if (getConfig('send_prof_update') == "N") {
define('_CFG_SEND_UPDATE_N', " checked=\"checked\"");
define('_CFG_SEND_UPDATE_Y', "");
} else {
define('_CFG_SEND_UPDATE_Y', " checked=\"checked\"");
}
- if ($_CONFIG['admin_notify'] == "N") {
+ if (getConfig('admin_notify') == "N") {
define('_CFG_ADMIN_NOTIFY_N', " checked=\"checked\"");
define('_CFG_ADMIN_NOTIFY_Y', "");
} else {
define('_CFG_ADMIN_NOTIFY_Y', " checked=\"checked\"");
}
- if ($_CONFIG['css_php'] == "DIRECT") {
+ if (getConfig('css_php') == "DIRECT") {
define('_CFG_CSS_PHP_DIRECT', " checked=\"checked\"");
define('_CFG_CSS_PHP_FILE', "");
} else {
define('_CFG_CSS_PHP_FILE', " checked=\"checked\"");
}
- if ($_CONFIG['guest_menu'] == "Y") {
+ if (getConfig('guest_menu') == "Y") {
define('_CFG_GUEST_MENU_ACTIVE', " checked=\"checked\"");
define('_CFG_GUEST_MENU_INACTIVE', "");
} else {
define('_CFG_GUEST_MENU_INACTIVE', " checked=\"checked\"");
}
- if ($_CONFIG['member_menu'] == "Y") {
+ if (getConfig('member_menu') == "Y") {
define('_CFG_MEMBER_MENU_ACTIVE', " checked=\"checked\"");
define('_CFG_MEMBER_MENU_INACTIVE', "");
} else {
define('_CFG_MEMBER_MENU_INACTIVE', " checked=\"checked\"");
}
- if ($_CONFIG['youre_here'] == "Y") {
+ if (getConfig('youre_here') == "Y") {
define('_CFG_YOURE_HERE_ACTIVE', " checked=\"checked\"");
define('_CFG_YOURE_HERE_INACTIVE', "");
} else {
define('_CFG_YOURE_HERE_INACTIVE', " checked=\"checked\"");
}
- if ($_CONFIG['show_timings'] == "Y") {
+ if (getConfig('show_timings') == "Y") {
define('_CFG_SHOW_TIMINGS_Y', " checked=\"checked\"");
define('_CFG_SHOW_TIMINGS_N', "");
} else {
define('_CFG_SHOW_TIMINGS_N', " checked=\"checked\"");
}
- if ($_CONFIG['show_points_unconfirmed'] == "Y") {
+ if (getConfig('show_points_unconfirmed') == "Y") {
define('_CFG_SHOW_POINTS_UNCONFIRMED_Y', " checked=\"checked\"");
define('_CFG_SHOW_POINTS_UNCONFIRMED_N', "");
} else {
define('_CFG_SHOW_POINTS_UNCONFIRMED_N', " checked=\"checked\"");
}
- if ($_CONFIG['mailid_error_redirect'] == 'INDEX') {
+ if (getConfig('mailid_error_redirect') == 'INDEX') {
define('_CFG_MAILID_REDIRECT_INDEX', " checked=\"checked\"");
define('_CFG_MAILID_REDIRECT_REJECT', "");
} else {
for ($i = 0; $i <= 5; $i++) {
$eval = "define('_COMMA_DEF_".$i."', \"\");";
- if ($_CONFIG['max_comma'] == $i) $eval = "define('_COMMA_DEF_".$i."', \" selected\");";
+ if (getConfig('max_comma') == $i) $eval = "define('_COMMA_DEF_".$i."', ' selected=\"selected\"');";
eval($eval);
}
$_POST['reg_points_mode'],
$REF
);
- if (($_CONFIG['ref_payout'] == 0) && ($_POST['ref_payout'] > 0))
+ if ((getConfig('ref_payout') == 0) && ($_POST['ref_payout'] > 0))
{
// Update account's ref_payout for "must-confirm"
$SQL[] = sprintf("UPDATE `"._MYSQL_PREFIX."_user_data` SET ref_payout=(%s - mails_confirmed)
WHERE mails_confirmed < %s", $REF, $REF);
}
- elseif (($_CONFIG['ref_payout'] > 0) && ($_POST['ref_payout'] == 0))
+ elseif ((getConfig('ref_payout') > 0) && ($_POST['ref_payout'] == 0))
{
// Update account's ref_payout for "not-must-confirm"
$SQL[] = "UPDATE `"._MYSQL_PREFIX."_user_data` SET ref_payout=0 WHERE ref_payout > 0";
{
// Setup some settings like direct pay and so on
// Including new add-mode for one-time referal bonus
- switch ($_CONFIG['allow_direct_pay'])
+ switch (getConfig('allow_direct_pay'))
{
- case 'Y':
+ case "Y":
define('__DIRECT_Y', " checked=\"checked\"");
define('__DIRECT_N', "");
break;
- case 'N':
+ case "N":
define('__DIRECT_Y', "");
define('__DIRECT_N', " checked=\"checked\"");
break;
}
// One-time referal bonus add-mode
- switch ($_CONFIG['reg_points_mode'])
+ switch (getConfig('reg_points_mode'))
{
case "ref" : define('__MODE_REF', " checked=\"checked\""); define('__MODE_DIRECT', ""); break;
case "direct": define('__MODE_REF', ""); define('__MODE_DIRECT', " checked=\"checked\""); break;
}
// Referal payout value
- define('__REF_PAYOUT', round($_CONFIG['ref_payout']));
+ define('__REF_PAYOUT', round(getConfig('ref_payout')));
// Load template
LOAD_TEMPLATE("admin_config_point_settings");
elseif ($_GET['sub'] == "points")
{
// First points for registration and other fixed points including new add-mode for one-time referal bonus...
- define('P_REG_VALUE', $_CONFIG['points_register']);
- define('P_REF_VALUE', $_CONFIG['points_ref']);
+ define('P_REG_VALUE', getConfig('points_register'));
+ define('P_REF_VALUE', getConfig('points_ref'));
// Load templates
LOAD_TEMPLATE("admin_config_sub_points");
if (isset($_POST['ok'])) {
// First merge temporarily the new API data into the current config
- $_CONFIG = array_merge($_CONFIG, $_POST);
+ $_CONFIG = merge_array($_CONFIG, $_POST);
// Is the password set?
if (isset($_POST['pass'])) {
} else {
// Prepare data for template output
$content = array(
- 'min_payout' => bigintval($_CONFIG['primera_min_payout']),
- 'min_withdraw' => bigintval($_CONFIG['primera_min_withdraw']),
- 'api_name' => $_CONFIG['primera_api_name'],
- 'api_md5' => $_CONFIG['primera_api_md5']
+ 'min_payout' => bigintval(getConfig('primera_min_payout')),
+ 'min_withdraw' => bigintval(getConfig('primera_min_withdraw')),
+ 'api_name' => getConfig('primera_api_name'),
+ 'api_md5' => getConfig('primera_api_md5'),
+ 'refid' => getConfig('primera_refid')
);
// Load template
} else {
// Prepare content
$content = array(
- 'proxy_host' => $_CONFIG['proxy_host'],
- 'proxy_port' => $_CONFIG['proxy_port'],
- 'proxy_username' => $_CONFIG['proxy_username'],
- 'proxy_password' => $_CONFIG['proxy_password'],
+ 'proxy_host' => getConfig('proxy_host'),
+ 'proxy_port' => getConfig('proxy_port'),
+ 'proxy_username' => getConfig('proxy_username'),
+ 'proxy_password' => getConfig('proxy_password'),
);
// Load template
} else {
// Prepare content
$content = array(
- 'refback_min_perc' => bigintval($_CONFIG['refback_min_perc']),
- 'refback_max_perc' => bigintval($_CONFIG['refback_max_perc'])
+ 'refback_min_perc' => bigintval(getConfig('refback_min_perc')),
+ 'refback_max_perc' => bigintval(getConfig('refback_max_perc'))
);
// Add more content
- switch ($_CONFIG['refback_enabled']) {
+ switch (getConfig('refback_enabled')) {
case "Y": // Refback enabled
$content['refback_enabled_y'] = " checked=\"checked\"";
$content['refback_enabled_n'] = "";
ADMIN_SAVE_SETTINGS($_POST);
} else {
// Prepare contants for the template
- define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX($_CONFIG['def_refid'], false, true, true, "def_refid"));
+ define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX(getConfig('def_refid'), false, true, true, "def_refid"));
- switch ($_CONFIG['refid_target']) {
+ switch (getConfig('refid_target')) {
case "index":
define('__DEF_RT_INDEX' , " selected=\"selected\"");
define('__DEF_RT_REGISTER', "");
break;
} // END - switch
- switch ($_CONFIG['select_user_zero_refid']) {
+ switch (getConfig('select_user_zero_refid')) {
case "Y":
define('__RAND_REFID_Y', " selected=\"selected\"");
define('__RAND_REFID_N', "");
// Prepare content
$content = array(
- 'user_min_confirmed' => $_CONFIG['user_min_confirmed']
+ 'user_min_confirmed' => getConfig('user_min_confirmed')
);
// Load template
<?php
-/************************************************************************
- * MXChange v0.2.1 Start: 10/12/2003 *
- * =============== Last change: 04/26/2004 *
- * *
- * -------------------------------------------------------------------- *
- * File : what-config_reg.php *
- * -------------------------------------------------------------------- *
- * Short description : Setup for the registration form *
- * -------------------------------------------------------------------- *
- * Kurzbeschreibung : Einstellungen fuer das Anmeldeformular *
- * -------------------------------------------------------------------- *
- * *
- * -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder *
- * For more information visit: http://www.mxchange.org *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the Free Software *
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
- * MA 02110-1301 USA *
- ************************************************************************/
-
-// Some security stuff...
-if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
- $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
- require($INC);
-}
-
-// Add description as navigation point
-ADD_DESCR("admin", __FILE__);
-
-if ((isset($_POST['ok'])) && (function_exists('CREATE_TIME_SELECTIONS')))
-{
- // Calculate timestamp from selections...
- $_POST['ip_timeout'] = CREATE_TIMESTAMP_FROM_SELECTIONS("ip_timeout", $_POST);
-}
-
-if ((empty($_POST['least_cats'])) || (empty($_POST['ip_timeout'])))
-{
- unset($_POST['ok']);
-}
-if (isset($_POST['ok']))
-{
- // Save settings
- ADMIN_SAVE_SETTINGS($_POST);
-}
- else
-{
- // Remember stuff in constants
- define('LEAST_CATS_VALUE' , $_CONFIG['least_cats']);
- define('__CFG_SHOW_REFID' , ADD_SELECTION("yn", $_CONFIG['display_refid'], "display_refid"));
- define('__TIMEOUT_SELECTION', CREATE_TIME_SELECTIONS($_CONFIG['ip_timeout'], "ip_timeout", "Dhm"));
- define('__CFG_DBL_EMAIL' , ADD_SELECTION("yn", $_CONFIG['check_double_email'], "check_double_email"));
- define('__CFG_DBL_PASS' , ADD_SELECTION("yn", $_CONFIG['check_double_pass'] , "check_double_pass"));
- define('__REF_PAYOUT' , $_CONFIG['ref_payout']);
-
- // Load normal template
- LOAD_TEMPLATE("admin_config_reg");
-}
-
-//
+// DEPRECATED!
?>
ADMIN_SAVE_SETTINGS($_POST);
} else {
// Remember stuff in constants
- define('LEAST_CATS_VALUE' , round($_CONFIG['least_cats']));
- define('__CFG_SHOW_REFID' , ADD_SELECTION("yn", $_CONFIG['display_refid'] , "display_refid"));
- define('__TIMEOUT_SELECTION', CREATE_TIME_SELECTIONS($_CONFIG['ip_timeout'] , "ip_timeout", "Dhm"));
- define('__CFG_DBL_EMAIL' , ADD_SELECTION("yn", $_CONFIG['check_double_email'] , "check_double_email"));
- define('__CFG_DBL_PASS' , ADD_SELECTION("yn", $_CONFIG['check_double_pass'] , "check_double_pass"));
- define('__CFG_CAT_DEFAULT' , ADD_SELECTION("yn", $_CONFIG['register_default'], "register_default"));
+ define('LEAST_CATS_VALUE' , round(getConfig('least_cats')));
+ define('__CFG_SHOW_REFID' , ADD_SELECTION("yn", getConfig('display_refid') , "display_refid"));
+ define('__TIMEOUT_SELECTION', CREATE_TIME_SELECTIONS(getConfig('ip_timeout') , "ip_timeout", "Dhm"));
+ define('__CFG_DBL_EMAIL' , ADD_SELECTION("yn", getConfig('check_double_email') , "check_double_email"));
+ define('__CFG_DBL_PASS' , ADD_SELECTION("yn", getConfig('check_double_pass') , "check_double_pass"));
+ define('__CFG_CAT_DEFAULT' , ADD_SELECTION("yn", getConfig('register_default'), "register_default"));
// Load normal template
LOAD_TEMPLATE("admin_config_register2");
ADMIN_SAVE_SETTINGS($_POST);
} else {
// Prepare data
- switch ($_CONFIG['removeip_anon_ip']) {
- case 'Y':
+ switch (getConfig('removeip_anon_ip')) {
+ case "Y":
define('__CFG_REMOVEIP_ANON_IP_Y', " checked=\"checked\"");
define('__CFG_REMOVEIP_ANON_IP_N', "");
break;
- case 'N':
+ case "N":
define('__CFG_REMOVEIP_ANON_IP_Y', "");
define('__CFG_REMOVEIP_ANON_IP_N', " checked=\"checked\"");
break;
} // END - switch
- switch ($_CONFIG['removeip_anon_host']) {
- case 'Y':
+ switch (getConfig('removeip_anon_host')) {
+ case "Y":
define('__CFG_REMOVEIP_ANON_HOST_Y', " checked=\"checked\"");
define('__CFG_REMOVEIP_ANON_HOST_N', "");
break;
- case 'N':
+ case "N":
define('__CFG_REMOVEIP_ANON_HOST_Y', "");
define('__CFG_REMOVEIP_ANON_HOST_N', " checked=\"checked\"");
break;
} // END - switch
- switch ($_CONFIG['removeip_anon_ua']) {
- case 'Y':
+ switch (getConfig('removeip_anon_ua')) {
+ case "Y":
define('__CFG_REMOVEIP_ANON_UA_Y', " checked=\"checked\"");
define('__CFG_REMOVEIP_ANON_UA_N', "");
break;
- case 'N':
+ case "N":
define('__CFG_REMOVEIP_ANON_UA_Y', "");
define('__CFG_REMOVEIP_ANON_UA_N', " checked=\"checked\"");
break;
} // END - switch
- switch ($_CONFIG['removeip_anon_ref']) {
- case 'Y':
+ switch (getConfig('removeip_anon_ref')) {
+ case "Y":
define('__CFG_REMOVEIP_ANON_REF_Y', " checked=\"checked\"");
define('__CFG_REMOVEIP_ANON_REF_N', "");
break;
- case 'N':
+ case "N":
define('__CFG_REMOVEIP_ANON_REF_Y', "");
define('__CFG_REMOVEIP_ANON_REF_N', " checked=\"checked\"");
break;
} // END - switch
- switch ($_CONFIG['removeip_admin_show']) {
- case 'Y':
+ switch (getConfig('removeip_admin_show')) {
+ case "Y":
define('__CFG_REMOVEIP_ADMIN_SHOW_Y', " checked=\"checked\"");
define('__CFG_REMOVEIP_ADMIN_SHOW_N', "");
break;
- case 'N':
+ case "N":
define('__CFG_REMOVEIP_ADMIN_SHOW_Y', "");
define('__CFG_REMOVEIP_ADMIN_SHOW_N', " checked=\"checked\"");
break;
} // END - switch
- switch ($_CONFIG['removeip_guest_show']) {
- case 'Y':
+ switch (getConfig('removeip_guest_show')) {
+ case "Y":
define('__CFG_REMOVEIP_GUEST_SHOW_Y', " checked=\"checked\"");
define('__CFG_REMOVEIP_GUEST_SHOW_N', "");
break;
- case 'N':
+ case "N":
define('__CFG_REMOVEIP_GUEST_SHOW_Y', "");
define('__CFG_REMOVEIP_GUEST_SHOW_N', " checked=\"checked\"");
break;
} // END - switch
- switch ($_CONFIG['removeip_member_show']) {
- case 'Y':
+ switch (getConfig('removeip_member_show')) {
+ case "Y":
define('__CFG_REMOVEIP_MEMBER_SHOW_Y', " checked=\"checked\"");
define('__CFG_REMOVEIP_MEMBER_SHOW_N', "");
break;
- case 'N':
+ case "N":
define('__CFG_REMOVEIP_MEMBER_SHOW_Y', "");
define('__CFG_REMOVEIP_MEMBER_SHOW_N', " checked=\"checked\"");
break;
} // END - switch
- switch ($_CONFIG['removeip_sponsor_show']) {
- case 'Y':
+ switch (getConfig('removeip_sponsor_show')) {
+ case "Y":
define('__CFG_REMOVEIP_SPONSOR_SHOW_Y', " checked=\"checked\"");
define('__CFG_REMOVEIP_SPONSOR_SHOW_N', "");
break;
- case 'N':
+ case "N":
define('__CFG_REMOVEIP_SPONSOR_SHOW_Y', "");
define('__CFG_REMOVEIP_SPONSOR_SHOW_N', " checked=\"checked\"");
break;
} // END - switch
- switch ($_CONFIG['anonymous_ip']) {
+ switch (getConfig('anonymous_ip')) {
case "127.0.0.1":
define('__CFG_ANONYMOUS_IP_LOCAL' , " selected=\"selected\"");
define('__CFG_ANONYMOUS_IP_ZERO' , "");
if (empty($title)) $title = "---";
// Already registered module?
- if (ereg($mod, $_CONFIG['rewrite_skip'])) {
+ if (ereg($mod, getConfig('rewrite_skip'))) {
// Found
$y = " checked=\"checked\"";
$n = "";
// Add description as navigation point
ADD_DESCR("admin", __FILE__);
-if (isset($_POST['ok']))
-{
+if (isset($_POST['ok'])) {
// If salt length is empty or null then we shall generate new passwords
- if (empty($_POST['salt_length']) || ($_POST['salt_length'] == "0"))
- {
+ if (empty($_POST['salt_length']) || ($_POST['salt_length'] == "0")) {
// Generate new passwords for all!
require(PATH."/inc/gen_sql_patches.php");
// Redirect to logout link
LOAD_URL("modules.php?module=admin&logout=1");
- }
+ } // END - if
// Save settings
ADMIN_SAVE_SETTINGS($_POST);
-}
- else
-{
+} else {
// Remember stuff in constants
- define('__PASS_LEN' , $_CONFIG['pass_len']);
+ define('__PASS_LEN' , getConfig('pass_len'));
// Password-salt length
- define('__SALT_LENGTH', $_CONFIG['salt_length']);
+ define('__SALT_LENGTH', getConfig('salt_length'));
// Load template
LOAD_TEMPLATE("admin_config_secure");
} else {
// Prepare content
$content = array(
- 'session_save_path' => $_CONFIG['session_save_path'],
+ 'session_save_path' => getConfig('session_save_path'),
);
// Load template
ADMIN_SAVE_SETTINGS($_POST);
} else {
// Remember config data in constants for the template
- define('__SPONSOR_MIN_POINTS', $_CONFIG['sponsor_min_points']);
- define('__SPONSOR_REF_POINTS', $_CONFIG['sponsor_ref_points']);
+ define('__SPONSOR_MIN_POINTS', getConfig('sponsor_min_points'));
+ define('__SPONSOR_REF_POINTS', getConfig('sponsor_ref_points'));
// Load template
LOAD_TEMPLATE("admin_config_sponsor");
ADMIN_SAVE_SETTINGS($_POST);
} else {
// Guest stats
- switch (strtolower($_CONFIG['guest_stats']))
+ switch (getConfig('guest_stats'))
{
- case "members":
+ case "MEMBERS":
define('__MEMBERS_RADIO', " checked selected");
define('__MODULES_RADIO', "");
define('__INACTIVE_RADIO', "");
break;
- case "modules":
+ case "MODULES":
define('__MEMBERS_RADIO', "");
define('__MODULES_RADIO', " checked selected");
define('__INACTIVE_RADIO', "");
break;
- case "inactive":
+ case "INACTIVE":
define('__MEMBERS_RADIO', "");
define('__MODULES_RADIO', "");
define('__INACTIVE_RADIO', " checked selected");
}
// Max stats entries per page
- define('__STATS_LIMIT', $_CONFIG['stats_limit']);
+ define('__STATS_LIMIT', getConfig('stats_limit'));
// Load template
LOAD_TEMPLATE("admin_config_stats");
} else {
// Prepare content
$content = array(
- 'surfbar_static_reward' => TRANSLATE_COMMA($_CONFIG['surfbar_static_reward']),
- 'surfbar_static_costs' => TRANSLATE_COMMA($_CONFIG['surfbar_static_costs']),
- 'surfbar_static_time' => CREATE_TIME_SELECTIONS($_CONFIG['surfbar_static_time'] , "surfbar_static_time" , "ms" , "left"),
- 'surfbar_static_lock' => CREATE_TIME_SELECTIONS($_CONFIG['surfbar_static_lock'] , "surfbar_static_lock" , "hm" , "left"),
- 'surfbar_restart_time' => CREATE_TIME_SELECTIONS($_CONFIG['surfbar_restart_time'] , "surfbar_restart_time" , "ms" , "left"),
- 'surfbar_dynamic_percent' => TRANSLATE_COMMA($_CONFIG['surfbar_dynamic_percent']),
- 'surfbar_max_order' => $_CONFIG['surfbar_max_order'],
- 'surfbar_stats_reload' => CREATE_TIME_SELECTIONS($_CONFIG['surfbar_stats_reload'] , "surfbar_stats_reload" , "ms" , "left"),
- 'surfbar_purge_deleted' => CREATE_TIME_SELECTIONS($_CONFIG['surfbar_purge_deleted'] , "surfbar_purge_deleted" , "WDh", "left"),
- 'surfbar_purge_migrated' => CREATE_TIME_SELECTIONS($_CONFIG['surfbar_purge_migrated'], "surfbar_purge_migrated", "WDh", "left"),
- 'surfbar_pause_url' => $_CONFIG['surfbar_pause_url'],
- 'surfbar_warn_low_points' => $_CONFIG['surfbar_warn_low_points'],
- 'surfbar_low_interval' => CREATE_TIME_SELECTIONS($_CONFIG['surfbar_low_interval'] , "surfbar_low_interval" , "WDh", "left"),
+ 'surfbar_static_reward' => TRANSLATE_COMMA(getConfig('surfbar_static_reward')),
+ 'surfbar_static_costs' => TRANSLATE_COMMA(getConfig('surfbar_static_costs')),
+ 'surfbar_static_time' => CREATE_TIME_SELECTIONS(getConfig('surfbar_static_time') , "surfbar_static_time" , "ms" , "left"),
+ 'surfbar_static_lock' => CREATE_TIME_SELECTIONS(getConfig('surfbar_static_lock') , "surfbar_static_lock" , "hm" , "left"),
+ 'surfbar_restart_time' => CREATE_TIME_SELECTIONS(getConfig('surfbar_restart_time') , "surfbar_restart_time" , "ms" , "left"),
+ 'surfbar_dynamic_percent' => TRANSLATE_COMMA(getConfig('surfbar_dynamic_percent')),
+ 'surfbar_max_order' => getConfig('surfbar_max_order'),
+ 'surfbar_stats_reload' => CREATE_TIME_SELECTIONS(getConfig('surfbar_stats_reload') , "surfbar_stats_reload" , "ms" , "left"),
+ 'surfbar_purge_deleted' => CREATE_TIME_SELECTIONS(getConfig('surfbar_purge_deleted') , "surfbar_purge_deleted" , "WDh", "left"),
+ 'surfbar_purge_migrated' => CREATE_TIME_SELECTIONS(getConfig('surfbar_purge_migrated'), "surfbar_purge_migrated", "WDh", "left"),
+ 'surfbar_pause_url' => getConfig('surfbar_pause_url'),
+ 'surfbar_warn_low_points' => getConfig('surfbar_warn_low_points'),
+ 'surfbar_low_interval' => CREATE_TIME_SELECTIONS(getConfig('surfbar_low_interval') , "surfbar_low_interval" , "WDh", "left"),
);
// Prepare payment model for template
- if ($_CONFIG['surfbar_pay_model'] == "STATIC") {
+ if (getConfig('surfbar_pay_model') == "STATIC") {
// Static model
define('__CONFIG_SURFBAR_PAY_MODEL_STATIC' , " checked=\"checked\"");
define('__CONFIG_SURFBAR_PAY_MODEL_DYNAMIC', "");
}
// Prepare auto-sart
- if ($_CONFIG['surfbar_autostart'] == "Y") {
+ if (getConfig('surfbar_autostart') == "Y") {
// Yes selected
define('__CONFIG_SURFBAR_AUTOSTART_Y', " checked=\"checked\"");
define('__CONFIG_SURFBAR_AUTOSTART_N', "");
}
// Prepare notify limits
- if ($_CONFIG['surfbar_notify_limits'] == "Y") {
+ if (getConfig('surfbar_notify_limits') == "Y") {
// Yes selected
define('__CONFIG_SURFBAR_NOTIFY_LIMITS_Y', " checked=\"checked\"");
define('__CONFIG_SURFBAR_NOTIFY_LIMITS_N', "");
define('__CONFIG_SURFBAR_NOTIFY_LIMITS_N', " checked=\"checked\"");
}
+ // Prepare notify admin about unlocked emails
+ if (getConfig('surfbar_notify_admin_unlock') == "Y") {
+ // Yes selected
+ define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_Y', " checked=\"checked\"");
+ define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_N', "");
+ } else {
+ // No selected
+ define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_Y', "");
+ define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_N', " checked=\"checked\"");
+ }
+
// Prepare order migration
- if ($_CONFIG['surfbar_migrate_order'] == "Y") {
+ if (getConfig('surfbar_migrate_order') == "Y") {
// Yes selected
define('__CONFIG_SURFBAR_MIGRATE_ORDER_Y', " checked=\"checked\"");
define('__CONFIG_SURFBAR_MIGRATE_ORDER_N', "");
}
// Pause URL mode
- if ($_CONFIG['surfbar_pause_mode'] == "INTERNAL") {
+ if (getConfig('surfbar_pause_mode') == "INTERNAL") {
// Internal pause page
define('__CONFIG_SURFBAR_PAUSE_MODE_INTERNAL', " checked=\"checked\"");
define('__CONFIG_SURFBAR_PAUSE_MODE_EXTERNAL', "");
}
// Notification mode
- if ($_CONFIG['surfbar_notification_mode'] == "INSTANT") {
+ if (getConfig('surfbar_notification_mode') == "INSTANT") {
// Instant notification
define('__CONFIG_SURFBAR_NOTIFICATION_MODE_INSTANT', " selected=\"selected\"");
define('__CONFIG_SURFBAR_NOTIFICATION_MODE_RESET' , "");
else
{
// Remember config data in constants for the template
- define('__CFG_TITLE_LEFT' , $_CONFIG['title_left']);
- define('__CFG_TITLE_MIDDLE' , $_CONFIG['title_middle']);
- define('__CFG_TITLE_RIGHT' , $_CONFIG['title_right']);
- define('__CFG_TITLE_DECOS' , ADD_SELECTION("yn", $_CONFIG['enable_title_deco'], "enable_title_deco"));
- define('__CFG_TITLE_MOD_SHOW' , ADD_SELECTION("yn", $_CONFIG['enable_mod_title'] , "enable_mod_title" ));
- define('__CFG_TITLE_WHAT_SHOW', ADD_SELECTION("yn", $_CONFIG['enable_what_title'], "enable_what_title"));
+ define('__CFG_TITLE_LEFT' , getConfig('title_left'));
+ define('__CFG_TITLE_MIDDLE' , getConfig('title_middle'));
+ define('__CFG_TITLE_RIGHT' , getConfig('title_right'));
+ define('__CFG_TITLE_DECOS' , ADD_SELECTION("yn", getConfig('enable_title_deco'), "enable_title_deco"));
+ define('__CFG_TITLE_MOD_SHOW' , ADD_SELECTION("yn", getConfig('enable_mod_title') , "enable_mod_title" ));
+ define('__CFG_TITLE_WHAT_SHOW', ADD_SELECTION("yn", getConfig('enable_what_title'), "enable_what_title"));
// Load template
LOAD_TEMPLATE("admin_config_title");
else
{
// Prepare constants for the template
- define('__MAX_VALUE', $_CONFIG['top10_max']);
+ define('__MAX_VALUE', getConfig('top10_max'));
// Load form template
LOAD_TEMPLATE("admin_config_top10");
}
// Prepare constants for template
-define('__TRANS_MAX_VALUE' , $_CONFIG['transfer_max']);
-define('__TRANS_BALANCE_VALUE', $_CONFIG['transfer_balance']);
-define('__TRANS_CODE_VALUE' , $_CONFIG['transfer_code']);
+define('__TRANS_MAX_VALUE' , bigintval(getConfig('transfer_max')));
+define('__TRANS_BALANCE_VALUE', bigintval(getConfig('transfer_balance')));
+define('__TRANS_CODE_VALUE' , bigintval(getConfig('transfer_code')));
// Autppurge expired transfer entries?
-switch ($_CONFIG['autopurge_inactive']) {
- case 'Y':
+switch (getConfig('ap_transfer')) {
+ case "Y":
define('__YES_AP', " selected=\"selected\"");
define('__NO_AP', "");
break;
- case 'N':
+ case "N":
define('__YES_AP', "");
define('__NO_AP', " selected=\"selected\"");
break;
}
// Time selection box
-define('__TRANS_AGE_SELECTION' , CREATE_TIME_SELECTIONS($_CONFIG['transfer_age'], "transfer_age", "MWDh"));
-define('__TRANS_TIMEOUT_SELECTION', CREATE_TIME_SELECTIONS($_CONFIG['transfer_timeout'], "transfer_timeout", "MWDh"));
+define('__TRANS_AGE_SELECTION' , CREATE_TIME_SELECTIONS(getConfig('transfer_age'), "transfer_age", "MWDh"));
+define('__TRANS_TIMEOUT_SELECTION', CREATE_TIME_SELECTIONS(getConfig('transfer_timeout'), "transfer_timeout", "MWDh"));
// Load template
LOAD_TEMPLATE("admin_config_transfer");
ADMIN_SAVE_SETTINGS($_POST);
} else {
// Prepare constants for the template
- define('__LIMIT_VALUE', $_CONFIG['user_limit']);
- define('__ALPHA_VALUE', $_CONFIG['user_alpha']);
+ define('__LIMIT_VALUE', getConfig('user_limit'));
+ define('__ALPHA_VALUE', getConfig('user_alpha'));
// Load form template
LOAD_TEMPLATE("admin_config_user");
if (isset($_POST['ok'])) {
// First merge temporarily the new API data into the current config
- $_CONFIG = array_merge($_CONFIG, $_POST);
+ $_CONFIG = merge_array($_CONFIG, $_POST);
// Let's test the API first (hold your horses here, cowboy! Thank you. :) )
if (WERNIS_TEST_API()) {
} else {
// Prepare data for template output
$content = array(
- 'min_payout' => bigintval($_CONFIG['wernis_min_payout']),
- 'min_withdraw' => bigintval($_CONFIG['wernis_min_withdraw']),
- 'api_id' => bigintval($_CONFIG['wernis_api_id']),
- 'api_md5' => $_CONFIG['wernis_api_md5'],
- 'api_url' => $_CONFIG['wernis_api_url'],
- 'refid' => bigintval($_CONFIG['wernis_refid']),
- 'payout_factor' => TRANSLATE_COMMA($_CONFIG['wernis_payout_factor']),
- 'withdraw_factor' => TRANSLATE_COMMA($_CONFIG['wernis_withdraw_factor']),
- 'payout_fee_percent' => TRANSLATE_COMMA($_CONFIG['wernis_payout_fee_percent']),
- 'withdraw_fee_percent' => TRANSLATE_COMMA($_CONFIG['wernis_withdraw_fee_percent']),
- 'payout_fee_fix' => bigintval($_CONFIG['wernis_payout_fee_fix']),
- 'withdraw_fee_fix' => bigintval($_CONFIG['wernis_withdraw_fee_fix'])
+ 'min_payout' => bigintval(getConfig('wernis_min_payout')),
+ 'min_withdraw' => bigintval(getConfig('wernis_min_withdraw')),
+ 'api_id' => bigintval(getConfig('wernis_api_id')),
+ 'api_md5' => getConfig('wernis_api_md5'),
+ 'api_url' => getConfig('wernis_api_url'),
+ 'refid' => bigintval(getConfig('wernis_refid')),
+ 'payout_factor' => TRANSLATE_COMMA(getConfig('wernis_payout_factor')),
+ 'withdraw_factor' => TRANSLATE_COMMA(getConfig('wernis_withdraw_factor')),
+ 'payout_fee_percent' => TRANSLATE_COMMA(getConfig('wernis_payout_fee_percent')),
+ 'withdraw_fee_percent' => TRANSLATE_COMMA(getConfig('wernis_withdraw_fee_percent')),
+ 'payout_fee_fix' => bigintval(getConfig('wernis_payout_fee_fix')),
+ 'withdraw_fee_fix' => bigintval(getConfig('wernis_withdraw_fee_fix'))
);
// Prepare payout Y/N selection
- if ($_CONFIG['wernis_payout_active'] == "Y") {
+ if (getConfig('wernis_payout_active') == "Y") {
// Payout allowed
define('__CFG_WERNIS_PAYOUT_ACTIVE_Y', " checked=\"checked\"");
define('__CFG_WERNIS_PAYOUT_ACTIVE_N', "");
}
// Prepare withdraw Y/N selection
- if ($_CONFIG['wernis_withdraw_active'] == "Y") {
+ if (getConfig('wernis_withdraw_active') == "Y") {
// Payout allowed
define('__CFG_WERNIS_WITHDRAW_ACTIVE_Y', " checked=\"checked\"");
define('__CFG_WERNIS_WITHDRAW_ACTIVE_N', "");
} else {
// Prepare content
$content = array(
- 'yoomedia_id' => bigintval($_CONFIG['yoomedia_id']),
- 'yoomedia_sid' => bigintval($_CONFIG['yoomedia_sid']),
- 'yoomedia_passwd' => $_CONFIG['yoomedia_passwd'],
- 'yoomedia_tm_max_reload' => bigintval($_CONFIG['yoomedia_tm_max_reload']),
- 'yoomedia_tm_min_wait' => bigintval($_CONFIG['yoomedia_tm_min_wait']),
- 'yoomedia_tm_clicks_remain' => bigintval($_CONFIG['yoomedia_tm_clicks_remain']),
- 'yoomedia_tm_min_pay' => bigintval($_CONFIG['yoomedia_tm_min_pay'])
+ 'yoomedia_id' => bigintval(getConfig('yoomedia_id')),
+ 'yoomedia_sid' => bigintval(getConfig('yoomedia_sid')),
+ 'yoomedia_passwd' => getConfig('yoomedia_passwd'),
+ 'yoomedia_tm_max_reload' => bigintval(getConfig('yoomedia_tm_max_reload')),
+ 'yoomedia_tm_min_wait' => bigintval(getConfig('yoomedia_tm_min_wait')),
+ 'yoomedia_tm_clicks_remain' => bigintval(getConfig('yoomedia_tm_clicks_remain')),
+ 'yoomedia_tm_min_pay' => bigintval(getConfig('yoomedia_tm_min_pay'))
);
// Erotic?
- switch ($_CONFIG['yoomedia_erotic_allowed']) {
+ switch (getConfig('yoomedia_erotic_allowed')) {
case 0: // No erotic at all
define('__CFG_YOOMEDIA_EROTIC_NONE' , " selected=\"selected\"");
define('__CFG_YOOMEDIA_EROTIC_INCLUDE', "");
$totalPoints = $links * $price;
// Shall we pay the points back to the user?
- if ($_CONFIG['repay_deleted_mails'] != 'SHRED') {
+ if (getConfig('repay_deleted_mails') != "SHRED") {
//* DEBUG: */ echo $stats_id.":".$totalPoints."/".$links."/".$price."<br />\n";
if ($totalPoints > 0) {
// Shall we payback to user or jackpot?
- if ($_CONFIG['repay_deleted_mails'] == "JACKPOT") {
+ if (getConfig('repay_deleted_mails') == "JACKPOT") {
// Set jackpot
$sender = 0;
} // END - if
ADD_POINTS_REFSYSTEM("mail_deleted", $sender, $totalPoints, true, "0", false,"direct");
// Output message
- if ($_CONFIG['repay_deleted_mails'] == 'REPAY') {
+ if (getConfig('repay_deleted_mails') == "REPAY") {
// Repayed
LOAD_TEMPLATE("admin_settings_saved", false, sprintf(ADMIN_POINTS_REPAYED,
TRANSLATE_COMMA($totalPoints)
// Set offset an current page to default values
if (empty($_GET['page'])) $_GET['page'] = "1";
-if (empty($_GET['offset'])) $_GET['offset'] = $_CONFIG['mails_page'];
+if (empty($_GET['offset'])) $_GET['offset'] = getConfig('mails_page');
// Add limitation to SQL string
$SQL .= " LIMIT ".($_GET['offset'] * $_GET['page'] - $_GET['offset']).", ".$_GET['offset'];
$result = SQL_QUERY($SQL, __FILE__, __LINE__);
// Calculate pages
-$PAGES = round(SQL_NUMROWS($result_normal) / $_CONFIG['mails_page'] + 0.5);
+$PAGES = round(SQL_NUMROWS($result_normal) / getConfig('mails_page') + 0.5);
SQL_FREERESULT($result_normal);
if (SQL_NUMROWS($result) > 0)
// Add navigation table rows
if ($PAGES > 1)
{
- define('__TOP_EMAIL_NAV' , ADD_EMAIL_NAV($PAGES, $_CONFIG['mails_page'], true , "3", true));
- define('__BOTTOM_EMAIL_NAV', ADD_EMAIL_NAV($PAGES, $_CONFIG['mails_page'], false, "3", true));
+ define('__TOP_EMAIL_NAV' , ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), true , "3", true));
+ define('__BOTTOM_EMAIL_NAV', ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), false, "3", true));
}
else
{
// Set offset an current page to default values
if (empty($_GET['page'])) $_GET['page'] = "1";
-if (empty($_GET['offset'])) $_GET['offset'] = $_CONFIG['mails_page'];
+if (empty($_GET['offset'])) $_GET['offset'] = getConfig('mails_page');
// Add limitation to SQL string
if (empty($_GET['mid']))
if ((!empty($SQL2)) && ($WHO == _ALL)) $result_bonus = SQL_QUERY($SQL2, __FILE__, __LINE__);
// Calculate pages
-$PAGES = round(SQL_NUMROWS($result_normal) / $_CONFIG['mails_page'] + 0.3);
+$PAGES = round(SQL_NUMROWS($result_normal) / getConfig('mails_page') + 0.3);
SQL_FREERESULT($result_normal);
$MAIL = false;
// Add navigation (with change box and colspan=3)
$content['nav'] = "";
- if ($PAGES > 1) $content['nav'] = ADD_EMAIL_NAV($PAGES, $_CONFIG['mails_page'], false, "3", true);
+ if ($PAGES > 1) $content['nav'] = ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), false, "3", true);
// Prepare content
$content['rows'] = $OUT;
// Load bonus mails only when extension is active
if (SQL_NUMROWS($result_bonus) > 0) {
// Calculate pages
- $PAGES = round(SQL_NUMROWS($result_bonus) / $_CONFIG['mails_page'] + 0.5);
+ $PAGES = round(SQL_NUMROWS($result_bonus) / getConfig('mails_page') + 0.5);
// List emails
$OUT = ""; $content = array();
// Add navigation (without change box but with colspan=3)
$content['nav'] = "";
- if ($PAGES > 1) $content['nav'] = ADD_EMAIL_NAV($PAGES, $_CONFIG['mails_page'], false, "3", true);
+ if ($PAGES > 1) $content['nav'] = ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), false, "3", true);
// Prepare content
$content['rows'] = $OUT;
// Run SQLs on activation / deactivation
switch ($active) {
- case 'Y': $EXT_LOAD_MODE = "activate"; break;
- case 'N': $EXT_LOAD_MODE = "deactivate"; break;
+ case "Y": $EXT_LOAD_MODE = "activate"; break;
+ case "N": $EXT_LOAD_MODE = "deactivate"; break;
}
// Run embeded SQL commands
// Get extension name
$ext_name = GET_EXT_NAME($ext_id);
- if ($_CONFIG['verbose_sql'] == "Y") {
+ if (getConfig('verbose_sql') == "Y") {
// Load SQL commands in remove mode
if (LOAD_EXTENSION($ext_name, "remove", "", true)) {
// Generate extra table with loaded SQL commands
// Exclude default referal id if set
$EXCLUDE_LIST = "";
-if ($_CONFIG['def_refid'] > 0) {
- $EXCLUDE_LIST = " AND d.userid != ".$_CONFIG['def_refid']."";
+if (getConfig('def_refid') > 0) {
+ $EXCLUDE_LIST = " AND d.userid != ".getConfig('def_refid')."";
} // END - if
// Check for more extensions
-if (EXT_IS_ACTIVE("beg")) $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['beg_uid']."";
-if (EXT_IS_ACTIVE("bonus")) $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['bonus_uid']."";
-if (EXT_IS_ACTIVE("doubler")) $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['doubler_uid']."";
+if (EXT_IS_ACTIVE("beg")) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('beg_uid')."";
+if (EXT_IS_ACTIVE("bonus")) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('bonus_uid')."";
+if (EXT_IS_ACTIVE("doubler")) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('doubler_uid')."";
if (GET_EXT_VERSION("holiday") >= "0.1.3") $EXCLUDE_LIST .= " AND d.holiday_active='N'";
// Check for all accounts
FROM `"._MYSQL_PREFIX."_user_data` AS d
WHERE d.status='CONFIRMED' AND d.joined < (UNIX_TIMESTAMP() - %s) AND d.last_online < (UNIX_TIMESTAMP() - %s) AND d.ap_notified < (UNIX_TIMESTAMP() - %s)
".$EXCLUDE_LIST."
-ORDER BY d.userid", array($_CONFIG['ap_inactive_since'], $_CONFIG['ap_inactive_since'], $_CONFIG['ap_inactive_since']), __FILE__, __LINE__);
+ORDER BY d.userid", array(getConfig('ap_inactive_since'), getConfig('ap_inactive_since'), getConfig('ap_inactive_since')), __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0)
{
// Add description as navigation point
ADD_DESCR("admin", __FILE__);
-if ($_CONFIG['beg_rallye'] == "Y")
-{
+if (getConfig('beg_rallye') == "Y") {
// Shall I withdraw now?
- if (isset($_POST['withdraw']))
- {
+ if (isset($_POST['withdraw'])) {
// Okay, let's prepare...
$curr = date("m", time()) - 1;
if (strlen($curr) == 1) $curr = "0".$curr;
UPDATE_CONFIG("last_month", $curr);
LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BEG_WITHDRAW_PREPARED);
OUTPUT_HTML("<br />");
- }
+ } // END - if
// Autopurge installed?
$LAST = "%s"; $ONLINE = "";
- if (EXT_IS_ACTIVE("autopurge"))
- {
+ if (EXT_IS_ACTIVE("autopurge")) {
// Use last online timestamp to keep inactive members away from here
$LAST = " AND last_online >= (UNIX_TIMESTAMP() - %s)";
- $ONLINE = $_CONFIG['ap_inactive_since'];
- }
+ $ONLINE = getConfig('ap_inactive_since');
+ } // END - if
// Check if at least one is in the active rallye
$result = SQL_QUERY_ESC("SELECT userid, email, gender, surname, family, beg_points, last_online
ORDER BY beg_points DESC, last_online DESC, userid",
array($ONLINE), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0)
- {
+ if (SQL_NUMROWS($result) > 0) {
// List users
$OUT = "";$SW = 2; $cnt = 1; $total = 0;
- while(list($uid, $email, $gender, $sname, $fname, $turbo, $last) = SQL_FETCHROW($result))
- {
- // Generate array fore the dynamic template
+ while(list($uid, $email, $gender, $sname, $fname, $turbo, $last) = SQL_FETCHROW($result)) {
+ // Init variables
$WIN1 = ""; $WIN2 = "";
- if ($cnt <= $_CONFIG['beg_ranks'])
- {
+ if ($cnt <= getConfig('beg_ranks')) {
// Maybe he can win his active beg?
$WIN1 = "<STRONG>";
$WIN2 = "</STRONG>";
- }
+ } // END - if
+
+ // Prepare content
$content = array(
'uid' => $uid,
'email' => CREATE_EMAIL_LINK($email, "user_data"),
define('__TOTAL', TRANSLATE_COMMA($total));
// Check if we need to display form or not with manuel withdraw
- if ($_CONFIG['last_month'] == date("m", time()))
- {
+ if (getConfig('last_month') == date("m", time())) {
// Load form
define('__BEG_WITHDRAW_FORM', LOAD_TEMPLATE("admin_list_beg_form", true));
- }
- else
- {
+ } else {
// Display message "no manual withdraw possible"
define('__BEG_WITHDRAW_FORM', "<FONT class=\"admin_failed\">".ADMIN_BEG_ALREADY_WITHDRAW."</FONT>");
}
// Prepare constant for timemark
if (EXT_IS_ACTIVE("autopurge")) {
- define('__AUTOPURGE_TIMEOUT', MAKE_DATETIME(time() - $_CONFIG['ap_inactive_since'], "2"));
+ define('__AUTOPURGE_TIMEOUT', MAKE_DATETIME(time() - getConfig('ap_inactive_since'), "2"));
} else {
define('__AUTOPURGE_TIMEOUT', sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "autopurge"));
}
// Load final template
LOAD_TEMPLATE("admin_list_beg");
- }
- else
- {
+ } else {
// No one has joined the begging rallye...
LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BEG_NO_RALLYE);
}
-}
- else
-{
+} else {
// Rallye deactivated
LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BEG_RALLYE_DEACTIVATED);
}
// Add description as navigation point
ADD_DESCR("admin", __FILE__);
-if ($_CONFIG['bonus_active'] == "Y") {
+if (getConfig('bonus_active') == "Y") {
// Shall I withdraw now?
if (isset($_POST['withdraw'])) {
// Okay, let's prepare...
if (GET_EXT_VERSION("bonus") >= "0.6.9") {
// Add more bonus points here
$USE = "(0";
- if ($_CONFIG['bonus_click_yn'] == "Y") $USE .= " + turbo_bonus";
- if ($_CONFIG['bonus_login_yn'] == "Y") $USE .= " + login_bonus";
- if ($_CONFIG['bonus_order_yn'] == "Y") $USE .= " + bonus_order";
- if ($_CONFIG['bonus_stats_yn'] == "Y") $USE .= " + bonus_stats";
- if ($_CONFIG['bonus_ref_yn'] == "Y") $USE .= " + bonus_ref";
+ if (getConfig('bonus_click_yn') == "Y") $USE .= " + turbo_bonus";
+ if (getConfig('bonus_login_yn') == "Y") $USE .= " + login_bonus";
+ if (getConfig('bonus_order_yn') == "Y") $USE .= " + bonus_order";
+ if (getConfig('bonus_stats_yn') == "Y") $USE .= " + bonus_stats";
+ if (getConfig('bonus_ref_yn') == "Y") $USE .= " + bonus_ref";
$USE .= ")";
} else {
// Old version ???
if (EXT_IS_ACTIVE("autopurge")) {
// Use last online timestamp to keep inactive members away from here
$LAST = " AND last_online >= (UNIX_TIMESTAMP() - %s)";
- $ONLINE = $_CONFIG['ap_inactive_since'];
+ $ONLINE = getConfig('ap_inactive_since');
}
// Check if at least one is in the active rallye
// Generate array fore the dynamic template
$WIN1 = ""; $WIN2 = "";
- if ($cnt <= $_CONFIG['bonus_ranks']) {
+ if ($cnt <= getConfig('bonus_ranks')) {
// Maybe he can win his active bonus?
$WIN1 = "<STRONG>";
$WIN2 = "</STRONG>";
define('__TOTAL', TRANSLATE_COMMA($total));
// Check if we need to display form or not with manuel withdraw
- if ($_CONFIG['last_month'] == date("m", time()))
- {
+ if (getConfig('last_month') == date("m", time())) {
// Load form
define('__BONUS_WITHDRAW_FORM', LOAD_TEMPLATE("admin_list_bonus_form", true));
- }
- else
- {
+ } else {
// Display message "no manual withdraw possible"
define('__BONUS_WITHDRAW_FORM', "<FONT class=\"admin_failed\">".ADMIN_BONUS_ALREADY_WITHDRAW."</FONT>");
}
// Prepare constant for timemark
if (EXT_IS_ACTIVE("autopurge")) {
- define('__AUTOPURGE_TIMEOUT', MAKE_DATETIME(time() - $_CONFIG['ap_inactive_since'], "2"));
+ define('__AUTOPURGE_TIMEOUT', MAKE_DATETIME(time() - getConfig('ap_inactive_since'), "2"));
} else {
define('__AUTOPURGE_TIMEOUT', sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "autopurge"));
}
// Load final template
LOAD_TEMPLATE("admin_list_bonus");
- }
- else
- {
+ } else {
// No one has become an "activity bonus"...
LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BONUS_NO_ACTIVE_RALLYE);
}
-}
- else
-{
+} else {
// Aktive-Rallye not activated
LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BONUS_RALLYE_DEACTIVATED);
}
// Set offset an current page to default values
if (empty($_GET['page'])) $_GET['page'] = "1";
-if (empty($_GET['offset'])) $_GET['offset'] = $_CONFIG['mails_page'];
+if (empty($_GET['offset'])) $_GET['offset'] = getConfig('mails_page');
if ((EXT_IS_ACTIVE("bonus")) && ($WHO == _ALL)) {
// Bonus mails sent by you
// Load bonus mails only when extension is active
if (SQL_NUMROWS($result_bonus) > 0) {
// Calculate pages
- $PAGES = round(SQL_NUMROWS($result_bonus) / $_CONFIG['mails_page'] + 0.5);
+ $PAGES = round(SQL_NUMROWS($result_bonus) / getConfig('mails_page') + 0.5);
// List emails
$OUT = ""; $content = array();
// Add navigation (without change box but with colspan=3)
$content['nav'] = "";
- if ($PAGES > 1) $content['nav'] = ADD_EMAIL_NAV($PAGES, $_CONFIG['mails_page'], false, "3", true);
+ if ($PAGES > 1) $content['nav'] = ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), false, "3", true);
// Prepare content
$content['rows'] = $OUT;
// Add description as navigation point
ADD_DESCR("admin", __FILE__);
-if (!empty($_GET['pid']))
-{
+if (!empty($_GET['pid'])) {
// First let's get the member's ID
$result = SQL_QUERY_ESC("SELECT userid, target_account, payout_total, payout_timestamp, password FROM "._MYSQL_PREFIX."_user_payouts WHERE id=%s LIMIT 1",
array($_GET['pid']), __FILE__, __LINE__);
// Konstante bauen
define('PAYOUT_USERDATA_VALUE', "<A href=\"".CREATE_EMAIL_LINK($email, "user_data")."\">".TRANSLATE_GENDER($gender)." ".$surname." ".$family."</A>");
- if (($_GET['do'] == "accept") && (!empty($email)))
- {
+ if (($_GET['do'] == "accept") && (!empty($email))) {
// Ok, now we can output the form or execute accepting
- if (isset($_POST['ok']))
- {
+ if (isset($_POST['ok'])) {
// Obtain payout type and other data
$result = SQL_QUERY_ESC("SELECT payout_id FROM "._MYSQL_PREFIX."_user_payouts WHERE id=%s LIMIT 1",
array(bigintval($_GET['pid'])), __FILE__, __LINE__);
list($ptype) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
- if (!empty($ptype))
- {
+ if (!empty($ptype)) {
// Obtain data from payout type
$result = SQL_QUERY_ESC("SELECT from_account, from_pass, engine_url, engine_ret_ok, engine_ret_failed, pass_enc, allow_url FROM "._MYSQL_PREFIX."_payout_types WHERE id=%s LIMIT 1",
array(bigintval($ptype)), __FILE__, __LINE__);
list($fuid, $fpass, $eurl, $eok, $failed, $eenc, $allow) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
- if (!empty($eurl))
- {
+ if (!empty($eurl)) {
// Ok, run URL...
$eurl = COMPILE_CODE($eurl);
switch ($eenc)
// Execute transfer
$ret = GET_URL($URL);
- }
- else
- {
+ } else {
// No URL to run
$ret[0] = $eok;
}
- if ($ret[0] == $eok)
- {
+
+ if ($ret[0] == $eok) {
// Clear task
if ($task > 0) {
ADMIN_SOLVE_TASK($task);
// Clear payout request
$result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_payouts SET status='ACCEPTED' WHERE id=%s LIMIT 1",
- array(bigintval($_GET['pid'])), __FILE__, __LINE__);
+ array(bigintval($_GET['pid'])), __FILE__, __LINE__);
// Send out mail
$msg = LOAD_EMAIL_TEMPLATE("member_payout_accepted", $_POST['text'], $uid);
// Output message
- if ($allow == "Y")
- {
+ if ($allow == "Y") {
// Banner / Textlink request
LOAD_TEMPLATE("admin_settings_saved", false, PAYOUT_BANNER_ACCEPTED_NOTIFIED);
- }
- else
- {
+ } else {
// Normal request
LOAD_TEMPLATE("admin_settings_saved", false, PAYOUT_ACCEPTED_NOTIFIED);
}
// Finally send mail
SEND_EMAIL($email, PAYOUT_ACCEPTED_SUBJECT, $msg);
- }
- else
- {
+ } else {
// Something goes wrong... :-(
$content = implode("<br />", $ret);
LOAD_TEMPLATE("admin_payout_failed_transfer", false, $content);
}
- }
- else
- {
+ } else {
// Cannot load payout id
OUTPUT_HTML("<STRONG class=\"admin_failed\">".PAYOUT_FAILED_OBTAIN_PAYOUT_ID."</STRONG>");
}
- }
- else
- {
+ } else {
// Load template
LOAD_TEMPLATE("admin_payout_accept_form", false, $task);
}
- }
- elseif (($_GET['do'] == "reject") && (!empty($email)))
- {
+ } elseif (($_GET['do'] == "reject") && (!empty($email))) {
// Ok, now we can output the form or execute rejecting
- if (isset($_POST['ok']))
- {
+ if (isset($_POST['ok'])) {
if ($task > 0) {
// Clear task
ADMIN_SOLVE_TASK($task);
// Finally send mail
SEND_EMAIL($email, PAYOUT_REJECTED_SUBJECT, $msg);
- }
- else
- {
+ } else {
// Load template
LOAD_TEMPLATE("admin_payout_reject_form", false, $task);
}
- }
- else
- {
+ } else {
// Cannot load user data
LOAD_TEMPLATE("admin_settings_saved", false, PAYOUT_FAILED_OBTAIN_USERDATA);
}
- }
- elseif((empty($task)) || ($task == "0"))
- {
+ } elseif ((empty($task)) || ($task == "0")) {
// Failed loading task ID
LOAD_TEMPLATE("admin_settings_saved", false, PAYOUT_FAILED_OBTAIN_TASK_ID);
}
-}
- else
-{
+} else {
if (empty($_GET['do'])) $_GET['do'] = "";
- if ($_GET['do'] == "delete")
- {
+ if ($_GET['do'] == "delete") {
// Delete all requests
$result = SQL_QUERY("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_payouts", __FILE__, __LINE__);
}
WHERE p.payout_id=t.id
ORDER BY p.payout_timestamp DESC", __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0)
- {
+ if (SQL_NUMROWS($result) > 0) {
// List found payouts
$OUT = ""; $SW = 2;
- while (list($pid, $uid, $total, $account, $bank, $type, $tstamp, $status, $allow, $url, $alt, $banner) = SQL_FETCHROW($result))
- {
- if ($status == "NEW")
- {
+ while (list($pid, $uid, $total, $account, $bank, $type, $tstamp, $status, $allow, $url, $alt, $banner) = SQL_FETCHROW($result)) {
+ if ($status == "NEW") {
// Generate links for direct accepting and rejecting
$status = "<A href=\"".URL."/modules.php?module=admin&what=list_payouts&do=accept&pid=".$pid."\">".PAYOUT_ACCEPT_PAYOUT."</A> | <A href=\"".URL."/modules.php?module=admin&what=list_payouts&do=reject&pid=".$pid."\">".PAYOUT_REJECT_PAYOUT."</A>";
- }
- else
- {
+ } else {
// Translate status
$status = constant('PAYOUT_STATUS_'.strtoupper($status).'');
$status = "<FONT class=\"admin_failed\">".$status."</FONT>";
// Load final template
LOAD_TEMPLATE("admin_list_payouts");
- }
- else
- {
+ } else {
// No payout requests are sent so far
LOAD_TEMPLATE("admin_settings_saved", false, PAYOUT_ADMIN_NO_REQUESTS_FOUND);
}
// Is the rallye active or not?
switch ($active)
{
- case 'Y':
+ case "Y":
// Rallye is active so do not edit it!
$content['select'] = "<STRONG class=\"big\">".$id."</STRONG>";
$content['active_title'] = RALLYE_DEACTIVATE_NOW;
$content['active'] = 0;
break;
- case 'N':
+ case "N":
$content['active_title'] = RALLYE_ACTIVATE_NOW;
$content['active'] = "1";
break;
// Notification to members?
switch ($notify)
{
- case 'Y':
+ case "Y":
$content['notify_title'] = RALLYE_STOP_NOTIFY_NOW;
$content['notify'] = 0;
break;
- case 'N':
+ case "N":
$content['notify_title'] = RALLYE_START_NOTIFY_NOW;
$content['notify'] = "1";
break;
// Auto-add of new joined members?
switch ($auto_add)
{
- case 'Y':
+ case "Y":
$content['auto_title'] = RALLYE_STOP_AUTO_ADD_NOW;
$content['auto'] = 0;
break;
- case 'N':
+ case "N":
$content['auto_title'] = RALLYE_START_AUTO_ADD_NOW;
$content['auto'] = "1";
break;
$result_master = SQL_QUERY($SQL, __FILE__, __LINE__);
// Calculate page count (0.5 fixes a bug with page count)
- if ($_CONFIG['user_limit'] == 0) {
- $_CONFIG['user_limit'] = 100;
+ if (getConfig('user_limit') == 0) {
+ getConfig('user_limit') = 100;
LOAD_TEMPLATE("admin_settings_saved", false, EXTENSION_WARNING_USER_LIMIT);
} // END - if
// Activate the extension please!
- $PAGES = round(SQL_NUMROWS($result_master) / $_CONFIG['user_limit'] + 0.5);
+ $PAGES = round(SQL_NUMROWS($result_master) / getConfig('user_limit') + 0.5);
if (empty($_GET['page'])) $_GET['page'] = "1";
- if (empty($_GET['offset'])) $_GET['offset'] = $_CONFIG['user_limit'];
+ if (empty($_GET['offset'])) $_GET['offset'] = getConfig('user_limit');
// Add limitation to SQL string and run him again
$SQL .= " LIMIT ".($_GET['offset'] * $_GET['page'] - $_GET['offset']).", ".$_GET['offset'];
}
if ($PAGES > 1) {
- define('__PAGE_NAV', ADD_PAGENAV($PAGES, $_CONFIG['user_limit'], true, $colspan, true));
+ define('__PAGE_NAV', ADD_PAGENAV($PAGES, getConfig('user_limit'), true, $colspan, true));
} else {
// No page navigation is required
define('__PAGE_NAV', "");
}
// Enougth queries left?
-if ($_CONFIG['yoomedia_requests_remain'] == 0) {
+if (getConfig('yoomedia_requests_remain') == 0) {
// Output message
LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_YOOMEDIA_REQUESTS_DEPLETED);
if (isset($_POST['ok']))
{
// De- or activate maintenance mode
- switch ($_CONFIG['maintenance'])
+ switch (getConfig('maintenance'))
{
- case 'Y':
+ case "Y":
$target_mode = "N";
$out = ADMIN_MAINTENANCE_DEACTIVATED;
break;
- case 'N':
+ case "N":
$target_mode = "Y";
$out = ADMIN_MAINTENANCE_ACTIVATED;
break;
// Load template
LOAD_TEMPLATE("admin_settings_saved", false, $out);
} else {
- switch ($_CONFIG['maintenance'])
+ switch (getConfig('maintenance'))
{
- case 'Y': // Maintenance mode is active
+ case "Y": // Maintenance mode is active
define('ADMIN_MAINTENANCE_MODE', ADMIN_MAINTENANCE_MODE_IS_ACTIVE);
break;
- case 'N': // Maintenance mode is inactive
+ case "N": // Maintenance mode is inactive
define('ADMIN_MAINTENANCE_MODE', ADMIN_MAINTENANCE_MODE_IS_INACTIVE);
break;
}
SQL_FREERESULT($result);
// Is the surfbar installed?
- if ((EXT_IS_ACTIVE("surfbar")) && ($_CONFIG['surfbar_migrate_order'] == "Y")) {
+ if ((EXT_IS_ACTIVE("surfbar")) && (getConfig('surfbar_migrate_order') == "Y")) {
// Then "migrate" the URL to the surfbar
SURFBAR_ADMIN_MIGRATE_URL($DATA['url'], $DATA['sender']);
} // END - if
// Check for bonus extension version >= 0.4.4 for the order bonus
- if ((GET_EXT_VERSION("bonus") >= "0.4.4") && ($_CONFIG['bonus_active'] == "Y")) {
+ if ((GET_EXT_VERSION("bonus") >= "0.4.4") && (getConfig('bonus_active') == "Y")) {
// Add points directly
- $result = SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_user_data` SET bonus_order=bonus_order+".$_CONFIG['bonus_order']." WHERE userid=%s LIMIT 1",
- array(bigintval($DATA['sender'])), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_user_data` SET bonus_order=bonus_order+".getConfig('bonus_order')." WHERE userid=%s LIMIT 1",
+ array(bigintval($DATA['sender'])), __FILE__, __LINE__);
// Subtract bonus points from system
- BONUS_POINTS_HANDLER($_CONFIG['bonus_order']);
+ BONUS_POINTS_HANDLER(getConfig('bonus_order'));
} // END - if
// Load email template
// Load URL and subject from pool
$result = SQL_QUERY_ESC("SELECT url, subject, sender FROM "._MYSQL_PREFIX."_pool WHERE id=%s LIMIT 1",
- array($id), __FILE__, __LINE__);
+ array($id), __FILE__, __LINE__);
// Load data
$DATA = SQL_FETCHARRAY($result);
// Redirect URL
$result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_pool SET url='%s', data_type='NEW' WHERE id=%s LIMIT 1",
- array($_POST['redirect'], $id),__FILE__, __LINE__);
+ array($_POST['redirect'], $id),__FILE__, __LINE__);
// Prepare data for the row template
$content = array(
foreach ($_POST['sel'] as $id => $url) {
// Lookup in blacklist
$result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_url_blist WHERE url='%s' LIMIT 1",
- array($url), __FILE__, __LINE__);
+ array($url), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 0) {
// Did not find a record so we can add it... :)
$result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_url_blist (url, timestamp) VALUES ('%s', UNIX_TIMESTAMP())",
- array($url), __FILE__, __LINE__);
+ array($url), __FILE__, __LINE__);
} else {
// Free memory
SQL_FREERESULT($result);
// Prepare rejection URL
$REJECT = "http://";
- if (GET_EXT_VERSION("other") >= "0.1.6") $REJECT = $_CONFIG['reject_url'];
+ if (GET_EXT_VERSION("other") >= "0.1.6") $REJECT = getConfig('reject_url');
define('__REJECT_URL', $REJECT);
// Load main template
$result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_sponsor_data
SET points_amount=points_amount+%s, ref_count=ref_count+1
WHERE id='%s' LIMIT 1",
- array($_CONFIG['sponsor_ref_points'], bigintval($refid)), __FILE__, __LINE__);
+ array(getConfig('sponsor_ref_points'), bigintval($refid)), __FILE__, __LINE__);
// Whas that update fine?
if (SQL_AFFECTEDROWS() == 1) {
if ($REFERRAL['receive_warnings'] == "Y") {
// Translate some data
$REFERRAL['points'] = TRANSLATE_COMMA($REFERRAL['points']);
- $REFERRAL['ref_points'] = TRANSLATE_COMMA($_CONFIG['sponsor_ref_points']);
+ $REFERRAL['ref_points'] = TRANSLATE_COMMA(getConfig('sponsor_ref_points'));
$REFERRAL['gender'] = TRANSLATE_GENDER($REFERRAL['gender']);
// Send notification to referal
// Maximum of available pacthes extracted (above). Now we can get all informations
for ($idx = 0; $idx < $max; $idx++) {
// List only newer patches
- $TEST = substr(str_replace("\n", "", $response[$idx * 5 + 2]), 0, strlen($_CONFIG['patch_level']));
+ $TEST = substr(str_replace("\n", "", $response[$idx * 5 + 2]), 0, strlen(getConfig('patch_level')));
// I have removed the addional test for the stored timemark in database or you cannot find
// new updates on my server when you haven't installed it before I upload a patch... :-(
- if (bigintval($TEST) > bigintval($_CONFIG['patch_level'])) {
+ if (bigintval($TEST) > bigintval(getConfig('patch_level'))) {
// Copy every data from the response array
$PATCHES['fname'][] = str_replace("\n", "", $response[$idx * 5 + 2]);
$PATCHES['fsize'][] = str_replace("\n", "", $response[$idx * 5 + 3]);
}
OUTPUT_HTML("<TR>
<TD colspan=\"8\" align=\"center\" class=\"admin_footer\">
- ".ONLINE_TIMEOUT_IS_1.CREATE_FANCY_TIME($_CONFIG['online_timeout']).ONLINE_TIMEOUT_IS_2."
+ ".ONLINE_TIMEOUT_IS_1.CREATE_FANCY_TIME(getConfig('online_timeout')).ONLINE_TIMEOUT_IS_2."
</TD>
</TR>
</TABLE>");
SQL_FREERESULT($result);
// Load footer template
- define('__FANCY_ONLINE_TIMEOUT', CREATE_FANCY_TIME($_CONFIG['online_timeout']));
+ define('__FANCY_ONLINE_TIMEOUT', CREATE_FANCY_TIME(getConfig('online_timeout')));
LOAD_TEMPLATE("admin_online_footer");
}
}
// Bonus is not given by default ;-)
$bonus = false;
- if ((GET_EXT_VERSION("sql_patches") >= "0.2.8") && (GET_EXT_VERSION("bonus") >= "0.2.1") && ($_CONFIG['bonus_login_yn'] == "Y")) {
+ if ((GET_EXT_VERSION("sql_patches") >= "0.2.8") && (GET_EXT_VERSION("bonus") >= "0.2.1") && (getConfig('bonus_login_yn') == "Y")) {
// Update last login if far enougth away
$result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data
SET last_login=UNIX_TIMESTAMP()
LIMIT 1",
array(
$GLOBALS['userid'],
- $_CONFIG['login_timeout']
+ getConfig('login_timeout')
), __FILE__, __LINE__
);
if (SQL_AFFECTEDROWS() == 1) $bonus = true;
// Output message with added points
OUTPUT_HTML("<font class=\"tiny\">
".BONUS_LOGIN_BONUS_ADDED_1."
- <strong>".TRANSLATE_COMMA($_CONFIG['login_bonus'])." ".POINTS."</strong>
+ <strong>".TRANSLATE_COMMA(getConfig('login_bonus'))." ".POINTS."</strong>
".BONUS_LOGIN_BONUS_ADDED_2."
</font>");
} elseif (EXT_IS_ACTIVE("bonus")) {
if (!empty($_GET['order'])) {
// Order number placed, is he also logged in?
- if(IS_MEMBER()) {
+ if (IS_MEMBER()) {
// Ok, test passed... :)
$result = SQL_QUERY_ESC("SELECT subject, url FROM "._MYSQL_PREFIX."_pool WHERE id=%s AND sender=%s AND data_type='TEMP' LIMIT 1",
array(bigintval($_GET['order']), $GLOBALS['userid']), __FILE__, __LINE__);
// Total visitors online
$total = SQL_NUMROWS($result_guests) + SQL_NUMROWS($result_members) + SQL_NUMROWS($result_admins);
-if ($_CONFIG['mad_count'] < $total) {
+if (getConfig('mad_count') < $total) {
// Update counter
UPDATE_CONFIG(array("mad_timestamp", "mad_count"), array(time(), $total));
$_CONFIG['mad_count'] = $total;
$_CONFIG['last_mad'] = time();
-}
+} // END - if
// Put all values in constants for the template
define('GUESTS_ONLINE_CNT' , SQL_NUMROWS($result_guests));
if (EXT_IS_ACTIVE("active")) {
// Init content
$content = array(
- 'menu' => "<A class=\"menu_blur\" href=\"".URL."/modules.php?module=index&what=active\">".$_CONFIG['menu_blur_spacer'].GUEST_ACTIVE_LINK."</A>",
+ 'menu' => "<A class=\"menu_blur\" href=\"".URL."/modules.php?module=index&what=active\">".getConfig('menu_blur_spacer').GUEST_ACTIVE_LINK."</A>",
'what' => "active"
);
FROM "._MYSQL_PREFIX."_user_data
WHERE last_online >= %s AND status='CONFIRMED'
ORDER BY last_online DESC LIMIT %s",
- array(START_TDAY, $_CONFIG['active_limit']), __FILE__, __LINE__);
+ array(START_TDAY, getConfig('active_limit')), __FILE__, __LINE__);
// Entries found?
if (SQL_NUMROWS($result) > 0) {
ADD_DESCR("guest", __FILE__);
// Prepare constants
-define('__BEG_POINTS' , TRANSLATE_COMMA($_CONFIG['beg_points']));
-define('__BEG_POINTS_MAX', TRANSLATE_COMMA($_CONFIG['beg_points_max']));
+define('__BEG_POINTS' , TRANSLATE_COMMA(getConfig('beg_points')));
+define('__BEG_POINTS_MAX', TRANSLATE_COMMA(getConfig('beg_points_max')));
if ($GLOBALS['refid'] > 0) {
// Take referal ID from URL/Cookie
define('__BEG_UID' , $GLOBALS['refid']);
} else {
// Take default referal ID
- define('__BEG_UID' , $_CONFIG['def_refid']);
+ define('__BEG_UID' , getConfig('def_refid'));
}
if (function_exists('CREATE_FANCY_TIME')) {
- define('__BEG_TIMEOUT' , CREATE_FANCY_TIME($_CONFIG['beg_timeout']));
- define('__BEG_UID_TIMEOUT', CREATE_FANCY_TIME($_CONFIG['beg_uid_timeout']));
+ define('__BEG_TIMEOUT' , CREATE_FANCY_TIME(getConfig('beg_timeout')));
+ define('__BEG_UID_TIMEOUT', CREATE_FANCY_TIME(getConfig('beg_uid_timeout')));
} else {
- define('__BEG_TIMEOUT ' , round($_CONFIG['beg_timeout'] / 60)." ".MINUTES);
- define('__BEG_UID_TIMEOUT', round($_CONFIG['beg_uid_timeout'] / 60)." ".MINUTES);
+ define('__BEG_TIMEOUT ' , round(getConfig('beg_timeout') / 60)." ".MINUTES);
+ define('__BEG_UID_TIMEOUT', round(getConfig('beg_uid_timeout') / 60)." ".MINUTES);
}
// Load final template
// Unlock his account (but only when it is on UNCONFIRMED!)
$result = SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_user_data` SET status='CONFIRMED', ref_payout=%s, user_hash=NULL WHERE user_hash='%s' AND status='UNCONFIRMED' LIMIT 1",
- array($_CONFIG['ref_payout'], $_GET['hash']), __FILE__, __LINE__);
+ array(getConfig('ref_payout'), $_GET['hash']), __FILE__, __LINE__);
if (SQL_AFFECTEDROWS() == 1) {
- $msg = LOAD_EMAIL_TEMPLATE("confirm-member", array('points' => $_CONFIG['points_register']), bigintval($uid));
+ $msg = LOAD_EMAIL_TEMPLATE("confirm-member", array('points' => getConfig('points_register')), bigintval($uid));
// And send him right away the confirmation mail
SEND_EMAIL($email, GUEST_THANX_CONFIRM, $msg);
unset($DEPTH);
// Shall I "pay" the referal points imidiately?
- if ($_CONFIG['ref_payout'] == "0") {
+ if (getConfig('ref_payout') == "0") {
// Yes, "pay" it now
$locked = false;
} else {
}
// If version matches add ref bonus to refid's account
- if ((GET_EXT_VERSION("bonus") >= "0.4.4") && ($_CONFIG['bonus_active'] == "Y")) {
+ if ((GET_EXT_VERSION("bonus") >= "0.4.4") && (getConfig('bonus_active') == "Y")) {
// Add points (directly only!)
$result = SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_user_data` SET bonus_ref=bonus_ref+%s WHERE userid=%s LIMIT 1",
- array($_CONFIG['bonus_ref'], bigintval($rid)), __FILE__, __LINE__);
+ array(getConfig('bonus_ref'), bigintval($rid)), __FILE__, __LINE__);
// Subtract points from system
- BONUS_POINTS_HANDLER($_CONFIG['bonus_ref']);
+ BONUS_POINTS_HANDLER(getConfig('bonus_ref'));
} // END - if
// Add one-time referal bonus over referal system or directly
unset($DEPTH);
- ADD_POINTS_REFSYSTEM("referal_bonus", $rid, $_CONFIG['points_ref'], true, bigintval($uid), $locked, $_CONFIG['reg_points_mode']);
+ ADD_POINTS_REFSYSTEM("referal_bonus", $rid, getConfig('points_ref'), true, bigintval($uid), $locked, getConfig('reg_points_mode'));
} // END - if
} // END - if
ADD_DESCR("guest", __FILE__);
// Percent values etc.
-define('__CHARGE_VALUE', TRANSLATE_COMMA($_CONFIG['doubler_charge'] * 100));
-define('__REF_VALUE' , TRANSLATE_COMMA($_CONFIG['doubler_ref'] * 100));
-define('__TOTAL_VALUE' , TRANSLATE_COMMA($_CONFIG['doubler_points']));
-define('__MIN_VALUE' , TRANSLATE_COMMA($_CONFIG['doubler_min']));
-define('__MAX_VALUE' , TRANSLATE_COMMA($_CONFIG['doubler_max']));
+define('__CHARGE_VALUE', TRANSLATE_COMMA(getConfig('doubler_charge') * 100));
+define('__REF_VALUE' , TRANSLATE_COMMA(getConfig('doubler_ref') * 100));
+define('__TOTAL_VALUE' , TRANSLATE_COMMA(getConfig('doubler_points')));
+define('__MIN_VALUE' , TRANSLATE_COMMA(getConfig('doubler_min')));
+define('__MAX_VALUE' , TRANSLATE_COMMA(getConfig('doubler_max')));
// Transfer referal ID
define('__REFID', $GLOBALS['refid']);
// Usage counter
-define('__DOUBLER_COUNTER', $_CONFIG['doubler_counter']);
+define('__DOUBLER_COUNTER', getConfig('doubler_counter'));
// Which mail-send-mode did the admin setup?
-switch ($_CONFIG['doubler_send_mode'])
+switch (getConfig('doubler_send_mode'))
{
case "DIRECT":
define('DOUBLER_PAYOUT_TIME', DOUBLER_PAYOUT_TIME_DIRECT);
define('__DOUBLER_PAYOUT_NEXT', DOUBLER_GENERATE_TABLE());
// Generate timemark
-define('__TIMEOUT_MARK', CREATE_FANCY_TIME($_CONFIG['doubler_timeout']));
+define('__TIMEOUT_MARK', CREATE_FANCY_TIME(getConfig('doubler_timeout')));
// Points left to double
define('__LEFT_VALUE', DOUBLER_GET_TOTAL_POINTS_LEFT());
// Probe for last online timemark
$probe = time() - $online;
if (!empty($login)) $probe = time() - $login;
- if ((GET_EXT_VERSION("bonus") >= "0.2.2") && ($probe >= $_CONFIG['login_timeout'])) {
+ if ((GET_EXT_VERSION("bonus") >= "0.2.2") && ($probe >= getConfig('login_timeout'))) {
// Add login bonus to user's account
$ADD = sprintf(", login_bonus=login_bonus+%s",
- (float)$_CONFIG['login_bonus']
+ (float)getConfig('login_bonus')
);
$BONUS = true;
// Subtract login bonus from userid's account or jackpot
- if ((GET_EXT_VERSION("bonus") >= "0.3.5") && ($_CONFIG['bonus_mode'] != "ADD")) BONUS_POINTS_HANDLER('login_bonus');
+ if ((GET_EXT_VERSION("bonus") >= "0.3.5") && (getConfig('bonus_mode') != "ADD")) BONUS_POINTS_HANDLER('login_bonus');
} // END - if
// Init variables
define('user_count' , (user_confirmed + user_unconfirmed + user_locked));
// Start of this exchange
-define('__MT_START', MAKE_DATETIME($_CONFIG['mt_start'], "3"));
+define('__MT_START', MAKE_DATETIME(getConfig('mt_start'), "3"));
// Projected number of members
-define('__MT_STAGE', $_CONFIG['mt_stage']);
+define('__MT_STAGE', getConfig('mt_stage'));
// Project timestamp when number of members are reached
$PROJECTED = 0;
if (user_count > 0) {
- $PROJECTED = round((time() - $_CONFIG['mt_start']) / user_count * $_CONFIG['mt_stage'] + $_CONFIG['mt_start']);
+ $PROJECTED = round((time() - getConfig('mt_start')) / user_count * getConfig('mt_stage') + getConfig('mt_start'));
}
$YEAR = date('Y', $PROJECTED); $MONTH = date("m", $PROJECTED); $DAY = date("d", $PROJECTED);
define('__ROWSPAN_USER' , $rowNameS_USER);
// Patch level and it's timespamp
-define('__PATCH_LEVEL', $_CONFIG['patch_level']);
-define('__PATCH_CTIME', MAKE_DATETIME($_CONFIG['patch_ctime'], "2"));
+define('__PATCH_LEVEL', getConfig('patch_level'));
+define('__PATCH_CTIME', MAKE_DATETIME(getConfig('patch_ctime'), "2"));
// Load template
LOAD_TEMPLATE("mediadata");
define('__RALLYE_EXTRAS', RALLYE_HAS_EXPIRED);
$expired = true;
}
- elseif (time() >= ($end - $_CONFIG['one_day']))
+ elseif (time() >= ($end - getConfig('one_day')))
{
// Rallye will expire in less one day!
define('__RALLYE_EXTRAS', RALLYE_EXPIRE_ONE_DAY);
//* DEBUG: */ die("refid={$GLOBALS['refid']}/numRows=".SQL_NUMROWS($result)."");
if (SQL_NUMROWS($result) == 0) {
// Not found so we set your refid!
- $_POST['refid'] = $_CONFIG['def_refid'];
- set_session('refid', $_CONFIG['def_refid']);
+ $_POST['refid'] = getConfig('def_refid');
+ set_session('refid', getConfig('def_refid'));
} else {
// Use the refid here
$_POST['refid'] = $GLOBALS['refid'];
} // END - if
// Is the password long enouth?
- if ((strlen($_POST['pass1']) < $_CONFIG['pass_len']) && (!$FAILED)) {
+ if ((strlen($_POST['pass1']) < getConfig('pass_len')) && (!$FAILED)) {
$SHORT_PASS = true;
$FAILED = true;
} // END - if
if ($answer == "Y") $cats++;
} // END - foreach
- if ($cats < $_CONFIG['least_cats']) {
+ if ($cats < getConfig('least_cats')) {
// ... nope!
$FAILED = true;
} // END - if
} // END - if
- if (($_POST['addy'] != "!") && ($_CONFIG['check_double_email'] == "Y")) {
+ if (($_POST['addy'] != "!") && (getConfig('check_double_email') == "Y")) {
// Does the email address already exists in our database?
$CHK = SEARCH_EMAIL_USERTAB($_POST['addy']);
if ($CHK) { $_POST['addy'] = "?"; $FAILED = true; }
} // END - if
// Check for IP timeout?
- if ($_CONFIG['ip_timeout'] > 0) {
+ if (getConfig('ip_timeout') > 0) {
// Check his IP number
$result = SQL_QUERY_ESC("SELECT joined, last_update FROM `"._MYSQL_PREFIX."_user_data` WHERE REMOTE_ADDR='%s' AND (joined > (UNIX_TIMESTAMP() - %s) OR last_update > (UNIX_TIMESTAMP() - %s)) LIMIT 1",
- array(GET_REMOTE_ADDR(), $_CONFIG['ip_timeout'], $_CONFIG['ip_timeout']), __FILE__, __LINE__);
+ array(GET_REMOTE_ADDR(), getConfig('ip_timeout'), getConfig('ip_timeout')), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Same IP in timeout range and different email address entered... Eat this, faker! ;-)
// But admins are allowed to fake their own exchange service.
// First comes first: begging rallye
if (GET_EXT_VERSION("beg") >= "0.1.7") {
// Okay, shall I disable now?
- if ($_CONFIG['beg_new_mem_notify'] == "N") {
+ if (getConfig('beg_new_mem_notify') == "N") {
$ADD1 .= ", beg_ral_notify, beg_ral_en_notify";
$ADD2 .= ", UNIX_TIMESTAMP(), UNIX_TIMESTAMP()";
} // END - if
// Second: active rallye
if (GET_EXT_VERSION("bonus") >= "0.7.7") {
// Okay, shall I disable now?
- if ($_CONFIG['bonus_new_mem_notify'] == "N") {
+ if (getConfig('bonus_new_mem_notify') == "N") {
$ADD1 .= ", bonus_ral_notify, bonus_ral_en_notify";
$ADD2 .= ", UNIX_TIMESTAMP(), UNIX_TIMESTAMP()";
} // END - if
if (SQL_NUMROWS($result) == 0) {
// Add only when the line was not found (maybe some more secure?)
$locked = "points";
- if ($_CONFIG['ref_payout'] > 0) $locked = "locked_points"; // Pay him later. First he has to confirm some mails!
+ if (getConfig('ref_payout') > 0) $locked = "locked_points"; // Pay him later. First he has to confirm some mails!
$result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_points (userid, ref_depth, ".$locked.") VALUES (%s,0,'%s')",
- array(bigintval($userid), $_CONFIG['points_register']), __FILE__, __LINE__);
+ array(bigintval($userid), getConfig('points_register')), __FILE__, __LINE__);
// Update mediadata as well
if ((GET_EXT_VERSION("mediadata") >= "0.0.4") && ($locked == "points")) {
// Update database
- MEDIA_UPDATE_ENTRY(array("total_points"), "add", $_CONFIG['points_register']);
+ MEDIA_UPDATE_ENTRY(array("total_points"), "add", getConfig('points_register'));
} // END - if
} // END - if
}
if ($SHORT_PASS) {
- OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".SHORT_PASS.": ".$_CONFIG['pass_len']."</SPAN></STRONG><br /><br />");
+ OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".SHORT_PASS.": ".getConfig('pass_len')."</SPAN></STRONG><br /><br />");
} // END - if
if ($IP_TIMEOUT) {
OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".REMOTE_ADDR_TIMEOUT."</SPAN></STRONG><br /><br />");
} // END - if
- if ((!empty($cats)) && ($cats < $_CONFIG['least_cats'])) {
- OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".CATS_LEAST.": ".$_CONFIG['least_cats']."</SPAN></STRONG><br /><br />");
+ if ((!empty($cats)) && ($cats < getConfig('least_cats'))) {
+ OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".CATS_LEAST.": ".getConfig('least_cats')."</SPAN></STRONG><br /><br />");
} // END - if
// Generate birthday selection
define('MAX_RECEIVE_LIST', ADD_MAX_RECEIVE_LIST("guest", "", true));
// Shall I display the refid or shall I make it editable?
- if ($_CONFIG['display_refid'] == "Y") {
+ if (getConfig('display_refid') == "Y") {
// Load "hide" form template
define('REFID_CONTENT', LOAD_TEMPLATE("guest_register_refid_hide", true, $GLOBALS['refid']));
} else {
define('REGISTER_HEADER_CONTENT', LOAD_TEMPLATE("register_header", true));
// Please select at least x categories
- define('LEAST_CATS_VALUE', $_CONFIG['least_cats']);
+ define('LEAST_CATS_VALUE', getConfig('least_cats'));
// Other values
define('__SURNAME', SQL_ESCAPE($_POST['surname']));
if ($status == "CONFIRMED") {
// Calculate cookie lifetime, maybe we have to change this so the admin can setup a
// seperate timeout for these two cookies?
- $life = (time() + $_CONFIG['online_timeout']);
+ $life = (time() + getConfig('online_timeout'));
// Is confirmed so both is fine and we can continue with login procedure
$login = ((setcookie("sponsorid" , bigintval($_POST['sponsorid']), $life, COOKIE_PATH)) &&
}
}
// Is the password long enough?
- elseif (strlen($_POST['pass1']) < $_CONFIG['pass_len'])
+ elseif (strlen($_POST['pass1']) < getConfig('pass_len'))
{
// Too short!
$FORM_ERRORS[] = SPONSOR_PASSWORD_TOO_SHORT;
}
// Check if he has accepted the terms&conditions
- if (empty($_POST['terms']))
- {
+ if (empty($_POST['terms'])) {
// Homepage URL is empty
$FORM_ERRORS[] = SPONSOR_TERMS_NOT_ACCEPTED;
}
if (count($FORM_ERRORS) > 0) unset($_POST['ok']);
}
-if ((isset($_POST['ok'])) && (count($FORM_ERRORS) == 0))
-{
+if ((isset($_POST['ok'])) && (count($FORM_ERRORS) == 0)) {
// Generate message array
$MSGs = array(
'failed' => SPONSOR_REGISTRATION_FAILED,
ADD_DESCR("guest", __FILE__);
// Derterminate which stats we want and set mode and title for the link below stats block
-if (!isset($_GET['mode'])) $_GET['mode'] = strtolower($_CONFIG['guest_stats']);
-switch ($_GET['mode'])
-{
- case "members": $_CONFIG['guest_stats'] = "MEMBERS"; $lmode = "modules"; $ltitle = GUEST_STATS_MODULES; break;
- case "modules": $_CONFIG['guest_stats'] = "MODULES"; $lmode = "members"; $ltitle = GUEST_STATS_MEMBERS; break;
+if (!isset($_GET['mode'])) $_GET['mode'] = strtolower(getConfig('guest_stats'));
+switch ($_GET['mode']) {
+ case "members" : $_CONFIG['guest_stats'] = "MEMBERS"; $lmode = "modules"; $ltitle = GUEST_STATS_MODULES; break;
+ case "modules" : $_CONFIG['guest_stats'] = "MODULES"; $lmode = "members"; $ltitle = GUEST_STATS_MEMBERS; break;
+ case "inactive": $_CONFIG['guest_stats'] = "INACTIVE"; $lmode = "inactive"; $ltitle = GUEST_STATS_INACTIVE; break;
}
-switch ($_CONFIG['guest_stats'])
+switch (getConfig('guest_stats'))
{
case "MEMBERS": // Statistics about your members
// Members yesterday / today online
$result = SQL_QUERY_ESC("SELECT userid, ".$ADD.", total_logins, last_online
FROM "._MYSQL_PREFIX."_user_data
WHERE total_logins>0 AND status='CONFIRMED' ORDER BY total_logins DESC LIMIT %s",
- array($_CONFIG['top10_max']), __FILE__, __LINE__);
+ array(getConfig('top10_max')), __FILE__, __LINE__);
$OUT = ""; $SW = 2; $cnt = 1;
while(list($uid, $nick, $logins, $last) = SQL_FETCHROW($result))
// Switch colors and count one up
$SW = 3 - $SW; $cnt++;
}
-if ($cnt < $_CONFIG['top10_max'])
+if ($cnt < getConfig('top10_max'))
{
// Add more "blank" rows
- for ($i = $cnt; $i <= $_CONFIG['top10_max']; $i++)
+ for ($i = $cnt; $i <= getConfig('top10_max'); $i++)
{
// Prepare data for template
$content = array(
GROUP BY p.userid
ORDER BY tpoints DESC, d.last_online DESC
LIMIT %s",
- array($_CONFIG['top10_max']), __FILE__, __LINE__);
+ array(getConfig('top10_max')), __FILE__, __LINE__);
$OUT = ""; $SW = 2; $cnt = 1;
while(list($uid, $nick, $points, $last) = SQL_FETCHROW($result))
// Switch colors and count one up
$SW = 3 - $SW; $cnt++;
}
-if ($cnt < $_CONFIG['top10_max'])
+if ($cnt < getConfig('top10_max'))
{
// Add more "blank" rows
- for ($i = $cnt; $i <= $_CONFIG['top10_max']; $i++)
+ for ($i = $cnt; $i <= getConfig('top10_max'); $i++)
{
// Prepare data for template
$content = array(
GROUP BY r.userid
ORDER BY refs DESC, d.last_online DESC
LIMIT %s",
- array($_CONFIG['top10_max']), __FILE__, __LINE__);
+ array(getConfig('top10_max')), __FILE__, __LINE__);
$OUT = ""; $SW = 2; $cnt = 1;
while(list($uid, $nick, $refs, $last) = SQL_FETCHROW($result))
// Switch colors and count one up
$SW = 3 - $SW; $cnt++;
}
-if ($cnt < $_CONFIG['top10_max'])
+if ($cnt < getConfig('top10_max'))
{
// Add more "blank" rows
- for ($i = $cnt; $i <= $_CONFIG['top10_max']; $i++)
+ for ($i = $cnt; $i <= getConfig('top10_max'); $i++)
{
// Prepare data for template
$content = array(
define('__TOP_REFERRAL_ROWS', $OUT);
// Remember other values in constants
-define('__TOP10_MAX', $_CONFIG['top10_max']);
+define('__TOP10_MAX', getConfig('top10_max'));
// Load final template
LOAD_TEMPLATE("guest_top10");
// Prepare content
$content = array(
- 'register' => TRANSLATE_COMMA($_CONFIG['points_register']),
+ 'register' => TRANSLATE_COMMA(getConfig('points_register')),
'ref_levels' => $cnt,
- 'ref_points' => TRANSLATE_COMMA($_CONFIG['points_ref'])
+ 'ref_points' => TRANSLATE_COMMA(getConfig('points_ref'))
);
// Load default template
array(
'textinput' => "hidden",
'sitelink' => "http://www.wds66.com",
- 'refid' => bigintval($_CONFIG['wernis_refid']),
+ 'refid' => bigintval(getConfig('wernis_refid')),
'reflink' => "/ref.php?refid=",
)
);
// Use proxy?
-if ((!empty($_CONFIG['proxy_host'])) && (!empty($_CONFIG['proxy_port']))) {
+if ((getConfig('proxy_host') != "") && (getConfig('proxy_port') > 0)) {
// Set proxy data
- $rdf->set_proxy($_CONFIG['proxy_host'], $_CONFIG['proxy_port']);
+ $rdf->set_proxy(getConfig('proxy_host'), getConfig('proxy_port'));
// Use auth?
- if (!empty($_CONFIG['proxy_username'])) {
+ if (getConfig('proxy_username') != "") {
// Set auth data
- $rdf->set_proxy_auth($_CONFIG['proxy_username'], $_CONFIG['proxy_password']);
+ $rdf->set_proxy_auth(getConfig('proxy_username'), getConfig('proxy_password'));
} // END - if
} // END - if
LOAD_TEMPLATE("guest_menu_td");
// When no what value is provided take the "home" value
-if (empty($GLOBALS['what'])) $GLOBALS['what'] = $_CONFIG['index_home'];
+if (empty($GLOBALS['what'])) $GLOBALS['what'] = getConfig('index_home');
// Adding the main content module here
if (empty($GLOBALS['action'])) {
}
// Add the guest's menu here...
-if (($_CONFIG['guest_menu'] == "Y") || (!EXT_IS_ACTIVE("sql_patches", true))) {
+if ((getConfig('guest_menu') == "Y") || (!EXT_IS_ACTIVE("sql_patches", true))) {
// Show only when guest menu is active
ADD_MENU("guest", $act, $GLOBALS['what']);
} // END - if
LOAD_URL("modules.php?module=index");
}
-if (($_CONFIG['guest_menu'] == "Y") || (!EXT_IS_ACTIVE("sql_patches", true))) {
+if ((getConfig('guest_menu') == "Y") || (!EXT_IS_ACTIVE("sql_patches", true))) {
// Right side of content (hint: a good place for 120x600 skyscraper banner!)
LOAD_TEMPLATE("guest_content_footer");
}
// Add the member's menu here...
-if (($_CONFIG['member_menu'] == "Y") || (!EXT_IS_ACTIVE("sql_patches", true))) {
+if ((getConfig('member_menu') == "Y") || (!EXT_IS_ACTIVE("sql_patches", true))) {
ADD_MENU("member", GET_ACTION("member", $GLOBALS['what']), $GLOBALS['what']);
} // END - if
LOAD_URL("modules.php?module=login");
}
-if (($_CONFIG['member_menu'] == "Y") || (!EXT_IS_ACTIVE("sql_patches", true))) {
+if ((getConfig('member_menu') == "Y") || (!EXT_IS_ACTIVE("sql_patches", true))) {
// Right side of content (hint: a good place for 120x600 skyscraper banner!)
LOAD_TEMPLATE("member_content_right");
// Prepare constants
define('__BEG_UID' , $uid);
define('__BEG_CLICKS' , $clicks);
-define('__BEG_POINTS' , TRANSLATE_COMMA($_CONFIG['beg_points']));
-define('__BEG_POINTS_MAX', TRANSLATE_COMMA($_CONFIG['beg_points_max']));
+define('__BEG_POINTS' , TRANSLATE_COMMA(getConfig('beg_points')));
+define('__BEG_POINTS_MAX', TRANSLATE_COMMA(getConfig('beg_points_max')));
if (function_exists('CREATE_FANCY_TIME'))
{
- define('__BEG_TIMEOUT' , CREATE_FANCY_TIME($_CONFIG['beg_timeout']));
- define('__BEG_UID_TIMEOUT', CREATE_FANCY_TIME($_CONFIG['beg_uid_timeout']));
+ define('__BEG_TIMEOUT' , CREATE_FANCY_TIME(getConfig('beg_timeout')));
+ define('__BEG_UID_TIMEOUT', CREATE_FANCY_TIME(getConfig('beg_uid_timeout')));
}
else
{
- define('__BEG_TIMEOUT ' , round($_CONFIG['beg_timeout'] / 60)." ".MINUTES);
- define('__BEG_UID_TIMEOUT', round($_CONFIG['beg_uid_timeout'] / 60)." ".MINUTES);
+ define('__BEG_TIMEOUT ' , round(getConfig('beg_timeout') / 60)." ".MINUTES);
+ define('__BEG_UID_TIMEOUT', round(getConfig('beg_uid_timeout') / 60)." ".MINUTES);
}
// Load template
if (EXT_IS_ACTIVE("autopurge")) {
// Use last online timestamp to keep inactive members away from here
$LAST = " AND last_online >= (UNIX_TIMESTAMP() - %s)";
- $ONLINE = $_CONFIG['ap_inactive_since'];
+ $ONLINE = getConfig('ap_inactive_since');
}
// Let's check if there are some points left we can "pay"...
$result = SQL_QUERY_ESC("SELECT userid, beg_points AS beg, last_online FROM "._MYSQL_PREFIX."_user_data
WHERE beg_points > 0 AND status='CONFIRMED'".$LAST."
ORDER BY beg_points DESC, last_online DESC, userid LIMIT %s",
- array($ONLINE, $_CONFIG['beg_ranks']), __FILE__, __LINE__);
+ array($ONLINE, getConfig('beg_ranks')), __FILE__, __LINE__);
// Reset temporary variable and check for users
$OUT = "";
-if (SQL_NUMROWS($result) > 0)
-{
+if (SQL_NUMROWS($result) > 0) {
// Load our winners...
$SW = 2; $cnt = 1;
- while(list($uid, $turbo, $last) = SQL_FETCHROW($result))
- {
+ while(list($uid, $turbo, $last) = SQL_FETCHROW($result)) {
// Prepare data for the template
$content = array(
'sw' => $SW,
// Count one up and switch colors
$cnt++;$SW = 3 - $SW;
}
-}
- else
-{
+} else {
// No one is interested in our "active rallye" ! :-(
$OUT = LOAD_TEMPLATE("member_beg_404", true);
}
{
// Add more bonus points here
$USE = "(0";
- if ($_CONFIG['bonus_click_yn'] == "Y") $USE .= " + turbo_bonus";
- if ($_CONFIG['bonus_login_yn'] == "Y") $USE .= " + login_bonus";
- if ($_CONFIG['bonus_order_yn'] == "Y") $USE .= " + bonus_order";
- if ($_CONFIG['bonus_stats_yn'] == "Y") $USE .= " + bonus_stats";
- if ($_CONFIG['bonus_ref_yn'] == "Y") $USE .= " + bonus_ref";
+ if (getConfig('bonus_click_yn') == "Y") $USE .= " + turbo_bonus";
+ if (getConfig('bonus_login_yn') == "Y") $USE .= " + login_bonus";
+ if (getConfig('bonus_order_yn') == "Y") $USE .= " + bonus_order";
+ if (getConfig('bonus_stats_yn') == "Y") $USE .= " + bonus_stats";
+ if (getConfig('bonus_ref_yn') == "Y") $USE .= " + bonus_ref";
$USE .= ")";
}
else
if (EXT_IS_ACTIVE("autopurge")) {
// Use last online timestamp to keep inactive members away from here
$LAST = " AND last_online >= (UNIX_TIMESTAMP() - %s)";
- $ONLINE = $_CONFIG['ap_inactive_since'];
+ $ONLINE = getConfig('ap_inactive_since');
}
// Let's check if there are some points left we can "pay"...
WHERE ".$USE." > 0 AND status='CONFIRMED'".$LAST."
ORDER BY points DESC, last_online DESC, userid
LIMIT %s",
- array($ONLINE, $_CONFIG['bonus_ranks']), __FILE__, __LINE__);
+ array($ONLINE, getConfig('bonus_ranks')), __FILE__, __LINE__);
// Reset temporary variable and check for users
$OUT = "";
{
if ($joined == "N") $cnt++;
}
- if (($cats - $cnt) < $_CONFIG['least_cats'])
+ if (($cats - $cnt) < getConfig('least_cats'))
{
unset($_POST['ok']);
$LEAST = true;
{
switch ($joined)
{
- case 'Y':
+ case "Y":
$sql = "";
$result_user = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_cats WHERE userid=%s AND cat_id=%s LIMIT 1",
array($UID, bigintval($cat)), __FILE__, __LINE__);
}
break;
- case 'N':
+ case "N":
$sql = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_cats WHERE userid=%s AND cat_id=%s LIMIT 1";
break;
}
if ($LEAST)
{
// Also here we have to secure it... :(
- LOAD_TEMPLATE("admin_settings_saved", true, CATS_LEAST.": ".$_CONFIG['least_cats']);
+ LOAD_TEMPLATE("admin_settings_saved", true, CATS_LEAST.": ".getConfig('least_cats'));
}
// Put some data into constants for the template
define('__ROWS', ($cats*2+4));
ADD_DESCR("member", __FILE__);
// Percent values etc.
-define('__CHARGE_VALUE', TRANSLATE_COMMA($_CONFIG['doubler_charge'] * 100));
-define('__REF_VALUE' , TRANSLATE_COMMA($_CONFIG['doubler_ref'] * 100));
-define('__TOTAL_VALUE' , TRANSLATE_COMMA($_CONFIG['doubler_points']));
-define('__MIN_VALUE' , TRANSLATE_COMMA($_CONFIG['doubler_min']));
-define('__MAX_VALUE' , TRANSLATE_COMMA($_CONFIG['doubler_max']));
+define('__CHARGE_VALUE', TRANSLATE_COMMA(getConfig('doubler_charge') * 100));
+define('__REF_VALUE' , TRANSLATE_COMMA(getConfig('doubler_ref') * 100));
+define('__TOTAL_VALUE' , TRANSLATE_COMMA(getConfig('doubler_points')));
+define('__MIN_VALUE' , TRANSLATE_COMMA(getConfig('doubler_min')));
+define('__MAX_VALUE' , TRANSLATE_COMMA(getConfig('doubler_max')));
// Transfer referal ID
if (EXT_IS_ACTIVE("nickname"))
}
// Usage counter
-define('__DOUBLER_COUNTER', $_CONFIG['doubler_counter']);
+define('__DOUBLER_COUNTER', getConfig('doubler_counter'));
// Which mail-send-mode did the admin setup?
-switch ($_CONFIG['doubler_send_mode'])
+switch (getConfig('doubler_send_mode'))
{
case "DIRECT":
define('DOUBLER_PAYOUT_TIME', DOUBLER_PAYOUT_TIME_DIRECT);
define('__DOUBLER_PAYOUT_REF', DOUBLER_GENERATE_TABLE($GLOBALS['userid'], "N", "Y", "DESC"));
// Generate timemark
-define('__TIMEOUT_MARK', CREATE_FANCY_TIME($_CONFIG['doubler_timeout']));
+define('__TIMEOUT_MARK', CREATE_FANCY_TIME(getConfig('doubler_timeout')));
// Points left to double
define('__LEFT_VALUE', DOUBLER_GET_TOTAL_POINTS_LEFT());
if (empty($stamp1)) $stamp1 = 0;
if (empty($stamp2)) $stamp2 = 0;
- if ((($stamp1 + $_CONFIG['holiday_lock']) > time()) || (($stamp2 + $_CONFIG['holiday_lock']) > time()))
+ if ((($stamp1 + getConfig('holiday_lock')) > time()) || (($stamp2 + getConfig('holiday_lock')) > time()))
{
// Mail order is to close away!
unset($_POST['ok']);
unset($_POST['stop']);
- if (($stamp1 + $_CONFIG['holiday_lock']) > time())
+ if (($stamp1 + getConfig('holiday_lock')) > time())
{
// Mail found in pool
$stamp = $stamp1;
// Test both values
$TEST = $END - $START;
- if (($TEST < 0) || ($TEST > ($_CONFIG['one_day'] * $_CONFIG['holiday_max'])) || ($START < time()) || ($END < time()))
+ if (($TEST < 0) || ($TEST > (getConfig('one_day') * getConfig('holiday_max'))) || ($START < time()) || ($END < time()))
{
// Time test failed
unset($_POST['ok']);
list($active, $locked) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
- if (($active == "Y") && (($locked + $_CONFIG['holiday_lock']) < time()))
+ if (($active == "Y") && (($locked + getConfig('holiday_lock')) < time()))
{
// Load data
$result = SQL_QUERY_ESC("SELECT holiday_start, holiday_end FROM "._MYSQL_PREFIX."_user_holidays
SQL_FREERESULT($result);
// Check for lock
- if (($locked + $_CONFIG['holiday_lock']) < time())
+ if (($locked + getConfig('holiday_lock')) < time())
{
// User can deactivate his holiday request
switch ($active)
{
- case 'Y': // Display deactivation form
+ case "Y": // Display deactivation form
// Load starting and ending date
$result = SQL_QUERY_ESC("SELECT holiday_start, holiday_end FROM "._MYSQL_PREFIX."_user_holidays
WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__);
}
break;
- case 'N': // Display activation form
+ case "N": // Display activation form
// Starting day
- define('_START_DAY' , ADD_SELECTION("day" , date("d", (time() + $_CONFIG['one_day'])), "start"));
- define('_START_MONTH', ADD_SELECTION("month", date("m", (time() + $_CONFIG['one_day'])), "start"));
- define('_START_YEAR' , ADD_SELECTION("year" , date('Y', (time() + $_CONFIG['one_day'])), "start"));
+ define('_START_DAY' , ADD_SELECTION("day" , date("d", (time() + getConfig('one_day'))), "start"));
+ define('_START_MONTH', ADD_SELECTION("month", date("m", (time() + getConfig('one_day'))), "start"));
+ define('_START_YEAR' , ADD_SELECTION("year" , date('Y', (time() + getConfig('one_day'))), "start"));
// Calcualte ending date
- $D = date("d", time() + $_CONFIG['one_day'] + ($_CONFIG['one_day'] * $_CONFIG['holiday_max']));
- $M = date("m", time() + $_CONFIG['one_day'] + ($_CONFIG['one_day'] * $_CONFIG['holiday_max']));
- $Y = date('Y', time() + $_CONFIG['one_day'] + ($_CONFIG['one_day'] * $_CONFIG['holiday_max']));
+ $D = date("d", time() + getConfig('one_day') + (getConfig('one_day') * getConfig('holiday_max')));
+ $M = date("m", time() + getConfig('one_day') + (getConfig('one_day') * getConfig('holiday_max')));
+ $Y = date('Y', time() + getConfig('one_day') + (getConfig('one_day') * getConfig('holiday_max')));
// Ending day
define('_END_DAY' , ADD_SELECTION("day" , $D, "end"));
define('_END_YEAR' , ADD_SELECTION("year" , $Y, "end"));
// Copy value from configuration
- define('__HOLIDAY_MAX', $_CONFIG['holiday_max']);
+ define('__HOLIDAY_MAX', getConfig('holiday_max'));
// Output form
LOAD_TEMPLATE("member_holiday_form");
$DATA[13] = MAKE_DATETIME($DATA[13], "0");
// How far is last change on his profile away from now?
- if ((($DATA[13] + $_CONFIG['profile_lock']) > time()) && (!IS_ADMIN()) && ($_CONFIG['profile_lock'] > 0))
+ if ((($DATA[13] + getConfig('profile_lock')) > time()) && (!IS_ADMIN()) && (getConfig('profile_lock') > 0))
{
// You cannot change your account
- define('CHANGE', "<FONT class=\"member_failed\">".MEMBER_PROFILE_LOCKED_1.MAKE_DATETIME($DATA[13] + $_CONFIG['profile_lock'], "0").MEMBER_PROFILE_LOCKED_2."</FONT>");
+ define('CHANGE', "<FONT class=\"member_failed\">".MEMBER_PROFILE_LOCKED_1.MAKE_DATETIME($DATA[13] + getConfig('profile_lock'), "0").MEMBER_PROFILE_LOCKED_2."</FONT>");
}
else
{
$DATA = SQL_FETCHROW($result);
SQL_FREERESULT($result);
- $DATA[13] = $DATA[12] + $_CONFIG['profile_lock'];
+ $DATA[13] = $DATA[12] + getConfig('profile_lock');
// How far is last change on his profile away from now?
- if (($DATA[13] > time()) && (!IS_ADMIN()) && ($_CONFIG['profile_lock'] > 0))
+ if (($DATA[13] > time()) && (!IS_ADMIN()) && (getConfig('profile_lock') > 0))
{
- $DATA[13] = MAKE_DATETIME($DATA[13] + $_CONFIG['profile_lock'], "0");
+ $DATA[13] = MAKE_DATETIME($DATA[13] + getConfig('profile_lock'), "0");
// You cannot change your account
LOAD_TEMPLATE("member_mydata_locked");
}
array(UID_VALUE), __FILE__, __LINE__);
$DATA = SQL_FETCHROW($result);
SQL_FREERESULT($result);
- $DATA[3] = $DATA[2] + $_CONFIG['profile_lock'];
+ $DATA[3] = $DATA[2] + getConfig('profile_lock');
// How far is last change on his profile away from now?
- if (($DATA[3] > time()) && (!IS_ADMIN()) && ($_CONFIG['profile_lock'] > 0)) {
- $DATA[3] = MAKE_DATETIME($DATA[3] + $_CONFIG['profile_lock'], "0");
+ if (($DATA[3] > time()) && (!IS_ADMIN()) && (getConfig('profile_lock') > 0)) {
+ $DATA[3] = MAKE_DATETIME($DATA[3] + getConfig('profile_lock'), "0");
// You cannot change your account
LOAD_TEMPLATE("member_mydata_locked");
} elseif (!VALIDATE_EMAIL($_POST['addy'])) {
SQL_FREERESULT($result);
// Remember charge value
-define('__CHARGE_VALUE', TRANSLATE_COMMA($_CONFIG['nl_charge']));
+define('__CHARGE_VALUE', TRANSLATE_COMMA(getConfig('nl_charge')));
if ((isset($_POST['ok'])) && ($status == "Y") && ($span == "0"))
{
// Save request
- $result = SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_user_data` SET nl_timespan='".($_CONFIG['one_day'] * 30)."' WHERE userid=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_user_data` SET nl_timespan='".(getConfig('one_day') * 30)."' WHERE userid=%s LIMIT 1",
array($GLOBALS['userid']), __FILE__, __LINE__);
// Load admin message
// Set status message and submit button
switch ($status)
{
- case 'Y': // Receives the newsletter
+ case "Y": // Receives the newsletter
define('__STATUS_VALUE', NL_MEMBER_ON);
define('__UNTIL_VALUE', "");
define('NL_SUBMIT', NL_MEMBER_SUBMIT_OFF);
break;
- case 'N': // Does not receive the newsletter
+ case "N": // Does not receive the newsletter
define('__STATUS_VALUE', NL_MEMBER_OFF);
define('__UNTIL_VALUE', MAKE_DATETIME($until, "2"));
define('NL_SUBMIT', NL_MEMBER_SUBMIT_ON);
if (IS_ADMIN()) $whereStatement = "";
// Minimum mails / order
-define('__MIN_VALUE', $_CONFIG['order_min']);
+define('__MIN_VALUE', getConfig('order_min'));
// Count unconfirmed mails
$result_links = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_links WHERE userid=%s",
if ($HOLIDAY == $DMY) $HOLIDAY='N';
$ALLOWED = $MAXI - $ORDERS;
-if ($_CONFIG['order_max_full'] == "MAX") $ALLOWED = $MAXI;
+if (getConfig('order_max_full') == "MAX") $ALLOWED = $MAXI;
// Check HTML extension
$HTML_EXT = EXT_IS_ACTIVE("html_mail");
$result = SQL_QUERY_ESC("SELECT id, data_type
FROM "._MYSQL_PREFIX."_pool
WHERE sender=%s AND url='%s' AND timestamp > (UNIX_TIMESTAMP() - %s) LIMIT 1",
- array($GLOBALS['userid'], $_POST['url'], $_CONFIG['url_tlock']), __FILE__, __LINE__);
+ array($GLOBALS['userid'], $_POST['url'], getConfig('url_tlock')), __FILE__, __LINE__);
$type = "TEMP"; $id = 0;
if (SQL_NUMROWS($result) == 1) {
// No entry found, so we need to check out the stats table as well... :)
// We have to add that suff here, now we continue WITHOUT checking and check the text and subject against some filters
$URL = "";
- if ($_CONFIG['test_text'] == "Y") {
+ if (getConfig('test_text') == "Y") {
// Test submitted text against some filters (length, URLs in text etc.)
if ((strpos(strtolower($_POST['text']), "https://") > -1) || (strpos(strtolower($_POST['text']), "http://") > -1) || (strpos(strtolower($_POST['text']), "www") > -1)) {
// URL found!
$TEST = str_replace("\n", "", str_replace("\r", "", $_POST['text']));
// Text length within allowed length?
- if (strlen($TEST) > $_CONFIG['max_tlength']) {
+ if (strlen($TEST) > getConfig('max_tlength')) {
// Text is too long!
$URL = URL."/modules.php?module=login&what=order&msg=".CODE_OVERLENGTH;
} // END - if
} // END - if
// Shall I test the subject line against URLs?
- if ($_CONFIG['test_subj'] == "Y") {
+ if (getConfig('test_subj') == "Y") {
// Check the subject line for issues
$_POST['subject'] = str_replace("\\", "[nl]", substr($_POST['subject'], 0, 200));
if ((strpos(strtolower($_POST['subject']), "http://") > -1) || (strpos(strtolower($_POST['subject']), "www") > -1)) {
} // END - if
// And shall I check that his URL is not in the black list?
- if ($_CONFIG['url_blacklist'] == "Y") {
+ if (getConfig('url_blacklist') == "Y") {
// Ok, I do that for you know...
$result = SQL_QUERY_ESC("SELECT timestamp FROM "._MYSQL_PREFIX."_url_blist WHERE url='%s' LIMIT 1",
array($_POST['url']), __FILE__, __LINE__);
} // END - if
// Enougth receivers entered?
- if (($_POST['receiver'] < $_CONFIG['order_min']) && (!IS_ADMIN())) {
+ if (($_POST['receiver'] < getConfig('order_min')) && (!IS_ADMIN())) {
// Less than allowed receivers entered!
$URL = URL."/modules.php?module=login&what=order&msg=".CODE_MORE_RECEIVERS3;
} // END - if
if (empty($URL)) {
// Check if category and number of receivers is okay
$ADD = "";
- if (($_CONFIG['order_multi_page'] == "Y") && (!empty($_POST['zip']))) {
+ if ((getConfig('order_multi_page') == "Y") && (!empty($_POST['zip']))) {
// Choose recipients by ZIP code
$ADD = " AND d.zip LIKE '".bigintval($_POST['zip'])."{PER}'";
} // END - if
array(
bigintval($_POST['cat']),
$GLOBALS['userid'],
- $_CONFIG['order_select'],
- $_CONFIG['order_mode'],
+ getConfig('order_select'),
+ getConfig('order_mode'),
), __FILE__, __LINE__);
// Do we enougth receivers left?
} elseif ($_POST['receiver'] == "0") {
// Not enougth receivers selected
$URL = URL."/modules.php?module=login&what=order&msg=".CODE_MORE_RECEIVERS1;
-} elseif (($ALLOWED == 0) && ($_CONFIG['order_max_full'] == "ORDER")) {
+} elseif (($ALLOWED == 0) && (getConfig('order_max_full') == "ORDER")) {
// No more mail orders allowed
LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_ORDER_ALLOWED_EXHAUSTED);
-} elseif (($links < $_CONFIG['unconfirmed']) && ($mmails == "1")) {
+} elseif (($links < getConfig('unconfirmed')) && ($mmails == "1")) {
// Display order form
$result_cats = SQL_QUERY("SELECT id, cat FROM "._MYSQL_PREFIX."_cats".$whereStatement." ORDER BY sort", __FILE__, __LINE__);
if (SQL_NUMROWS($result_cats) > 0) {
$result_ver = SQL_QUERY_ESC("SELECT zip FROM `"._MYSQL_PREFIX."_user_data` WHERE userid=%s".$HTML." AND receive_mails > 0 AND status='CONFIRMED' LIMIT 1",
array(bigintval($ucat)), __FILE__, __LINE__);
- if ((SQL_NUMROWS($result_ver) == 1) && (!empty($_POST['zip'])) && ($_CONFIG['order_multi_page'] == "Y")) {
+ if ((SQL_NUMROWS($result_ver) == 1) && (!empty($_POST['zip'])) && (getConfig('order_multi_page') == "Y")) {
list($zip) = SQL_FETCHROW($result_ver);
SQL_FREERESULT($result_ver);
if (substr($zip, 0, strlen($_POST['zip'])) == $_POST['zip']) {
SQL_FREERESULT($result);
// Calculate hours...
- $STD = round($_CONFIG['url_tlock'] / 60 / 60);
+ $STD = round(getConfig('url_tlock') / 60 / 60);
// Minutes...
- $MIN = round(($_CONFIG['url_tlock'] - $STD * 60 * 60) / 60);
+ $MIN = round((getConfig('url_tlock') - $STD * 60 * 60) / 60);
// And seconds
- $SEC = $_CONFIG['url_tlock'] - $STD * 60 * 60 - $MIN * 60;
+ $SEC = getConfig('url_tlock') - $STD * 60 * 60 - $MIN * 60;
// Finally contruct the message
$MSG = MEMBER_URL_TIME_LOCK."<br />".CONFIG_URL_TLOCK." ".$STD." ".
break;
case CODE_MORE_RECEIVERS3:
- $MSG = MEMBER_ENTER_MORE_MIN_RECEIVERS_1.$_CONFIG['order_min'].MEMBER_ENTER_MORE_MIN_RECEIVERS_2;
+ $MSG = MEMBER_ENTER_MORE_MIN_RECEIVERS_1.getConfig('order_min').MEMBER_ENTER_MORE_MIN_RECEIVERS_2;
break;
case CODE_INVALID_URL:
$TOTAL = TRANSLATE_COMMA($TOTAL);
// Check how many mail orders he has placed today and how many he's allowed to send
- switch ($_CONFIG['order_max_full'])
+ switch (getConfig('order_max_full'))
{
case "MAX": // He is allowed to send as much as possible
define('ORDER_MAX_VALUE', ORDER_ALLOED_MAX);
break;
default: // Unknown/invalid
- DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown order_mas_full config detected.", $_CONFIG['order_max_full']));
+ DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown order_mas_full config detected.", getConfig('order_max_full')));
define('ORDER_MAX_VALUE', ORDER_ALLOED_UNKNOWN);
break;
}
}
// 01 2 21 12 2 23 443 3 3210
- if ((!empty($_POST['data'])) || (($_CONFIG['order_multi_page'] == "N") && ((!IS_ADMIN()) && (!$HTML_EXT)))) {
+ if ((!empty($_POST['data'])) || ((getConfig('order_multi_page') == "N") && ((!IS_ADMIN()) && (!$HTML_EXT)))) {
// Pre-output categories
$CAT = "";
foreach ($CATS['id'] as $key => $value) {
$ADD = "";
if ($HTML_EXT) {
// Add some content when html extension is active
- if (($_CONFIG['order_multi_page'] == "Y") || (IS_ADMIN())) $ADD = "<TR><TD colspan=\"2\" class=\"seperator bottom2\" height=\"5\"> </TD></TR>\n";
+ if ((getConfig('order_multi_page') == "Y") || (IS_ADMIN())) $ADD = "<TR><TD colspan=\"2\" class=\"seperator bottom2\" height=\"5\"> </TD></TR>\n";
define('MEMBER_HTML_EXTENSION', LOAD_TEMPLATE("member_order-html_intro", true));
} else {
// No HTML extension installed
}
// Do we want ZIP code or not?
- if (($_CONFIG['order_multi_page'] == "Y") || (IS_ADMIN())) {
+ if ((getConfig('order_multi_page') == "Y") || (IS_ADMIN())) {
// Yes
$content = array(
- 'zip' => $_POST['zip'],
+ 'zip' => bigintval($_POST['zip']),
'add' => $ADD
);
define('MEMBER_ZIP_CONTENT', LOAD_TEMPLATE("member_order-zip1", true, $content));
LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_HAS_ZERO_MMAILS);
} else {
// Please confirm some mails first!
- LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_LINKS_LEFT_1.$links.MEMBER_LINKS_LEFT_2.$_CONFIG['unconfirmed'].MEMBER_LINKS_LEFT_3);
+ LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_LINKS_LEFT_1.$links.MEMBER_LINKS_LEFT_2.getConfig('unconfirmed').MEMBER_LINKS_LEFT_3);
}
if (!empty($URL)) {
$result_depths = SQL_QUERY("SELECT level, percents FROM "._MYSQL_PREFIX."_refdepths ORDER BY level", __FILE__, __LINE__);
$TPTS = 0;
-while (list($lvl, $per) = SQL_FETCHROW($result_depths))
-{
+while (list($lvl, $per) = SQL_FETCHROW($result_depths)) {
// Load referal points
$result_points = SQL_QUERY_ESC("SELECT points FROM "._MYSQL_PREFIX."_user_points WHERE userid=%s AND ref_depth=%d LIMIT 1",
- array($GLOBALS['userid'], bigintval($lvl)), __FILE__, __LINE__);
- if (SQL_NUMROWS($result_points) == 1)
- {
+ array($GLOBALS['userid'], bigintval($lvl)), __FILE__, __LINE__);
+
+ // Entry found?
+ if (SQL_NUMROWS($result_points) == 1) {
+ // Load points
list($points) = SQL_FETCHROW($result_points);
- SQL_FREERESULT($result_points);
+
+ // Add them to total
$TPTS += $points;
}
+
+ // Free result
+ SQL_FREERESULT($result_points);
}
// Free memory
define('__TLOCK_VALUE', TRANSLATE_COMMA($TLOCK));
// Fixes a bug when there is no bonus extension installed
-if (EXT_VERSION_IS_OLDER("bonus", "0.4.4")) $_CONFIG['bonus_active'] = "X";
+if (EXT_VERSION_IS_OLDER("bonus", "0.4.4")) getConfig('bonus_active') = "X";
// Display login bonus and turbo-click bonus
-if ((GET_EXT_VERSION("bonus") >= "0.2.2") && (EXT_IS_ACTIVE("bonus")) && ($_CONFIG['bonus_active'] == "Y")) {
+if ((GET_EXT_VERSION("bonus") >= "0.2.2") && (EXT_IS_ACTIVE("bonus")) && (getConfig('bonus_active') == "Y")) {
$ADD = ", 0, 0, 0";
if (GET_EXT_VERSION("bonus") >= "0.4.4") $ADD = ", bonus_ref, bonus_order, bonus_stats";
// Output rows
define('__SPECIAL_ROWS', LOAD_TEMPLATE("member_points_bonus_rows", true));
-} elseif ($_CONFIG['bonus_active'] == "N") {
+} elseif (getConfig('bonus_active') == "N") {
// Bonus active rallye deactivated
define('__SPECIAL_ROWS', LOAD_TEMPLATE("member_points_bonus_disabled", true));
} elseif ((IS_ADMIN()) && (EXT_VERSION_IS_OLDER("bonus", "0.2.2")) && (EXT_IS_ACTIVE("bonus"))) {
ADD_DESCR("member", __FILE__);
// Check if the admin has entered the data
-if ((empty($_CONFIG['primera_api_name'])) || (empty($_CONFIG['primera_api_md5']))) {
+if ((getConfig('primera_api_name') == "") || (getConfig('primera_api_md5') == "")) {
// Something important is missing...
LOAD_TEMPLATE("admin_settings_saved", false, PRIMERA_MEMBER_API_DATA_MISSING);
return;
// Is the mode set (payout only)
if (!isset($_GET['mode'])) {
// Get referal id
- $content['refid'] = bigintval($_CONFIG['primera_refid']);
+ $content['refid'] = bigintval(getConfig('primera_refid'));
// Get Primus id
$result = SQL_QUERY_ESC("SELECT primera_userid FROM `"._MYSQL_PREFIX."_user_data` WHERE userid=%s LIMIT 1",
// Are there some entries?
if (SQL_NUMROWS($result) == 1) {
// Fetch ID
- list($content['primus_nickname']) = SQL_FETCHROW($result);
+ list($content['primera_nickname']) = SQL_FETCHROW($result);
} // END - if
// Free result
SQL_FREERESULT($result);
// Is there an ID?
- if ((!empty($content['primus_nickname'])) && (!isset($_GET['mode']))) {
+ if ((!empty($content['primera_nickname'])) && (!isset($_GET['mode']))) {
// Then use an other "mode"
$_GET['mode'] = "list";
$points = bigintval($points[0]);
// Remove the registration fee
- $points = $points - $_CONFIG['points_register'];
+ $points = $points - getConfig('points_register');
// Is this enougth for a payout?
- if ($points < $_CONFIG['primera_min_payout']) {
+ if ($points < getConfig('primera_min_payout')) {
// No, then abort here
- LOAD_TEMPLATE("admin_settings_saved", false, sprintf(PRIMERA_MEMBER_MIN_PAYOUT_PAYOUT, TRANSLATE_COMMA($_CONFIG['primera_min_payout'])));
+ LOAD_TEMPLATE("admin_settings_saved", false, sprintf(PRIMERA_MEMBER_MIN_PAYOUT_PAYOUT, TRANSLATE_COMMA(getConfig('primera_min_payout'))));
return;
}
// Add points to content array
$content['points'] = $points;
- $content['min_points'] = TRANSLATE_COMMA($_CONFIG['primera_min_payout']);
+ $content['min_points'] = TRANSLATE_COMMA(getConfig('primera_min_payout'));
// Get Primera id
- $content['primus_nickname'] = "";
+ $content['primera_nickname'] = "";
$result = SQL_QUERY_ESC("SELECT primera_userid FROM `"._MYSQL_PREFIX."_user_data` WHERE userid=%s LIMIT 1",
array($GLOBALS['userid']), __FILE__, __LINE__);
// Are there some entries?
if (SQL_NUMROWS($result) == 1) {
// Fetch ID
- list($content['primus_nickname']) = SQL_FETCHROW($result);
+ list($content['primera_nickname']) = SQL_FETCHROW($result);
}
// Free result
switch ($_GET['mode']) {
case "pay": // Payout this exchange -> Primus
// Is the user ID and password set?
- if (empty($_POST['primus_nickname'])) {
+ if (empty($_POST['primera_nickname'])) {
// Nothing entered in Primus nickname
LOAD_TEMPLATE("admin_settings_saved", false, PRIMERA_MEMBER_EMPTY_USERNAME);
OUTPUT_HTML("<br />");
// Only numbers in amount!
LOAD_TEMPLATE("admin_settings_saved", false, PRIMERA_MEMBER_INVALID_AMOUNT);
OUTPUT_HTML("<br />");
- } elseif ($_POST['amount'] < $_CONFIG['primera_min_payout']) {
+ } elseif ($_POST['amount'] < getConfig('primera_min_payout')) {
// Not enougth entered!
- LOAD_TEMPLATE("admin_settings_saved", false, sprintf(PRIMERA_MEMBER_AMOUNT_SMALLER_MIN, bigintval($_CONFIG['primera_min_payout'])));
+ LOAD_TEMPLATE("admin_settings_saved", false, sprintf(PRIMERA_MEMBER_AMOUNT_SMALLER_MIN, bigintval(getConfig('primera_min_payout'))));
OUTPUT_HTML("<br />");
} elseif ($_POST['amount'] > $points) {
// Not enougth points left!
OUTPUT_HTML("<br />");
} else {
// All is fine here so do the payout
- $success = PRIMERA_EXECUTE_PAYOUT($_POST['primus_nickname'], md5($_POST['primera_password']), $_POST['amount']);
+ $success = PRIMERA_EXECUTE_PAYOUT($_POST['primera_nickname'], md5($_POST['primera_password']), $_POST['amount']);
if ($success) {
// Default is locked!
$locked = true;
// Shall I "pay" the referal points imidiately?
- if ($_CONFIG['ref_payout'] == "0") {
+ if (getConfig('ref_payout') == "0") {
// Yes, "pay" it now
$locked = false;
} // END - if
// Update primera nickname
$result = SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_user_data` SET `primera_userid`=%s WHERE userid=%s LIMIT 1",
- array($_POST['primus_nickname'], $GLOBALS['userid']), __FILE__, __LINE__);
+ array($_POST['primera_nickname'], $GLOBALS['userid']), __FILE__, __LINE__);
// All done!
LOAD_TEMPLATE("admin_settings_saved", false, PRIMERA_MEMBER_PAYOUT_DONE);
define('__RALLYE_EXTRAS', RALLYE_HAS_EXPIRED);
$expired = true;
}
- elseif (time() >= ($end - $_CONFIG['one_day']))
+ elseif (time() >= ($end - getConfig('one_day')))
{
// Rallye will expire in less one day!
define('__RALLYE_EXTRAS', RALLYE_EXPIRE_ONE_DAY);
}
// Is the refback system enabled?
-if ($_CONFIG['refback_enabled'] == "N") {
+if (getConfig('refback_enabled') == "N") {
// Output message
LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_REFBACK_DISABLED);
// Abort here
$percents = REVERT_COMMA($_POST['percents']);
// Validate percents
- if ((($percents >= $_CONFIG['refback_min_perc']) || (round($percents) == 0)) && ($percents <= $_CONFIG['refback_max_perc'])) {
+ if ((($percents >= getConfig('refback_min_perc')) || (round($percents) == 0)) && ($percents <= getConfig('refback_max_perc'))) {
// Change ref-back for this direct id
$status = REFBACK_CHANGE_MEMBER_PERCENTS($_POST['id'], $_POST['percents']);
}
} else {
// Percents out-of-bounds ;-)
- LOAD_TEMPLATE("admin_settings_saved", false, sprintf(MEMBER_REFBACK_ERROR_OUT_OF_BOUNDS, $_CONFIG['refback_min_perc'], $_CONFIG['refback_max_perc']));
+ LOAD_TEMPLATE("admin_settings_saved", false, sprintf(MEMBER_REFBACK_ERROR_OUT_OF_BOUNDS, getConfig('refback_min_perc'), getConfig('refback_max_perc')));
}
// Insert line
// Translate comma
$content['refback'] = TRANSLATE_COMMA($content['refback']);
- $content['min'] = TRANSLATE_COMMA($_CONFIG['refback_min_perc'].".0");
- $content['max'] = TRANSLATE_COMMA($_CONFIG['refback_max_perc'].".0");
+ $content['min'] = TRANSLATE_COMMA(getConfig('refback_min_perc').".0");
+ $content['max'] = TRANSLATE_COMMA(getConfig('refback_max_perc').".0");
// Load form for editing
LOAD_TEMPLATE("member_refback_edit", false, $content);
$content = array(
'reward' => TRANSLATE_COMMA(SURFBAR_DETERMINE_REWARD(true)),
'costs' => TRANSLATE_COMMA(SURFBAR_DETERMINE_COSTS(true)),
- 'max_order' => $_CONFIG['surfbar_max_order'],
+ 'max_order' => getConfig('surfbar_max_order'),
'curr_order' => SURFBAR_GET_TOTAL_USER_URLS()
);
// Load surfbar order form
- LOAD_TEMPLATE(sprintf("member_surfbar_book_%s", strtolower($_CONFIG['surfbar_pay_model'])), false, $content);
+ LOAD_TEMPLATE(sprintf("member_surfbar_book_%s", strtolower(getConfig('surfbar_pay_model'))), false, $content);
}
//
// Prepare content for output
$content = array(
- 'surfbar_static_reward' => TRANSLATE_COMMA($_CONFIG['surfbar_static_reward']),
- 'surfbar_static_time' => CREATE_FANCY_TIME($_CONFIG['surfbar_static_time']),
- 'surfbar_static_lock' => CREATE_FANCY_TIME($_CONFIG['surfbar_static_lock']),
+ 'surfbar_static_reward' => TRANSLATE_COMMA(getConfig('surfbar_static_reward')),
+ 'surfbar_static_time' => CREATE_FANCY_TIME(getConfig('surfbar_static_time')),
+ 'surfbar_static_lock' => CREATE_FANCY_TIME(getConfig('surfbar_static_lock')),
'surfbar_total_urls' => SURFBAR_GET_TOTAL_URLS("ACTIVE", "0")
);
// In dynamic mode we need some more data
-if ($_CONFIG['surfbar_pay_model'] == "DYNAMIC") {
+if (getConfig('surfbar_pay_model') == "DYNAMIC") {
// Total URLs
$content = array(
- 'surfbar_dynamic_percent' => TRANSLATE_COMMA($_CONFIG['surfbar_dynamic_percent']),
+ 'surfbar_dynamic_percent' => TRANSLATE_COMMA(getConfig('surfbar_dynamic_percent')),
'surfbar_total_urls' => SURFBAR_GET_TOTAL_URLS("ACTIVE", "0"),
'surfbar_user_urls' => SURFBAR_GET_TOTAL_USER_URLS(),
'surfbar_total_online' => SURFBAR_DETERMINE_TOTAL_ONLINE(),
'surfbar_min_time' => CREATE_FANCY_TIME(SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE()),
'surfbar_max_time' => CREATE_FANCY_TIME(SURFBAR_CALCULATE_DYNAMIC_MAX_VALUE()),
'surfbar_dynamic_lock' => CREATE_FANCY_TIME(SURFBAR_CALCULATE_DYNAMIC_LOCK()),
- 'surfbar_static_reward' => TRANSLATE_COMMA($_CONFIG['surfbar_static_reward']),
- 'surfbar_static_time' => CREATE_FANCY_TIME($_CONFIG['surfbar_static_time'])
+ 'surfbar_static_reward' => TRANSLATE_COMMA(getConfig('surfbar_static_reward')),
+ 'surfbar_static_time' => CREATE_FANCY_TIME(getConfig('surfbar_static_time'))
);
} // END - if
// Load the template
-LOAD_TEMPLATE("member_surfbar_start_".strtolower($_CONFIG['surfbar_pay_model']), false, $content);
+LOAD_TEMPLATE("member_surfbar_start_".strtolower(getConfig('surfbar_pay_model')), false, $content);
// Load surfbar link template
LOAD_TEMPLATE("member_surfbar_link");
$total = GET_TOTAL_DATA($GLOBALS['userid'], "user_points", "points") - GET_TOTAL_DATA($GLOBALS['userid'], "user_data", "used_points");
// Remember maximum value for template
- define('__TRANSFER_MAX_VALUE', round($total - $_CONFIG['transfer_balance'] - 0.5));
+ define('__TRANSFER_MAX_VALUE', round($total - getConfig('transfer_balance') - 0.5));
if (isset($_POST['ok']))
{
// Add new transfer
- if ($_CONFIG['transfer_code'] > 0)
+ if (getConfig('transfer_code') > 0)
{
// Check for code
- $code = GEN_RANDOM_CODE($_CONFIG['transfer_code'], $_POST['code_chk'], $GLOBALS['userid'], __TRANSFER_MAX_VALUE);
+ $code = GEN_RANDOM_CODE(getConfig('transfer_code'), $_POST['code_chk'], $GLOBALS['userid'], __TRANSFER_MAX_VALUE);
$valid_code = ($code == $_POST['code']);
}
else
define('__TRANSFER_REASON', $_POST['reason']);
if (function_exists('CREATE_FANCY_TIME'))
{
- define('__TRANSFER_EXPIRES', CREATE_FANCY_TIME($_CONFIG['transfer_age']));
+ define('__TRANSFER_EXPIRES', CREATE_FANCY_TIME(getConfig('transfer_age')));
}
else
{
- define('__TRANSFER_EXPIRES', round($_CONFIG['transfer_age']/60/60/24)." ".DAYS);
+ define('__TRANSFER_EXPIRES', round(getConfig('transfer_age')/60/60/24)." ".DAYS);
}
// Generate tranafer id
define('__TRANSFER_USERID_SELECTION', $OUT);
// Generate Code
- if ($_CONFIG['transfer_code'] > 0)
+ if (getConfig('transfer_code') > 0)
{
$rand = mt_rand(0, 99999);
- $code = GEN_RANDOM_CODE($_CONFIG['transfer_code'], $rand, $GLOBALS['userid'], __TRANSFER_MAX_VALUE);
+ $code = GEN_RANDOM_CODE(getConfig('transfer_code'), $rand, $GLOBALS['userid'], __TRANSFER_MAX_VALUE);
$img = GENERATE_IMAGE($code, false);
define('__TRANSFER_IMAGE_INPUT', "<INPUT type=\"hidden\" name=\"code_chk\" value=\"".$rand."\"><INPUT type=\"text\" name=\"code\" class=\"member_normal\" size=\"5\" maxlength=\"7\"".__TRANSFER_TO_DISABLED."> ".$img);
}
switch ($MODE)
{
case "list_in":
- $SQL = "SELECT trans_id, from_uid, points, reason, time_trans FROM "._MYSQL_PREFIX."_user_transfers_in WHERE userid=%s ORDER BY time_trans DESC LIMIT ".$_CONFIG['transfer_max'];
+ $SQL = "SELECT trans_id, from_uid, points, reason, time_trans FROM "._MYSQL_PREFIX."_user_transfers_in WHERE userid=%s ORDER BY time_trans DESC LIMIT ".getConfig('transfer_max');
$NOTHING = TRANSFER_NO_INCOMING_TRANSFERS;
define('__TRANSFER_SUM', TRANSFER_TOTAL_INCOMING);
define('__TRANSFER_TITLE', TRANSFER_LIST_INCOMING);
break;
case "list_out":
- $SQL = "SELECT trans_id, to_uid, points, reason, time_trans FROM "._MYSQL_PREFIX."_user_transfers_out WHERE userid=%s ORDER BY time_trans DESC LIMIT ".$_CONFIG['transfer_max'];
+ $SQL = "SELECT trans_id, to_uid, points, reason, time_trans FROM "._MYSQL_PREFIX."_user_transfers_out WHERE userid=%s ORDER BY time_trans DESC LIMIT ".getConfig('transfer_max');
$NOTHING = TRANSFER_NO_OUTGOING_TRANSFERS;
define('__TRANSFER_SUM', TRANSFER_TOTAL_OUTGOING);
define('__TRANSFER_TITLE', TRANSFER_LIST_OUTGOING);
// Let's begin with the incoming list
$result = SQL_QUERY_ESC("SELECT trans_id, from_uid, points, reason, time_trans FROM "._MYSQL_PREFIX."_user_transfers_in WHERE userid=%s ORDER BY id LIMIT %s",
-array($GLOBALS['userid'], $_CONFIG['transfer_max']), __FILE__, __LINE__);
+array($GLOBALS['userid'], getConfig('transfer_max')), __FILE__, __LINE__);
while ($DATA = SQL_FETCHROW($result))
{
$DATA[] = "IN";
// As the last table transfer data from outgoing table to temporary
$result = SQL_QUERY_ESC("SELECT trans_id, to_uid, points, reason, time_trans FROM "._MYSQL_PREFIX."_user_transfers_out WHERE userid=%s ORDER BY id LIMIT %s",
-array($GLOBALS['userid'], $_CONFIG['transfer_max']), __FILE__, __LINE__);
+array($GLOBALS['userid'], getConfig('transfer_max')), __FILE__, __LINE__);
while ($DATA = SQL_FETCHROW($result))
{
$DATA[] = "OUT";
switch ($opt_in)
{
- case 'Y':
+ case "Y":
define('__TRANSFER_ALLOW_Y', " checked=\"checked\"");
define('__TRANSFER_ALLOW_N', "");
define('__TRANSFER_NEW_LINK', "<A href=\"".URL."/modules.php?module=login&what=transfer&mode=new\">".TRANSFER_NOW_LINK."</A>");
break;
- case 'N':
+ case "N":
define('__TRANSFER_ALLOW_Y', "");
define('__TRANSFER_ALLOW_N', " checked=\"checked\"");
define('__TRANSFER_NEW_LINK', TRANSFER_PLEASE_ALLOW_OPT_IN);
}
// Check for latest out-transfers
- $result = SQL_QUERY_ESC("SELECT time_trans FROM "._MYSQL_PREFIX."_user_transfers_out WHERE time_trans > (UNIX_TIMESTAMP() - ".$_CONFIG['transfer_timeout'].") AND userid=%s ORDER BY time_trans DESC LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT time_trans
+FROM "._MYSQL_PREFIX."_user_transfers_out
+WHERE time_trans > (UNIX_TIMESTAMP() - %s) AND userid=%s
+ORDER BY time_trans DESC
+LIMIT 1", array(getConfig('transfer_timeout'), $GLOBALS['userid']), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 0) {
// Load template
define('__TRANSFER_SETTINGS_CONTENT', LOAD_TEMPLATE("member_transfer_settings", true));
);
// Load row template
- if ($_CONFIG['show_points_unconfirmed'] == "Y") {
+ if (getConfig('show_points_unconfirmed') == "Y") {
$OUT .= LOAD_TEMPLATE("member_unconfirmed_row", true, $content);
} else {
$OUT .= LOAD_TEMPLATE("member_unconfirmed_row_nopoints", true, $content);
);
// Display points or not?
- if ($_CONFIG['show_points_unconfirmed'] == "Y") {
+ if (getConfig('show_points_unconfirmed') == "Y") {
$OUT .= LOAD_TEMPLATE("member_unconfirmed_404", true, $content);
} else {
$OUT .= LOAD_TEMPLATE("member_unconfirmed_404_nopoints", true, $content);
define('__UNCONFIRMED_ROWS', $OUT);
// Load main template
- if ($_CONFIG['show_points_unconfirmed'] == "Y") {
+ if (getConfig('show_points_unconfirmed') == "Y") {
LOAD_TEMPLATE("member_unconfirmed_table");
} else {
LOAD_TEMPLATE("member_unconfirmed_table_nopoints");
ADD_DESCR("member", __FILE__);
// Check if the admin has entered the data
-if ((empty($_CONFIG['wernis_api_id'])) || (empty($_CONFIG['wernis_api_md5']))) {
+if ((getConfig('wernis_api_id') == "") || (getConfig('wernis_api_md5') == "")) {
// Something important is missing...
LOAD_TEMPLATE("admin_settings_saved", false, WERNIS_MEMBER_API_DATA_MISSING);
return;
// Is the mode set (withdraw or payout)
if ((!isset($_GET['mode'])) || ($_GET['mode'] == "choose")) {
// Let the user choose what he wants to do
- $content['refid'] = bigintval($_CONFIG['wernis_refid']);
+ $content['refid'] = bigintval(getConfig('wernis_refid'));
$content['wds66_id'] = 0;
// Get WDS66 id
$content['withdraw_link'] = "<em>".WERNIS_MEMBER_WITHDRAW_DISABLED."</em>";
// Is the payout mode active?
- if ($_CONFIG['wernis_payout_active'] == "Y") {
+ if (getConfig('wernis_payout_active') == "Y") {
// Add link
$content['payout_link'] = "<a class=\"menu_blur\" style=\"height: 40px\" href=\"".URL."/modules.php?module=login&what=wernis&mode=payout\"><div style=\"padding-top: 10px\">".MEMBER_WERNIS_MODE_PAYOUT."</div></a>";
} // END - if
// Is the withdraw mode active?
- if ($_CONFIG['wernis_withdraw_active'] == "Y") {
+ if (getConfig('wernis_withdraw_active') == "Y") {
// Add link
$content['withdraw_link'] = "<a class=\"menu_blur\" style=\"height: 40px\" href=\"".URL."/modules.php?module=login&what=wernis&mode=withdraw\"><div style=\"padding-top: 10px\">".MEMBER_WERNIS_MODE_WITHDRAW."</div></a>";
} // END - if
// Mode chooser! ;-)
$_GET['mode'] = "choose";
}
-} elseif (($_GET['mode'] == "payout") && ($_CONFIG['wernis_payout_active'] == "Y")) {
+} elseif (($_GET['mode'] == "payout") && (getConfig('wernis_payout_active') == "Y")) {
// Get total points and check if the user can request a payout
$points = GET_TOTAL_DATA($GLOBALS['userid'], "user_points", "points") - GET_TOTAL_DATA($GLOBALS['userid'], "user_data", "used_points");
// Remove the registration fee
- $points = $points - $_CONFIG['points_register'];
+ $points = $points - getConfig('points_register');
// Is there a percentage or fixed fee?
$points = WERNIS_TAKE_FEE($points, "payout");
// Is this enougth for a payout?
- if ($points < $_CONFIG['wernis_min_payout']) {
+ if ($points < getConfig('wernis_min_payout')) {
// No, then abort here
- LOAD_TEMPLATE("admin_settings_saved", false, sprintf(WERNIS_MEMBER_MIN_PAYOUT, TRANSLATE_COMMA($_CONFIG['wernis_min_payout'])));
+ LOAD_TEMPLATE("admin_settings_saved", false, sprintf(WERNIS_MEMBER_MIN_PAYOUT, TRANSLATE_COMMA(getConfig('wernis_min_payout'))));
return;
} // END - if
// Add points to content array
$content['points'] = TRANSLATE_COMMA($points);
- $content['min_points'] = TRANSLATE_COMMA($_CONFIG['wernis_min_payout']);
+ $content['min_points'] = TRANSLATE_COMMA(getConfig('wernis_min_payout'));
// Add fees to array
WERNIS_ADD_FEES_TO_ARRAY($content);
// Free result
SQL_FREERESULT($result);
-} elseif (($_GET['mode'] == "withdraw") && ($_CONFIG['wernis_withdraw_active'] == "Y")) {
+} elseif (($_GET['mode'] == "withdraw") && (getConfig('wernis_withdraw_active') == "Y")) {
// Get total points for just displaying them
$points = GET_TOTAL_DATA($GLOBALS['userid'], "user_points", "points") - GET_TOTAL_DATA($GLOBALS['userid'], "user_data", "used_points");
// Prepare data for the template
$content['points'] = TRANSLATE_COMMA($points);
- $content['min_points'] = TRANSLATE_COMMA($_CONFIG['wernis_min_withdraw']);
+ $content['min_points'] = TRANSLATE_COMMA(getConfig('wernis_min_withdraw'));
$content['wds66_id'] = "";
// Add fees to array
// Check input data depending on the mode and execute the requested mode
switch ($_GET['mode']) {
case "withdraw": // Widthdraws WDS66 -> This exchange
- if ($_POST['amount'] < $_CONFIG['wernis_min_withdraw']) {
+ if ($_POST['amount'] < getConfig('wernis_min_withdraw')) {
// Not enougth entered!
- LOAD_TEMPLATE("admin_settings_saved", false, sprintf(WERNIS_MEMBER_AMOUNT_SMALLER_MIN, bigintval($_CONFIG['wernis_min_withdraw'])));
+ LOAD_TEMPLATE("admin_settings_saved", false, sprintf(WERNIS_MEMBER_AMOUNT_SMALLER_MIN, bigintval(getConfig('wernis_min_withdraw'))));
OUTPUT_HTML("<br />");
} else {
// All is fine here so do the withdraw
break;
case "payout": // Payout this exchange -> WDS66
- if ($_POST['amount'] < $_CONFIG['wernis_min_payout']) {
+ if ($_POST['amount'] < getConfig('wernis_min_payout')) {
// Not enougth entered!
- LOAD_TEMPLATE("admin_settings_saved", false, sprintf(WERNIS_MEMBER_AMOUNT_SMALLER_MIN, bigintval($_CONFIG['wernis_min_payout'])));
+ LOAD_TEMPLATE("admin_settings_saved", false, sprintf(WERNIS_MEMBER_AMOUNT_SMALLER_MIN, bigintval(getConfig('wernis_min_payout'))));
OUTPUT_HTML("<br />");
} elseif ($_POST['amount'] > $points) {
// Not enougth points left!
// When URL is empty nothing bad happend here
if (empty($URL)) {
// Is the auto-send mechanism active or inactive?
- if ($_CONFIG['autosend_active'] == "Y") {
+ if (getConfig('autosend_active') == "Y") {
// Auto-send is active
define('ADMIN_AUTOSEND', COMPILE_CODE(ADMIN_AUTOSEND_ACTIVE));
define('MEMBER_AUTOSEND', COMPILE_CODE(MEMBER_AUTOSEND_ACTIVE));
// Update used points
$ADD = "";
- if ($_CONFIG['order_max_full'] == "ORDER") $ADD = ", mail_orders=mail_orders+1";
+ if (getConfig('order_max_full') == "ORDER") $ADD = ", mail_orders=mail_orders+1";
SUB_POINTS("order", $GLOBALS['userid'], $USED);
// Prepare content
$content = array(
- 'blocks' => $_CONFIG['max_send'],
+ 'blocks' => getConfig('max_send'),
'subject' => $DATA[0],
'text' => $DATA[1],
'payment' => GET_PAYMENT($DATA[3]),
} elseif ((!empty($_POST['pass1'])) && (empty($_POST['pass2']))) {
// No password two entered
$MSG = SPONSOR_PASSWORD_TWO_EMPTY;
- } elseif ((!empty($_POST['pass1'])) && (strlen($_POST['pass1']) < $_CONFIG['pass_len'])) {
+ } elseif ((!empty($_POST['pass1'])) && (strlen($_POST['pass1']) < getConfig('pass_len'))) {
// Too short password
- $MSG = SPONSOR_PASSWORD_TOO_SHORT_1.$_CONFIG['pass_len'].SPONSOR_PASSWORD_TOO_SHORT_2;
+ $MSG = SPONSOR_PASSWORD_TOO_SHORT_1.getConfig('pass_len').SPONSOR_PASSWORD_TOO_SHORT_2;
} else {
// Default is we don't want to change password!
$PASS_AND = ""; $PASS_DATA = "";
}
// Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (!defined('__DAILY_RESET')) || ($_CONFIG['beg_rallye'] == "N")) return;
+if (($CSS == 1) || (!defined('__DAILY_RESET')) || (getConfig('beg_rallye') == "N")) return;
//* DEBUG: */ echo basename(__FILE__)."<br />\n";
// Get current month (2 digits)
$curr = date("m", time());
// Check if month is done
-if (($curr != $_CONFIG['last_month']) && ($_CONFIG['last_month'] > 0) && ($_CONFIG['beg_ranks'] > 0) && ($CSS != 1)) {
+if (($curr != getConfig('last_month')) && (getConfig('last_month') > 0) && (getConfig('beg_ranks') > 0) && ($CSS != 1)) {
// Extension "autopurge" is inactive or purging of inactive accounts is deactivated
$whereStatement1 = "";
- $whereStatement2 = bigintval($_CONFIG['beg_ranks']);
+ $whereStatement2 = bigintval(getConfig('beg_ranks'));
+
+ // Shall we exclude webmaster's own userid?
+ if ((getConfig('beg_include_own') == "N") && (getConfig('beg_uid') > 0)) {
+ // Exclude it
+ $whereStatement1 = sprintf(" AND userid != %s", bigintval(getConfig('beg_uid')));
+ } // END - if
// Let's check if there are some points left we can "pay"...
if (EXT_IS_ACTIVE("autopurge")) {
// Use last online stamp only when autopurge for inactive members is activated
- if (($_CONFIG['ap_inactive_since'] > 0) && ($_CONFIG['beg_active'] == "Y")) {
+ if ((getConfig('ap_inactive_since') > 0) && (getConfig('beg_active') == "Y")) {
// Okay, include last online timestamp
- $whereStatement1 = sprintf(" AND last_online >= (UNIX_TIMESTAMP() - %s)", bigintval($_CONFIG['ap_inactive_since']));;
- $whereStatement2 = bigintval($_CONFIG['beg_ranks']);
+ $whereStatement1 .= sprintf(" AND last_online >= (UNIX_TIMESTAMP() - %s)", bigintval(getConfig('ap_inactive_since')));;
} // END - if
} // END - if
// Get current month (2 digits)
$curr = date("m", time());
-if (($curr != $_CONFIG['last_month']) && ($_CONFIG['bonus_ranks'] > 0) && ($CSS != 1)) {
+if (($curr != getConfig('last_month')) && (getConfig('bonus_ranks') > 0) && ($CSS != 1)) {
// Extension "autopurge" is inactive or purging of inactive accounts is deactivated
$whereStatement1 = "WHERE status='CONFIRMED'";
- $whereStatement2 = bigintval($_CONFIG['bonus_ranks']);
+ $whereStatement2 = bigintval(getConfig('bonus_ranks'));
// Shall I keep inactive members away from here? (mostly wanted in an "active-rallye" ...)
if (EXT_IS_ACTIVE("autopurge")) {
// Use last online stamp only when autopurge for inactive members is activated
- if ($_CONFIG['ap_inactive_since'] > 0) {
+ if (getConfig('ap_inactive_since') > 0) {
// Okay, include last online timestamp
- $whereStatement1 = sprintf("WHERE status='CONFIRMED' AND last_online >= (UNIX_TIMESTAMP() - %s)", $_CONFIG['ap_inactive_since']);
- $whereStatement2 = bigintval($_CONFIG['bonus_ranks']);
+ $whereStatement1 = sprintf("WHERE status='CONFIRMED' AND last_online >= (UNIX_TIMESTAMP() - %s)", getConfig('ap_inactive_since'));
+ $whereStatement2 = bigintval(getConfig('bonus_ranks'));
} // END - if
} // END - if
// Add more bonus points here
$ADD = "";
- if ($_CONFIG['bonus_click_yn'] == "Y") $ADD .= " + turbo_bonus";
- if ($_CONFIG['bonus_login_yn'] == "Y") $ADD .= " + login_bonus";
- if ($_CONFIG['bonus_order_yn'] == "Y") $ADD .= " + bonus_order";
- if ($_CONFIG['bonus_stats_yn'] == "Y") $ADD .= " + bonus_stats";
- if ($_CONFIG['bonus_ref_yn'] == "Y") $ADD .= " + bonus_ref";
+ if (getConfig('bonus_click_yn') == "Y") $ADD .= " + turbo_bonus";
+ if (getConfig('bonus_login_yn') == "Y") $ADD .= " + login_bonus";
+ if (getConfig('bonus_order_yn') == "Y") $ADD .= " + bonus_order";
+ if (getConfig('bonus_stats_yn') == "Y") $ADD .= " + bonus_stats";
+ if (getConfig('bonus_ref_yn') == "Y") $ADD .= " + bonus_ref";
// Shall we add some entries?
if (!empty($ADD)) {
// Get current month (2 digits)
$curr = date("m", time());
-if ($_CONFIG['last_month'] != $curr)
+if (getConfig('last_month') != $curr)
{
// Check for unsubscribed members
$result = SQL_QUERY("SELECT userid, nl_until FROM `"._MYSQL_PREFIX."_user_data` WHERE nl_receive='N' ORDER BY userid", __FILE__, __LINE__);
// Please run the installation script (maybe again)
die(DIE_RUN_INSTALL_MYSQL);
}
-} elseif ((!defined('mxchange_installing')) && (!isset($_GET['installing'])) && (empty($MySQL['password'])) && (isBooleanConstantAndTrue('warn_no_pass'))) {
+} elseif ((!isBooleanConstantAndTrue('mxchange_installing')) && (!isset($_GET['installing'])) && (empty($MySQL['password'])) && (isBooleanConstantAndTrue('warn_no_pass'))) {
// No database password entered!!!
echo "<STRONG>".LANG_WARNING.":</STRONG> ".WARN_NULL_PASSWORD;
}
+// Set dummy $_CONFIG array
+$_CONFIG = array(
+ 'code_length' => 0,
+ 'patch_level' => 0,
+ 'last_update' => time()
+);
+
// Check if this file is writeable or read-only and warn the user
if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndTrue('mxchange_installed'))) {
// Check for write-permission for config.php and inc directory
// Is it a valid resource?
if ($db === true) {
- // Remove MySQL array from namespace
+ // This is required for extension 'optimize' to work
define('__DB_NAME', $MySQL['dbase']);
+
+ // Remove MySQL array from namespace
unset($MySQL);
// Load configuration stuff
- $_CONFIG = LOAD_CONFIG();
+ $_CONFIG = merge_array($_CONFIG, LOAD_CONFIG());
// Initialize include-file-pool
$INC_POOL = array();
} elseif (($GLOBALS['module'] == "index") || ($GLOBALS['module'] == "login")) {
// Set 'what' value to 'welcome' in guest and member menu
$GLOBALS['what'] = "welcome";
- if (!empty($_CONFIG['index_home'])) $GLOBALS['what'] = $_CONFIG['index_home'];
+ if (getConfig('index_home') != "") $GLOBALS['what'] = getConfig('index_home');
} else {
// Anything else like begging link
$GLOBALS['what'] = "";
unset($dummy);
// Shall we activate the exchange?
- if ($_CONFIG['activate_xchange'] > 0) activateExchange();
+ if (getConfig('activate_xchange') > 0) activateExchange();
// Is the extension sql_patches installed and at least 0.3.6?
if (GET_EXT_VERSION("sql_patches") >= "0.3.6") {
// Include neccessary functions for installation //
///////////////////////////////////////////////////
- // Set CONFIG array
- $_CONFIG = array(
- 'code_length' => 0
- );
-
// Set other missing variables
$link = false; // No database link by default
$name = $cacheArray['modules']['title'][$mod];
// Update cache hits
- if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
} 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__);
$mem = $cacheArray['modules']['mem_only'][$mod_chk];
// Update cache hits
- if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
$found = true;
} else {
// No, then we have to update it!
if ($return) {
// Return title
return $ret;
- } elseif (((GET_EXT_VERSION("sql_patches") >= "0.2.3") && ($_CONFIG['youre_here'] == "Y")) || ((IS_ADMIN()) && ($modCheck == "admin"))) {
+ } elseif (((GET_EXT_VERSION("sql_patches") >= "0.2.3") && (getConfig('youre_here') == "Y")) || ((IS_ADMIN()) && ($modCheck == "admin"))) {
// Output HTML code
$OUT = $prefix."<STRONG><A class=\"you_are_here\" href=\"".URL."/modules.php?module=".$modCheck."&".$type."=".$search.$LINK_ADD."\">".$ret."</A></STRONG>\n";
$OUT .= "</div>\n";
// Extension removeip activated?
- if ((EXT_IS_ACTIVE("removeip")) && (isset($_CONFIG['removeip_'.strtolower($ACC_LVL).'_show'])) && ($_CONFIG['removeip_'.strtolower($ACC_LVL).'_show'] == "Y")) {
+ if ((EXT_IS_ACTIVE("removeip")) && (getConfig('removeip_'.strtolower($ACC_LVL).'_show') == "Y")) {
// Add anoymity/privacy infos
$OUT .= REMOVEIP_ADD_INFOS();
} // END - if
// Handle failed logins here if not in guest
//* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):type={$type},action={$GLOBALS['action']},what={$GLOBALS['what']},lvl={$ACC_LVL}<br />\n";
- if ((($type == "what") || ($type == "action") && ((!isset($GLOBALS['what'])) || ($GLOBALS['what'] == "overview") || ($GLOBALS['what'] == $_CONFIG['index_home']))) && ($ACC_LVL != "guest") && ((GET_EXT_VERSION("sql_patches") >= "0.4.7") || (GET_EXT_VERSION("admins") >= "0.7.0"))) {
+ if ((($type == "what") || ($type == "action") && ((!isset($GLOBALS['what'])) || ($GLOBALS['what'] == "overview") || ($GLOBALS['what'] == getConfig('index_home')))) && ($ACC_LVL != "guest") && ((GET_EXT_VERSION("sql_patches") >= "0.4.7") || (GET_EXT_VERSION("admins") >= "0.7.0"))) {
// Handle failture
$OUT .= HANDLE_LOGIN_FAILTURES($ACC_LVL);
} // END - if
}
// Menu title
- $content .= $_CONFIG['menu_blur_spacer'].$sub_title;
+ $content .= getConfig('menu_blur_spacer') . $sub_title;
if ($test) {
$content .= "</A>";
$valPass = $cacheArray['admin_hash'];
} elseif ((!empty($passCookie)) && (isset($cacheArray['admins']['password'][$admin])) && (!empty($admin))) {
// Count cache hits
- if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
// Login data is valid or not?
$valPass = generatePassString($cacheArray['admins']['password'][$admin]);
if (empty($GLOBALS['what'])) {
// Fix it to default
$GLOBALS['what'] = "welcome";
- if (!empty($_CONFIG['index_home'])) $GLOBALS['what'] = $_CONFIG['index_home'];
+ if (getConfig('index_home') != "") $GLOBALS['what'] = getConfig('index_home');
} // END - if
// Update last module / online time
// Fix empty "what"
if (empty($wht)) {
$wht = "welcome";
- if (!empty($_CONFIG['index_home'])) $wht = $_CONFIG['index_home'];
+ if (getConfig('index_home') != "") $wht = getConfig('index_home');
} // END - if
// Default is not found
// Load template
$msg = LOAD_EMAIL_TEMPLATE("member_mydata_notify", $content, $GLOBALS['userid']);
- if ($_CONFIG['admin_notify'] == "Y") {
+ if (getConfig('admin_notify') == "Y") {
// The admin needs to be notified about a profile change
$msg_admin = "admin_mydata_notify";
$sub_adm = ADMIN_CHANGED_DATA;
if ((!empty($sub_adm)) && (!empty($msg_admin))) {
// Send admin mail
SEND_ADMIN_NOTIFICATION($sub_adm, $msg_admin, $content, $GLOBALS['userid']);
- } elseif ($_CONFIG['admin_notify'] == "Y") {
+ } elseif (getConfig('admin_notify') == "Y") {
// Cannot send mails to admin!
$content = CANNOT_SEND_ADMIN_MAILS;
} else {
//* DEBUG: */ echo __LINE__."=".$MODE."/".$wht."/".$GLOBALS['action']."=<br />";
if ((empty($wht)) && ($MODE != "admin")) {
$wht = "welcome";
- if (!empty($_CONFIG['index_home'])) $wht = $_CONFIG['index_home'];
+ if (getConfig('index_home') != "") $wht = getConfig('index_home');
} // END - if
if ($MODE == "admin") {
$per = $cacheArray['ref_depths']['percents'][$key];
// Count cache hit
- if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
}
} elseif (!EXT_IS_ACTIVE("cache")) {
// Get referal data
// Purge old entries
$result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_online WHERE timestamp <= (UNIX_TIMESTAMP() - %s)",
- array($_CONFIG['online_timeout']), __FILE__, __LINE__);
+ array(getConfig('online_timeout')), __FILE__, __LINE__);
}
// OBSOLETE: Sends out mail to all administrators
function SEND_ADMIN_EMAILS ($subj, $msg) {
$ret = $cacheArray['admins']['aid'][$login];
// Update cache hits
- if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
} elseif (!EXT_IS_ACTIVE("cache")) {
// Load from database
$result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_admins WHERE login='%s' LIMIT 1",
$ret = $cacheArray['admins']['password'][$aid];
// Update cache hits
- if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
} elseif (!EXT_IS_ACTIVE("cache")) {
// Load from database
$result = SQL_QUERY_ESC("SELECT password FROM "._MYSQL_PREFIX."_admins WHERE id=%s LIMIT 1",
$ret = $cacheArray['admins']['login'][$aid];
// Update cache hits
- if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
} elseif (!EXT_IS_ACTIVE("cache")) {
// Load from database
$result = SQL_QUERY_ESC("SELECT login FROM "._MYSQL_PREFIX."_admins WHERE id=%s LIMIT 1",
$ret = $cacheArray['admins']['email'][$aid];
// Update cache hits
- if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
} elseif (!EXT_IS_ACTIVE("cache")) {
// Load from database
$result_aid = SQL_QUERY_ESC("SELECT email FROM "._MYSQL_PREFIX."_admins WHERE id=%s LIMIT 1",
$ret = $cacheArray['admins']['def_acl'][$aid];
// Update cache hits
- if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
} 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",
function activateExchange() {
global $_CONFIG;
$result = SQL_QUERY("SELECT userid FROM `"._MYSQL_PREFIX."_user_data` WHERE status='CONFIRMED' AND max_mails > 0", __FILE__, __LINE__);
- if (SQL_NUMROWS($result) >= $_CONFIG['activate_xchange'])
+ if (SQL_NUMROWS($result) >= getConfig('activate_xchange'))
{
// Free memory
SQL_FREERESULT($result);
// Exclude admin and member's area
if (($mod != "admin") && ($mod != "login")) {
// Construct dynamic description
- $DESCR = MAIN_TITLE." ".trim($_CONFIG['title_middle'])." ".ADD_DESCR("guest", "what-".$wht, true);
+ $DESCR = MAIN_TITLE." ".trim(getConfig('title_middle'))." ".ADD_DESCR("guest", "what-".$wht, true);
// Output it directly
OUTPUT_HTML("<meta name=\"description\" content=\"".$DESCR."\" />");
case "login":
case "index":
$wht = "welcome";
- if (($modCheck == "index") && (!empty($_CONFIG['index_home']))) $wht = $_CONFIG['index_home'];
+ if (($modCheck == "index") && (getConfig('index_home') != "")) $wht = getConfig('index_home');
break;
default:
if (isset($cacheArray['modules']['has_menu'][$mod])) {
// Check module cache and count hit
$ret = ($cacheArray['modules']['has_menu'][$mod] == "Y");
- if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
} elseif (isset($cacheArray['extensions']['ext_menu'][$mod])) {
// Check cache and count hit
$ret = ($cacheArray['extensions']['ext_menu'][$mod] == "Y");
- if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
} elseif ((IS_ADMIN()) && ($mod == "admin")) {
// Admin module has always a menu!
$ret = true;
if ((EXT_IS_ACTIVE("html_mail")) && ($mode == "html")) {
// Only include HTML receivers
$result = SQL_QUERY_ESC("SELECT d.userid FROM `"._MYSQL_PREFIX."_user_data` AS d ".$CAT_TABS." WHERE d.status='CONFIRMED' AND d.html='Y'".$CAT_WHERE." ORDER BY d.%s %s LIMIT %s",
- array($cat, $_CONFIG['order_select'], $_CONFIG['order_mode'], $receiver), __FILE__, __LINE__);
+ array($cat, getConfig('order_select'), getConfig('order_mode'), $receiver), __FILE__, __LINE__);
} else {
// Include all
$result = SQL_QUERY_ESC("SELECT d.userid FROM `"._MYSQL_PREFIX."_user_data` AS d ".$CAT_TABS." WHERE d.status='CONFIRMED'".$CAT_WHERE." ORDER BY d.%s %s LIMIT %s",
- array($cat, $_CONFIG['order_select'], $_CONFIG['order_mode'], $receiver), __FILE__, __LINE__);
+ array($cat, getConfig('order_select'), getConfig('order_mode'), $receiver), __FILE__, __LINE__);
}
// Entries found?
$row['activity'] = MEMBER_ACTIVITY_ACTIVE;
// Is autopurge installed and the user inactive?
- if ((EXT_IS_ACTIVE("autopurge")) && ((time() - $_CONFIG['ap_inactive_since']) >= $row['last_online'])) {
+ if ((EXT_IS_ACTIVE("autopurge")) && ((time() - getConfig('ap_inactive_since')) >= $row['last_online'])) {
// Inactive user!
$row['activity'] = MEMBER_ACTIVITY_INACTIVE;
} // END - if
}
// Check for patch level differences between databases and current hard-coded
-if ((CURR_SVN_REVISION > $_CONFIG['patch_level']) || ($_CONFIG['patch_level'] == "CURR_SVN_REVISION") || ($_CONFIG['patch_ctime'] == "UNIX_TIMES")) {
+if ((CURR_SVN_REVISION > getConfig('patch_level')) || (getConfig('patch_level') == "CURR_SVN_REVISION") || (getConfig('patch_ctime') == "UNIX_TIMES")) {
// Update database and CONFIG array
UPDATE_CONFIG(array("patch_level", "patch_ctime"), array(CURR_SVN_REVISION, "UNIX_TIMESTAMP()"));
$_CONFIG['patch_level'] = CURR_SVN_REVISION;
}
// Only send bonus mail when bonus extension is active and maximum send-mails is not reached
-if ($cnt < $_CONFIG['max_send']) {
+if ($cnt < getConfig('max_send')) {
// Do we need to send out bonus mails?
if (EXT_IS_ACTIVE("html_mail")) {
// 0 1 2 3 4 5 6 7 8 9 10 11
} // END - if
// Do we have send maximum mails?
- if (($cnt >= $_CONFIG['max_send']) || (SELECTION_COUNT($dummy) == 0)) {
+ if (($cnt >= getConfig('max_send')) || (SELECTION_COUNT($dummy) == 0)) {
// Yes, we have
//* DEBUG: */ echo "*EXIT/L:".__LINE__."<br />";
break;
//* DEBUG: */ echo "*MEDIA/L:".__LINE__."*<br />";
MEDIA_UPDATE_ENTRY(array("total_orders", "bonus_orders"), "add", 1);
} // END - if
- } elseif ($cnt >= $_CONFIG['max_send']) {
+ } elseif ($cnt >= getConfig('max_send')) {
// Update bonus pool
$result_done = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_bonus SET data_type='NEW', target_send=%s, receivers='%s' WHERE id=%s LIMIT 1",
array(SELECTION_COUNT($dummy), implode(";", $dummy), bigintval($DATA['id'])), __FILE__, __LINE__);
}
}
- // Do we have reached the maximum to send mails? || ($_CONFIG['max_send'] >= $cnt)
- //* DEBUG: */ echo "*L:".__LINE__."/".$cnt.">=".$DATA[8]."/".$_CONFIG['max_send'].">=".$cnt."/".$LAST_SENT_ID."!=".$DATA[0]."*<br />";
+ // Do we have reached the maximum to send mails? || (getConfig('max_send') >= $cnt)
+ //* DEBUG: */ echo "*L:".__LINE__."/".$cnt.">=".$DATA[8]."/".getConfig('max_send').">=".$cnt."/".$LAST_SENT_ID."!=".$DATA[0]."*<br />";
if ((($cnt >= $DATA[8])) && ($LAST_SENT_ID != $DATA[0])) {
// Prepare content
$content = array(
break;
}
// Do we have send maximum mails?
- elseif (($cnt >= $_CONFIG['max_send']) || ($cnt2 >= $_CONFIG['max_send'])) {
+ elseif (($cnt >= getConfig('max_send')) || ($cnt2 >= getConfig('max_send'))) {
// There are some mails left to send for next round, so we reset the status back to NEW (=still not fully delivered)
$ADD = "";
if ($cnt <= $DATA[8]) $ADD = ", target_send=target_send-".$cnt;
require($INC);
}
-if (($_CONFIG['send_prof_update'] == "Y") && ($_CONFIG['profile_update'] > 0) && ($_CONFIG['resend_profile_update'])) {
+if ((getConfig('send_prof_update') == "Y") && (getConfig('profile_update') > 0) && (getConfig('resend_profile_update'))) {
// Load personal data 0 1 2 3 4 5 6
$result = SQL_QUERY_ESC("SELECT userid, email, gender, surname, family, last_update, joined
FROM
(last_update < (UNIX_TIMESTAMP() - %s) AND last_update != 0 AND last_profile_sent < (UNIX_TIMESTAMP() - %s))
OR
(last_update=0 AND last_profile_sent=0 AND joined < (UNIX_TIMESTAMP() - %s))
-ORDER BY userid", array($_CONFIG['profile_update'], $_CONFIG['resend_profile_update'], $_CONFIG['profile_update']), __FILE__, __LINE__);
+ORDER BY userid", array(getConfig('profile_update'), getConfig('resend_profile_update'), getConfig('profile_update')), __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0)
{
// We need to send-out notifications...
}
// Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (!defined('__DAILY_RESET')) || ($_CONFIG['beg_rallye'] == "Y")) return;
+if (($CSS == 1) || (!defined('__DAILY_RESET')) || (getConfig('beg_rallye') == "Y")) return;
//* DEBUG: */ echo basename(__FILE__)."<br />\n";
// Reset accounts
}
// Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || ((!defined('__DAILY_RESET')) && ($_CONFIG['holiday_mode'] == "RESET"))) return;
+if (($CSS == 1) || ((!defined('__DAILY_RESET')) && (getConfig('holiday_mode') == "RESET"))) return;
//* DEBUG: */ echo basename(__FILE__)."<br />\n";
// Check for holidays we need to enable and send email to user
//* DEBUG: */ echo basename(__FILE__)."<br />\n";
// Reset surfbar counter
-UPDATE_CONFIG(array("surfbar_daily_counter", "surfbar_yester_counter"), array(0, $_CONFIG['surfbar_daily_counter']));
-$_CONFIG['surfbar_yester_counter'] = $_CONFIG['surfbar_daily_counter'];
+UPDATE_CONFIG(array("surfbar_daily_counter", "surfbar_yester_counter"), array(0, getConfig('surfbar_daily_counter')));
+$_CONFIG['surfbar_yester_counter'] = getConfig('surfbar_daily_counter');
$_CONFIG['surfbar_daily_counter'] = 0;
//
if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
// Simply reset the requests here
-UPDATE_CONFIG("yoomedia_requests_remain", $_CONFIG['yoomedia_requests_total']);
+UPDATE_CONFIG("yoomedia_requests_remain", getConfig('yoomedia_requests_total'));
//
?>
if (($VIEW == 1) && ($_SERVER['PHP_SELF'])) return;
// Set session save path if set
-if (!empty($_CONFIG['session_save_path'])) {
+if (getConfig('session_save_path') != "") {
// Please make sure this valid!
- @session_save_path($_CONFIG['session_save_path']);
+ @session_save_path(getConfig('session_save_path'));
} // END - if
// Start the session
************************************************************************/
// Some security stuff...
-if (!defined('__SECURITY'))
-{
+if (!defined('__SECURITY')) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
}
// Check for 100% klickrate mails
$result_bonus = SQL_QUERY("SELECT id, userid, subject, timestamp_ordered, clicks, url
FROM "._MYSQL_PREFIX."_user_stats
-WHERE max_rec=clicks AND clicks>0 AND bonus_stats='N'
+WHERE max_rec=clicks AND clicks>0 AND bonus_stats_active='N'
ORDER BY userid", __FILE__, __LINE__);
if (SQL_NUMROWS($result_bonus) > 0) {
// Remember stats bonus in constant
- define('__STATS_BONUS', TRANSLATE_COMMA($_CONFIG['bonus_stats']));
+ define('__STATS_BONUS', TRANSLATE_COMMA(getConfig('bonus_stats')));
// We found some mail orders...
while(list($id, $uid, $subj, $stamp, $clicks, $url) = SQL_FETCHROW($result_bonus)) {
// Add points
$result_points = SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_user_data` SET bonus_stats=bonus_stats+%s WHERE userid=%s LIMIT 1",
- array($_CONFIG['bonus_stats'], bigintval($uid)), __FILE__, __LINE__);
+ array(getConfig('bonus_stats'), bigintval($uid)), __FILE__, __LINE__);
// Prepare array
$content = array(
SEND_EMAIL($uid, BONUS_MEMBER_STATS_SUBJECT, $msg);
// Update database
- $result_update = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_stats SET bonus_stats='Y' WHERE id=%s LIMIT 1",
- array(bigintval($id)), __FILE__, __LINE__);
+ $result_update = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_stats SET bonus_stats_active='Y' WHERE id=%s LIMIT 1",
+ array(bigintval($id)), __FILE__, __LINE__);
}
// Handle bonus points
- BONUS_POINTS_HANDLER($_CONFIG['bonus_stats']);
+ BONUS_POINTS_HANDLER(getConfig('bonus_stats'));
}
// Free memory
if ((basename($_SERVER['PHP_SELF']) == "install.php") || (!isBooleanConstantAndTrue('mxchange_installed')) || (isset($_GET['installing']))) $STYLES[] = "install.css";
// When no CSS output-mode is set, set it to file-output
-if (empty($_CONFIG['css_php'])) $_CONFIG['css_php'] = "FILE";
+if (getConfig('css_php') == "") $_CONFIG['css_php'] = "FILE";
// Output CSS files or content or link to css.php ?
-if (($CSS == "1") || ($_CONFIG['css_php'] == "DIRECT")) {
+if (($CSS == "1") || (getConfig('css_php') == "DIRECT")) {
// Load CSS files
if (is_array($EXT_CSS_FILES)) {
// Load extension's CSS files
// Do include only existing files and whose are not empty
if ((FILE_READABLE($file)) && (filesize($file) > 0)) {
- switch ($_CONFIG['css_php']) {
+ switch (getConfig('css_php')) {
case "DIRECT":
OUTPUT_HTML("<link rel=\"stylesheet\" type=\"text/css\" href=\"".URL."/theme/".GET_CURR_THEME()."/".$value."\" />");
break;
require(PATH."inc/header.php");
// Fix missing array elements here
- if (!isset($_CONFIG['index_delay'])) $_CONFIG['index_delay'] = 0;
- if (!isset($_CONFIG['index_cookie'])) $_CONFIG['index_cookie'] = 0;
+ if (getConfig('index_delay') == null) $_CONFIG['index_delay'] = 0;
+ if (getConfig('index_cookie') == null) $_CONFIG['index_cookie'] = 0;
// Check for cookies
- if ((isSessionVariableSet('visited')) || ($_CONFIG['index_delay'] == 0) || ($_CONFIG['index_cookie'] == 0)) {
+ if ((isSessionVariableSet('visited')) || (getConfig('index_delay') == 0) || (getConfig('index_cookie') == 0)) {
// Is the index page configured for redirect pr not?
- if ($_CONFIG['index_cookie'] > 0) {
+ if (getConfig('index_cookie') > 0) {
// Set cookie and remeber it for specified time
set_session("visited", "true");
} elseif (isSessionVariableSet('visited')) {
LOAD_TEMPLATE("index", false, ADD_URL_DATA(""));
// Shall I insert an automated forward?
- if ($_CONFIG['index_delay'] > 0) {
+ if (getConfig('index_delay') > 0) {
// This will be a JavaScript-redirect!
- define('__DELAY_VALUE', ($_CONFIG['index_delay'] * 1000 + 500));
+ define('__DELAY_VALUE', (getConfig('index_delay') * 1000 + 500));
define('__MOD_VALUE' , ADD_URL_DATA("index"));
LOAD_TEMPLATE("index_forward");
}
// Error code is set?
if (!empty($msg)) {
- switch ($_CONFIG['mailid_error_redirect']) {
+ switch (getConfig('mailid_error_redirect')) {
case "INDEX": // Redirect to index page
LOAD_URL("modules.php?module=index&msg=".$msg."&ext=mailid");
break;
case "REJECT": // Redirect to rejection page
- LOAD_URL($_CONFIG['reject_url']);
+ LOAD_URL(getConfig('reject_url'));
break;
default:
- DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown status %s detected in mailid_error_redirect.", $_CONFIG['mailid_error_redirect']));
+ DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown status %s detected in mailid_error_redirect.", getConfig('mailid_error_redirect')));
LOAD_URL("modules.php?module=index&msg=".CODE_UNKNOWN_STATUS."&ext=mailid");
break;
}
if (($time > 0) && ($payment > 0)) {
if (!empty($code)) {
// Generate code
- $img_code = GEN_RANDOM_CODE($_CONFIG['code_length'], $code, $url_uid, $DATA);
+ $img_code = GEN_RANDOM_CODE(getConfig('code_length'), $code, $url_uid, $DATA);
} // END - if
switch ($mode) {
$template = "mailid_points_done";
// Right code entered add points and remove entry
- if (($ref_pay > 0) && ($_CONFIG['allow_direct_pay'] == "N")) {
+ if (($ref_pay > 0) && (getConfig('allow_direct_pay') == "N")) {
// Don't add points over the referal system
$locked = true;
$template = "mailid_points_locked";
// Shall I add bonus points for "turbo clickers" ?
if ((GET_EXT_VERSION("bonus") >= "0.2.2") && (function_exists('BONUS_ADD_TURBO_POINTS'))) {
// Is an active-rallye running and this is not a notification mail?
- if (($_CONFIG['bonus_active'] == "Y") && ($notify == "N")) {
+ if ((getConfig('bonus_active') == "Y") && ($notify == "N")) {
// Shall I exclude the webmaster's own userid from the active-rallye?
- if (((($_CONFIG['bonus_uid'] == $url_uid) && ($_CONFIG['bonus_include_own'] == "Y")) || ($_CONFIG['bonus_uid'] != $url_uid)) && ($_CONFIG['def_refid'] != $url_uid)) {
+ if ((((getConfig('bonus_uid') == $url_uid) && (getConfig('bonus_include_own') == "Y")) || (getConfig('bonus_uid') != $url_uid)) && (getConfig('def_refid') != $url_uid)) {
// Add points and remember ranking are done in this function....
BONUS_ADD_TURBO_POINTS($DATA, $url_uid, $type);
define('_TYPE_VALUE', $type);
define('_DATA_VALUE', $DATA);
define('_TEMPLATE_BANNER', LOAD_TEMPLATE("mailid_banner", true));
- if ($_CONFIG['code_length'] > 0)
+ if (getConfig('code_length') > 0)
{
// Generate Code
define('_IMAGE_CODE', IMG_CODE($code, $type, $DATA, $url_uid));
// Modules are by default not valid!
$MOD_VALID = false; $check = "failed";
-if ((!empty($_CONFIG['maintenance'])) && ($_CONFIG['maintenance'] == "Y") && (!IS_ADMIN()) && ($GLOBALS['module'] != "admin")) {
+if ((getConfig('maintenance') == "Y") && (!IS_ADMIN()) && ($GLOBALS['module'] != "admin")) {
// Maintain mode is active and you are no admin
ADD_FATAL(LANG_DOWN_MAINTAINCE);
} elseif (($link) && ($db) && (sizeof($FATAL) == 0)) {
// Redirect only to registration page when this script is installed
if (isBooleanConstantAndTrue('mxchange_installed')) {
// Base URL for redirection
- switch ($_CONFIG['refid_target'])
+ switch (getConfig('refid_target'))
{
case "register":
$URL = URL."/modules.php?module=index&what=register&refid=";
define('__BONUS_FOOTER', LOAD_TEMPLATE("show_bonus_footer", true));
// Total ranks who can win
- define('__BONUS_TOTAL_RANKS', $_CONFIG['bonus_ranks']);
+ define('__BONUS_TOTAL_RANKS', getConfig('bonus_ranks'));
// Load final template
LOAD_TEMPLATE("show_bonus");
$content = array(
'points' => TRANSLATE_COMMA($points),
'online' => SURFBAR_DETERMINE_TOTAL_ONLINE(),
- 'reload' => ($_CONFIG['surfbar_stats_reload'] * 1000),
- 'c_total' => TRANSLATE_COMMA($_CONFIG['surfbar_total_counter']),
- 'c_today' => TRANSLATE_COMMA($_CONFIG['surfbar_daily_counter']),
- 'c_yester' => TRANSLATE_COMMA($_CONFIG['surfbar_yester_counter']),
- 'c_week' => TRANSLATE_COMMA($_CONFIG['surfbar_weekly_counter']),
- 'c_month' => TRANSLATE_COMMA($_CONFIG['surfbar_monthly_counter']),
+ 'reload' => (getConfig('surfbar_stats_reload') * 1000),
+ 'c_total' => TRANSLATE_COMMA(getConfig('surfbar_total_counter')),
+ 'c_today' => TRANSLATE_COMMA(getConfig('surfbar_daily_counter')),
+ 'c_yester' => TRANSLATE_COMMA(getConfig('surfbar_yester_counter')),
+ 'c_week' => TRANSLATE_COMMA(getConfig('surfbar_weekly_counter')),
+ 'c_month' => TRANSLATE_COMMA(getConfig('surfbar_monthly_counter')),
);
// Load template for "stats" page
// Prepare content
$content = array(
'online' => SURFBAR_DETERMINE_TOTAL_ONLINE(),
- 'reload' => ($_CONFIG['surfbar_stats_reload'] * 1000)
+ 'reload' => (getConfig('surfbar_stats_reload') * 1000)
);
// Load template for "stats" page
} else {
// Prepare content
$content = array(
- 'restart' => $_CONFIG['surfbar_restart_time'],
- 'start' => str_repeat("X", strlen($_CONFIG['surfbar_restart_time'])),
- 'autostart' => ($_CONFIG['surfbar_autostart'] == "Y") ? "true" : "false"
+ 'restart' => getConfig('surfbar_restart_time'),
+ 'start' => str_repeat("X", strlen(getConfig('surfbar_restart_time'))),
+ 'autostart' => (getConfig('surfbar_autostart') == "Y") ? "true" : "false"
);
// Load template for stopped surfbar
»<em>$content[api_md5]</em>«
</TD>
</TR>
+ <TR>
+ <TD width="300" align="right">{--PRIMERA_ADMIN_REFID--}:</TD>
+ <TD class="seperator" width="10"> </TD>
+ <TD width="270"><INPUT type="text" name="primera_refid"
+ class="admin_normal" value="$content[refid]" size="10"
+ maxlength="255" /></TD>
+ </TR>
+ <TR>
+ <TD colspan="3" class="seperator" height="5"> </TD>
+ </TR>
<TR>
<TD colspan="3" class="seperator" height="5"> </TD>
</TR>
</tr>
<tr><td height="3" colspan="2" class="seperator bottom2"> </td></tr>
<tr><td height="3" colspan="2" class="seperator"> </td></tr>
+ <tr>
+ <td height="30" align="right" style="padding-right:5px">
+ {--ADMIN_CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK--}
+ </td>
+ <td align="center">
+ <input type="radio" name="surfbar_notify_admin_unlock" value="Y"{!__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_Y!} /> {--YES--}
+ <input type="radio" name="surfbar_notify_admin_unlock" value="N"{!__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_N!} /> {--NO--}
+ </td>
+ </tr>
+ <tr><td height="3" colspan="2" class="seperator bottom2"> </td></tr>
+ <tr><td height="3" colspan="2" class="seperator"> </td></tr>
<tr>
<td height="30" align="right" style="padding-right:5px">
{--ADMIN_CONFIG_SURFBAR_NOTIFICATION_MODE--}
<TR>
<TD width="315" height="35" align="right">{--PRIMERA_MEMBER_NICKNAME--}</TD>
<TD width="10" class="seperator"> </TD>
- <TD width="115"><INPUT type="text" name="primus_nickname" size="10" maxlength="255" value="$content[primus_nickname]" /></TD>
+ <TD width="115"><INPUT type="text" name="primera_nickname" size="10" maxlength="255" value="$content[primera_nickname]" /></TD>
</TR>
<TR>
<TD width="315" height="35" align="right">{--PRIMERA_MEMBER_PASSWORD--}</TD>