} // END - while
// Handle bonus points
- handleBonusPoints(getConfig('bonus_stats'), $content['userid']);
+ handleBonusPoints(getBonusStats(), $content['userid']);
} // END - if
// Free memory
// Is there cache?
if (!isset($GLOBALS['bonus_rallye_active'])) {
// Just determine it
- $GLOBALS['bonus_rallye_active'] = (getConfig('bonus_active') == 'Y');
+ $GLOBALS['bonus_rallye_active'] = (getBonusActive() == 'Y');
} // END - if
// Return cache
// Is there cache?
if (!isset($GLOBALS['bonus_new_member_notify_active'])) {
// Just determine it
- $GLOBALS['bonus_new_member_notify_active'] = (getConfig('bonus_new_member_notify') == 'Y');
+ $GLOBALS['bonus_new_member_notify_active'] = (getBonusNewMemberNotify() == 'Y');
} // END - if
// Return cache
return $GLOBALS[__FUNCTION__];
}
+// Getter for bonus_active
+function getBonusActive () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('bonus_active');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// Getter for bonus_notify_points
+function getBonusNotifyPoints () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('bonus_notify_points');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// Getter for bonus_new_member_notify
+function getBonusNewMemberNotify () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('bonus_new_member_notify');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// Getter for bonus_stats
+function getBonusStats () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('bonus_stats');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// Getter for bonus_order
+function getBonusOrder () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('bonus_order');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// Getter for bonus_lines
+function getBonusLines () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('bonus_lines');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// Getter for bonus_include_own
+function getBonusIncludeOwn () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('bonus_include_own');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// Getter for bonus_disable_notify
+function getBonusDisableNotify () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('bonus_disable_notify');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// Getter for bonus_enable_notify
+function getBonusEnableNotify () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('bonus_enable_notify');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
// [EOF]
?>
SQL_FREERESULT($result_stop);
}
+// ----------------------------------------------------------------------------
+// Wrapper functions for configuration entries
+// ----------------------------------------------------------------------------
+
+// Getter for user_alpha
+function getHolidayLock () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('holiday_lock');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
// [EOF]
?>
} // END - if
// Is the timeout reached?
- if ($probe >= getConfig('login_timeout')) {
+ if ($probe >= getLoginTimeout()) {
// Add login bonus to user's account
$add = ',`login_bonus`=`login_bonus`+{?login_bonus?}';
$GLOBALS['bonus_payed'] = TRUE;
array(bigintval($refid)), __FILE__, __LINE__);
// Subtract points from system
- handleBonusPoints(getConfig('bonus_ref'), $refid);
+ handleBonusPoints(getBonusRef(), $refid);
} // END - if
// Add one-time referral bonus over referral system or directly
// Shall I sent activation or deactivation mail?
$sql = "SELECT `userid`, `email` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE (`bonus_rallye_enable_notify` ";
-switch (getConfig('bonus_active')) {
+switch (getBonusActive()) {
case 'Y': // Active rallye is activated
- if (getConfig('bonus_enable_notify') == 'Y') {
+ if (getBonusEnableNotify() == 'Y') {
// Okay, let's check for member accounts
$sql .= '= 0 OR (`bonus_rallye_enable_notify` > 0 AND `bonus_rallye_enable_notify` < `bonus_rallye_disable_notify`)';
$mode = 'enable';
break;
case 'N': // Active rallye is deactivated
- if (getConfig('bonus_disable_notify') == 'Y') {
+ if (getBonusDisableNotify() == 'Y') {
// Okay, let's check for member accounts
$sql .= ' > 0 AND `bonus_rallye_disable_notify` < `bonus_rallye_enable_notify`';
$mode = 'disable';
$sql .= ')' . runFilterChain('user_exclusion_sql', " AND `status`='CONFIRMED'") . ' ORDER BY `last_online` ASC';
// Normal notification mails or bonus mails?
- $sentBonusMails = ((getConfig('bonus_notify_points') > 0) && ($mode == 'enable') && (isExtensionActive('bonus')));
+ $sentBonusMails = ((getBonusNotifyPoints() > 0) && ($mode == 'enable') && (isExtensionActive('bonus')));
// Load message body for bonus mails
$message = loadEmailTemplate('bonus_enable_notify_body', '', '{PER}userid{PER}');
$url = 'modules.php?module=index&what=login';
// Insert mail
- addBonusMailToQueue('{--MEMBER_BONUS_RALLYE_' . strtoupper($mode) . '_SUBJECT--}', $message, $receiver, getConfig('bonus_notify_points'), getConfig('bonus_notify_wait'), $url, 0, 'normal', SQL_NUMROWS($result_main));
+ addBonusMailToQueue('{--MEMBER_BONUS_RALLYE_' . strtoupper($mode) . '_SUBJECT--}', $message, $receiver, getBonusNotifyPoints(), getConfig('bonus_notify_wait'), $url, 0, 'normal', SQL_NUMROWS($result_main));
} // END - if
} // END - if
array(bigintval($content['sender'])), __FILE__, __LINE__);
// Subtract bonus points from system
- handleBonusPoints(getConfig('bonus_order'), $content['sender']);
+ handleBonusPoints(getBonusOrder(), $content['sender']);
} // END - if
// Load email template
$count++;
} // END - while
-if ($count < getConfig('top10_max')) {
+if ($count < getTop10Max()) {
// Add more "blank" rows
- for ($i = $count; $i <= getConfig('top10_max'); $i++) {
+ for ($i = $count; $i <= getTop10Max(); $i++) {
// Prepare data for template
$content = array(
'index' => $i
$count++;
} // END - while
-if ($count < getConfig('top10_max')) {
+if ($count < getTop10Max()) {
// Add more "blank" rows
- for ($i = $count; $i <= getConfig('top10_max'); $i++) {
+ for ($i = $count; $i <= getTop10Max(); $i++) {
// Prepare data for template
$content = array(
'index' => $i
$count++;
} // END - while
-if ($count < getConfig('top10_max')) {
+if ($count < getTop10Max()) {
// Add more "blank" rows
- for ($i = $count; $i <= getConfig('top10_max'); $i++) {
+ for ($i = $count; $i <= getTop10Max(); $i++) {
// Prepare data for template
$content = array(
'index' => $i
if (empty($content['timestamp'])) $content['timestamp'] = '0';
if (empty($content['timestamp_ordered'])) $content['timestamp_ordered'] = '0';
- if ((($content['timestamp'] + getConfig('holiday_lock')) > time()) || (($content['timestamp_ordered'] + getConfig('holiday_lock')) > time())) {
+ if ((($content['timestamp'] + getHolidayLock()) > time()) || (($content['timestamp_ordered'] + getHolidayLock()) > time())) {
// Mail order is to close away!
unsetPostRequestElement('ok');
unsetPostRequestElement('stop');
- if (($content['timestamp'] + getConfig('holiday_lock')) > time()) {
+ if (($content['timestamp'] + getHolidayLock()) > time()) {
// Mail found in pool
$stamp = $content['timestamp'];
} else {
} else {
// Everything went okay so let's store his request and send mails
SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_holidays` (`userid`, `holiday_start`, `holiday_end`, `comments`) VALUES ('%s','%s','%s','%s')",
- array(getMemberId(), $START, $content['holiday_end'], postRequestElement('comments')), __FILE__, __LINE__);
+ array(
+ getMemberId(),
+ $START,
+ $content['holiday_end'],
+ postRequestElement('comments')
+ ), __FILE__, __LINE__);
// Activate holiday system
SQL_QUERY_ESC("UPDATE
// Merge arrays
$content = merge_array($content, SQL_FETCHARRAY($result));
- if (($content['holiday_active'] == 'Y') && (($content['holiday_activated'] + getConfig('holiday_lock')) < time())) {
+ if (($content['holiday_active'] == 'Y') && (($content['holiday_activated'] + getHolidayLock()) < time())) {
// Load data
$result2 = SQL_QUERY_ESC("SELECT
`holiday_start`,
SQL_FREERESULT($result);
// Check for lock
- if (($content['holiday_activated'] + getConfig('holiday_lock')) < time()) {
+ if (($content['holiday_activated'] + getHolidayLock()) < time()) {
// User can deactivate his holiday request
switch ($content['holiday_active']) {
case 'Y': // Display deactivation form
return $GLOBALS[__FUNCTION__];
}
+// Getter for 'index_delay'
+function getIndexDelay () {
+ // Is the cache entry set?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // No, so determine it
+ $GLOBALS[__FUNCTION__] = getConfig('index_delay');
+ } // END - if
+
+ // Return cached entry
+ return $GLOBALS[__FUNCTION__];
+}
+
// Checks whether 'ap_server_name' is 'Y'
function isApServerNameEnabled () {
// Is the cache entry set?
//////////////////////////////////////////////////
// Check for cookies
-if ((isSessionVariableSet('visited')) || (getConfig('index_delay') > -1)) {
+if ((isSessionVariableSet('visited')) || (getIndexDelay() > -1)) {
// Set content type
setContentType('text/html');
loadTemplate('index');
// Shall I insert an automated forward?
- if (getConfig('index_delay') > 0) {
+ if (getIndexDelay() > 0) {
// This will be a JavaScript-redirect!
- $content['delay'] = (getConfig('index_delay') * 1000 + 500);
+ $content['delay'] = (getIndexDelay() * 1000 + 500);
$content['module'] = 'index';
// Load template
// Is an active-rallye running and this is not a notification mail?
if ((isBonusRallyeActive()) && ($data['is_notify'] != 'Y')) {
// Shall I exclude the webmaster's own userid from the active-rallye?
- if ((((getBonusUserid() == $userId) && (getConfig('bonus_include_own') == 'Y')) || (getBonusUserid() != $userId)) && (getDefRefid() != $userId)) {
+ if ((((getBonusUserid() == $userId) && (getBonusIncludeOwn() == 'Y')) || (getBonusUserid() != $userId)) && (getDefRefid() != $userId)) {
// Add points and remember ranking are done in this function....
addTurboBonus($urlId, $userId, $type);