./beg.php:171: // @TODO Opps, what is missing here???
./birthday_confirm.php:93: // @TODO Try to rewrite the following unset()
./inc/autopurge/purge-inact.php:55: // @TODO Rewrite these if() blocks to a filter
-./inc/cache/config-local.php:126:// @TODO Rewrite the following three constants, somehow...
+./inc/cache/config-local.php:124:// @TODO Rewrite the following three constants, somehow...
./inc/classes/cachesystem.class.php:499: // @TODO Add support for more types which break in last else-block
./inc/config-functions.php:139: // @TODO Make this all better... :-/
./inc/expression-functions.php:164:// @TODO FILTER_COMPILE_CONFIG does not handle call-back functions so we handle it here again
./inc/modules/admin/what-unlock_emails.php:84: // @TODO Rewrite these if-blocks to a filter
./inc/modules/admin/what-usage.php:87: // @TODO This code is double, see loadTemplate() and loadEmailTemplate() in functions.php
./inc/modules/admin/what-usr_online.php:49: // @TODO Add a filter for sponsor
-./inc/modules/guest/what-beg.php:51:// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getConfig('beg_userid_timeout')));
+./inc/modules/guest/what-beg.php:51:// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getBegUseridTimeout()));
./inc/modules/guest/what-login.php:121: // @TODO Move this HTML code into a template
./inc/modules/guest/what-mediadata.php:181:// @TODO Rewrite all these if-blocks to filters
./inc/modules/guest/what-mediadata.php:68: // @TODO Find a better formular than this one
./inc/modules/guest/what-stats.php:100: // @TODO This can be somehow rewritten
./inc/modules/guest/what-stats.php:74:// @TODO This can be rewritten in a dynamic include
./inc/modules/member/what-beg.php:54:// @TODO Can't this be moved into EL?
-./inc/modules/member/what-beg.php:63:// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getConfig('beg_userid_timeout')));
+./inc/modules/member/what-beg.php:63:// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getBegUseridTimeout()));
./inc/modules/member/what-bonus.php:55: // @TODO Rewrite this to a filter
./inc/modules/member/what-categories.php:131: // @TODO Rewrite this to use $OUT .= ...
./inc/modules/member/what-order.php:426: // @TODO Rewrite this to a filter
* 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((getConfig('beg_points') * 100000), (getConfig('beg_points_max') * 100000)) / 100000;
+ $points = mt_rand((getBegPoints() * 100000), (getBegPointsMax() * 100000)) / 100000;
// Set nickname / userid for template
$content['userid'] = getRequestParameter('userid');
} // END - if
// User id valid and not webmaster's id?
- if ((isValidUserId(getUserData('userid'))) && (getConfig('beg_userid') != getUserData('userid'))) {
+ if ((isValidUserId(getUserData('userid'))) && (getBegUserid() != getUserData('userid'))) {
// Update counter
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `beg_clicks`=`beg_clicks`+1 WHERE `userid`=%s LIMIT 1",
array(getUserData('userid')), __FILE__, __LINE__);
array(getUserData('userid'), detectRemoteAddr(), session_id()), __FILE__, __LINE__);
// Entry not found, points set and not logged in?
- if (((SQL_HASZERONUMS($result)) || (isAdmin())) && ($points > 0) && (!isMember()) && (getConfig('beg_pay_mode') == 'NONE')) {
+ if (((SQL_HASZERONUMS($result)) || (isAdmin())) && ($points > 0) && (!isMember()) && (getBegPayMode() == 'NONE')) {
// Admin is testing?
if (!isAdmin()) {
/*
} elseif (isMember()) {
// Logged in user found!
$content['message'] = loadTemplate('beg_login', true, $content);
- } elseif (getConfig('beg_pay_mode') != 'NONE') { // Other pay-mode active!
+ } elseif (getBegPayMode() != 'NONE') { // Other pay-mode active!
// Load message template depending on pay-mode
- $content['message'] = loadTemplate('beg_pay_mode_'.strtolower(getConfig('beg_pay_mode')), true, $content);
+ $content['message'] = loadTemplate('beg_pay_mode_'.strtolower(getBegPayMode()), true, $content);
$pay = true;
} else {
// Clicked received while reload lock is active
loadTemplate('beg_link', false, $content);
// Tracker code enabled? (We don't track users here!
- if ((getConfig('beg_pay_mode') != 'NONE') && ($pay === true)) {
+ if ((getBegPayMode() != 'NONE') && ($pay === true)) {
// Prepare content for template
// @TODO Opps, what is missing here???
$content = array(
);
// Include config-depending template
- loadTemplate('beg_pay_code_'.strtolower(getConfig('beg_pay_mode')), false, $content);
+ loadTemplate('beg_pay_code_'.strtolower(getBegPayMode()), false, $content);
} elseif (($pay === false) && (!isset($content['message']))) {
// Cannot pay! :-(
$content['message'] = loadTemplate('beg_failed', true);
// Invalid nickname! (404)
$errorCode = getCode('USER_404');
}
- } elseif (getUserData('userid') == getConfig('beg_userid')) {
+ } elseif (getUserData('userid') == getBegUserid()) {
// Webmaster's id cannot beg for points!
$errorCode = getCode('BEG_SAME_AS_OWN');
}
case 'init': // When extension is initialized
// Remove old entries
- $OLD = getConfig('beg_timeout');
- if (getConfig('beg_userid_timeout') > $OLD) $OLD = getConfig('beg_userid_timeout');
+ $OLD = getBegTimeout();
+ if (getBegUseridTimeout() > $OLD) $OLD = getBegUseridTimeout();
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
// Add points to account
// @TODO Try to rewrite the following unset()
unset($GLOBALS['ref_level']);
- $added = addPointsThroughReferalSystem('beg', $userid, $points, false, 0, strtolower(getConfig('beg_mode')));
+ $added = addPointsThroughReferalSystem('beg', $userid, $points, false, 0, strtolower(getBegMode()));
}
// Subtract begged points from member account if the admin has selected one
- if (getConfig('beg_userid') > 0) {
+ if (getBegUserid() > 0) {
// Subtract from this account
- subtractPoints('beg_payout', getConfig('beg_userid'), $points);
+ subtractPoints('beg_payout', getBegUserid(), $points);
} // END - if
// Return result
return $added;
}
-// Checks wether beg_rallye is enabled
-function isBegRallyeEnabled () {
+// ----------------------------------------------------------------------------
+// Wrapper functions for ext-beg
+// ----------------------------------------------------------------------------
+
+// "Getter" for beg_new_member_notify
+function getBegNewMemberNotify () {
// Do we have cache?
if (!isset($GLOBALS[__FUNCTION__])) {
- // Determine it
- $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('beg', '0.2.8')) && (getConfig('beg_rallye') == 'Y'));
+ // Get it
+ $GLOBALS[__FUNCTION__] = getConfig('beg_new_member_notify');
} // END - if
// Return cache
return $GLOBALS[__FUNCTION__];
}
-// Checks wether beg_rallye is enabled
+// Checks wether beg_new_member_notify is enabled
function isBegNewMemberNotifyEnabled () {
// Do we have cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
- $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('beg', '0.2.7')) && (getConfig('beg_new_member_notify') == 'Y'));
+ $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('beg', '0.2.7')) && (getBegNewMemberNotify() == 'Y'));
} // END - if
// Return cache
return $GLOBALS[__FUNCTION__];
}
+// "Getter" for beg_timeout
+function getBegTimeout () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('beg_timeout');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_userid_timeout
+function getBegUseridTimeout () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('beg_userid_timeout');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_ip_timeout
+function getBegIpTimeout () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('beg_ip_timeout');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_ranks
+function getBegRanks () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('beg_ranks');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_points_max
+function getBegPointsMax () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('beg_points_max');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_points
+function getBegPoints () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('beg_points');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_notify_bonus
+function getBegNotifyBonus () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('beg_notify_bonus');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_notify_wait
+function getBegNotifyWait () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('beg_notify_wait');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_pay_mode
+function getBegPayMode () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('beg_pay_mode');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_mode
+function getBegMode () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('beg_mode');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_include_own
+function getBegIncludeOwn () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('beg_include_own');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// Checks wether beg_include_own is "Y"
+function isBegIncludeOwnEnabled () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = (getBegIncludeOwn() == 'Y');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_active
+function getBegActive () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('beg_active');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// Checks wether beg_active is "Y"
+function isBegActiveEnabled () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = (getBegActive() == 'Y');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_rallye
+function getBegRallye () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('beg_rallye');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// Checks wether beg_rallye is "Y"
+function isBegRallyeEnabled () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = (getBegRallye() == 'Y');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_rallye_enable_notify
+function getBegRallyeEnableNotify () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('beg_rallye_enable_notify');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// Checks wether beg_rallye_enable_notify is "Y"
+function isBegRallyeEnableNotifyEnabled () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = (getBegRallyeEnableNotify() == 'Y');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_rallye_disable_notify
+function getBegRallyeDisableNotify () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('beg_rallye_disable_notify');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// Checks wether beg_rallye_disable_notify is "Y"
+function isBegRallyeDisableNotifyEnabled () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = (getBegRallyeDisableNotify() == 'Y');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
// [EOF]
?>
return $GLOBALS[__FUNCTION__];
}
+// Getter for bonus_ranks
+function getBonusRanks () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('bonus_ranks');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
// [EOF]
?>
// Some security stuff...
if (!defined('__SECURITY')) {
die();
-}
+} // END - if
// Generates a HTML table based on given data
// @TODO Lame description
return $points;
}
+// ----------------------------------------------------------------------------
+// Wrapper functions for ext-doubler
+// ----------------------------------------------------------------------------
+
// "Getter" for doubler_userid
function getDoublerUserid () {
// Is it cached?
return $GLOBALS['doubler_userid'];
}
+// "Getter" for doubler_timeout
+function getDoublerTimeout () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('doubler_timeout');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for doubler_send_mode
+function getDoublerSendMode () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('doubler_send_mode');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for doubler_ref
+function getDoublerRef () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('doubler_ref');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for doubler_points
+function getDoublerPoints () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('doubler_points');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for doubler_min
+function getDoublerMin () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('doubler_min');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for doubler_max
+function getDoublerMax () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('doubler_max');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for doubler_counter
+function getDoublerCounter () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('doubler_counter');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for doubler_charge
+function getDoublerCharge () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('doubler_charge');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
// [EOF]
?>
// Shall I sent activation or deactivation mail?
$sql = "SELECT `userid`, `email` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE (`beg_rallye_enable_notify` ";
-switch (getConfig('beg_rallye')) {
+switch (getBegRallye()) {
case 'Y': // Begging rallye is activated
- if (getConfig('beg_rallye_enable_notify') == 'Y') {
+ if (isBegRallyeEnableNotifyEnabled()) {
// Okay, let's check for member accounts
$sql .= '= 0 OR (`beg_rallye_enable_notify` > 0 AND `beg_rallye_enable_notify` < `beg_rallye_disable_notify`)';
$mode = 'enable';
break;
case 'N': // Begging rallye is deactivated
- if (getConfig('beg_rallye_disable_notify') == 'Y') {
+ if (isBegRallyeDisableNotifyEnabled()) {
// Okay, let's check for member accounts
$sql .= ' > 0 AND `beg_rallye_disable_notify` < `beg_rallye_enable_notify`';
$mode = 'disable';
// No IP locking setuped by default
$content['ip_locker'] = '{--BEG_NO_LIMITATION--}';
- if (getConfig('beg_ip_timeout') > 0) {
+ if (getBegIpTimeout() > 0) {
// Create timemark
$content['ip_locker'] = '{%config,createFancyTime=beg_ip_timeout%}';
} // END - if
$result_main = SQL_QUERY($sql, __FILE__, __LINE__);
if (!SQL_HASZERONUMS($result_main)) {
// Normal notification mails or bonus mails?
- $sentBonusMails = ((getConfig('beg_notify_bonus') > 0) && ($mode == 'enable') && (isExtensionActive('bonus')));
+ $sentBonusMails = ((getBegNotifyBonus() > 0) && ($mode == 'enable') && (isExtensionActive('bonus')));
// Load message body for bonus mails
$message = loadEmailTemplate('beg_enable_notify_body', '', '{PER}userid{PER}');
$url = 'modules.php?module=index&what=login';
// Insert mail
- addBonusMailToQueue('{--BEG_RALLYE_' . strtoupper($mode) . '_SUBJECT--}', $message, $receiver, getConfig('beg_notify_bonus'), getConfig('beg_notify_wait'), $url, 0, 'normal', SQL_NUMROWS($result_main));
+ addBonusMailToQueue('{--BEG_RALLYE_' . strtoupper($mode) . '_SUBJECT--}', $message, $receiver, getBegNotifyBonus(), getBegNotifyWait(), $url, 0, 'normal', SQL_NUMROWS($result_main));
} // END - if
} // END - if
setConfigEntry('beg_rallye_disable_notify', postRequestParameter('beg_rallye_disable_notify'));
} else {
// Prepare constants for the template
- $content['points'] = translateComma(getConfig('beg_points') , false);
- $content['points_max'] = translateComma(getConfig('beg_points_max') , false);
- $content['notify_bonus'] = translateComma(getConfig('beg_notify_bonus'), false);
- $content['timeout'] = createTimeSelections(getConfig('beg_timeout') , 'beg_timeout' , 'Dhm');
- $content['userid_timeout'] = createTimeSelections(getConfig('beg_userid_timeout'), 'beg_userid_timeout', 'Dhm');
- $content['ip_timeout'] = createTimeSelections(getConfig('beg_ip_timeout') , 'beg_ip_timeout' , 'Dhm');
- $content['wait_selection'] = createTimeSelections(getConfig('beg_notify_wait') , 'beg_notify_wait' , 'ms' );
+ $content['points'] = translateComma(getBegPoints() , false);
+ $content['points_max'] = translateComma(getBegPointsMax() , false);
+ $content['notify_bonus'] = translateComma(getBegNotifyBonus() , false);
+ $content['timeout'] = createTimeSelections(getBegTimeout() , 'beg_timeout' , 'Dhm');
+ $content['userid_timeout'] = createTimeSelections(getBegUseridTimeout(), 'beg_userid_timeout', 'Dhm');
+ $content['ip_timeout'] = createTimeSelections(getBegIpTimeout() , 'beg_ip_timeout' , 'Dhm');
+ $content['wait_selection'] = createTimeSelections(getBegNotifyWait() , 'beg_notify_wait' , 'ms' );
// Init all Y/N selections
foreach (array('rallye', 'active', 'mode', 'rallye_enable_notify', 'rallye_disable_notify', 'new_member_notify', 'include_own') as $entry) {
} // END - foreach
// Set default faker-mode
- $content['pay_mode_' . strtolower(getConfig('beg_pay_mode'))] = ' selected="selected"';
+ $content['pay_mode_' . strtolower(getBegPayMode())] = ' selected="selected"';
// Init beg_mode elements
foreach (array('direct', 'ref') as $entry) {
} // END - foreach
// Set default mode
- $content['beg_mode_' . strtolower(getConfig('beg_mode'))] = ' checked="checked"';
+ $content['beg_mode_' . strtolower(getBegMode())] = ' checked="checked"';
// Member selection box
- $content['form_selection'] = addMemberSelectionBox(getConfig('beg_userid'), false, true, true, 'beg_userid');
+ $content['form_selection'] = addMemberSelectionBox(getBegUserid(), false, true, true, 'beg_userid');
// Load form template
loadTemplate('admin_config_beg', false, $content);
$WIN1 = ''; $WIN2 = '';
// Maybe he can win his active beg?
- if ($count <= getConfig('beg_ranks')) {
+ if ($count <= getBegRanks()) {
// Mark him
$WIN1 = '<strong>';
$WIN2 = '</strong>';
return;
} // END - if
-// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getConfig('beg_userid_timeout')));
+// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getBegUseridTimeout()));
// Load final template
loadTemplate('guest_beg');
$content['userid'] = getMemberId();
}
-// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getConfig('beg_userid_timeout')));
+// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getBegUseridTimeout()));
// Load template
loadTemplate('member_beg', false, $content);
//* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'Monthly reset started.');
// Check if month is done
-if ((getConfig('beg_ranks') > 0) && (!isCssOutputMode())) {
+if ((getBegRanks() > 0) && (!isCssOutputMode())) {
// Extension 'autopurge' is inactive or purging of inactive accounts is deactivated
$whereStatement1 = '';
// Shall we exclude webmaster's own userid?
- if ((getConfig('beg_include_own') != 'Y') && (isValidUserId(getConfig('beg_userid')))) {
+ if ((!isBegIncludeOwnEnabled()) && (isValidUserId(getBegUserid()))) {
// Exclude it
$whereStatement1 = " AND `userid` != {?beg_userid?}";
} // END - if
// Let's check if there are some points left we can pay...
if (isExtensionActive('autopurge')) {
// Use last online stamp only when autopurge for inactive members is activated
- if ((getApInactiveSince() > 0) && (getConfig('beg_active') == 'Y')) {
+ if ((getApInactiveSince() > 0) && (isBegActiveEnabled()) {
// Okay, include last online timestamp
$whereStatement1 .= " AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})";
} // END - if
return $GLOBALS[__FUNCTION__];
}
+// "Getter" for __DB_NAME
+function getDbName () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('__DB_NAME');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
// Checks wether proxy configuration is used
function isProxyUsed () {
// Do we have cache?