$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 ((getConfig('beg_rallye') == 'Y') && (getExtensionVersion('beg') >= '0.2.8') && (getConfig('beg_new_member_notify') == 'Y')) {
+ if ((isBegRallyeEnabled()) && (getConfig('beg_new_member_notify') == 'Y')) {
// Include file for sending out mails
addIncludeToPool('notify', 'inc/mails/beg_mails.php');
} // END - if
case 'init': // Do stuff when extension is initialized
// Check for bonus rallye is active and send mails out
- if ((getExtensionVersion('bonus') >= '0.9.1') && (isBonusRallyeActive()) && (getConfig('bonus_new_member_notify') == 'Y')) {
+ if ((isExtensionInstalledAndNewer('bonus', '0.9.1')) && (isBonusRallyeActive()) && (getConfig('bonus_new_member_notify') == 'Y')) {
// Include file for sending out mails
addIncludeToPool('notify', 'inc/mails/bonus_mails.php');
} // END - if
// Some security stuff...
if (!defined('__SECURITY')) {
die();
-}
+} // END - if
// Add points to user or begging rallye account
function addPointsBeg ($userid, $points) {
// Is begging rallye active?
- if (getConfig('beg_rallye') == 'Y') {
+ if (isBegRallyeEnabled()) {
// 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, $userid), __FUNCTION__, __LINE__);
} // END - if
}
+// Checks wether beg_rallye is enabled
+function isBegRallyeEnabled () {
+ // Do we have cache?
+ if (!isset($GLOBALS['is_beg_rallye_enabled'])) {
+ // Determine it
+ $GLOBALS['is_beg_rallye_enabled'] = ((isExtensionInstalledAndNewer('beg', '0.2.8')) && (getConfig('beg_rallye') == 'Y'));
+ } // END - if
+
+ // Return cache
+ return $GLOBALS['is_beg_rallye_enabled'];
+}
+
// [EOF]
?>
$entries = array('id','title','locked','hidden','admin_only','mem_only');
// Is ext-sql_patches newer or equal 0.3.6?
- if ((isExtensionInstalled('sql_patches')) && (getExtensionVersion('sql_patches') >= '0.3.6')) {
+ if (isExtensionInstalledAndNewer('sql_patches', '0.3.6')) {
// Add 'has_menu'
$entries[] = 'has_menu';
} // END - if
// Some security stuff...
if ((!defined('__SECURITY')) || (!isAdmin())) {
die();
-}
+} // END - if
// Add description as navigation point
addMenuDescription('admin', __FILE__);
-if (getConfig('beg_rallye') == 'Y') {
+if (isBegRallyeEnabled()) {
// Shall I withdraw now?
if (isPostRequestParameterSet('withdraw')) {
// Okay, let's prepare...
} elseif ((getScriptOutputMode() == 1) || (!isResetModeEnabled())) {
// Do not execute when script is in CSS mode or no daily reset
return;
-} elseif ((!isExtensionActive('beg')) || (getConfig('beg_rallye') != 'Y')) {
+} elseif ((!isExtensionActive('beg')) || (!isBegRallyeEnabled())) {
logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension disabled.');
return;
}
} elseif ((getScriptOutputMode() != 0) || (!isResetModeEnabled())) {
// Do not execute when script is in CSS mode or no daily reset
return;
-} elseif ((!isExtensionActive('beg')) || (getConfig('beg_rallye') == 'Y')) {
+} elseif ((!isExtensionActive('beg')) || (!isBegRallyeEnabled())) {
logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension disabled.');
return;
}
// Do we have cache?
if (!isset($GLOBALS['is_proxy_used'])) {
// Determine it
- $GLOBALS['is_proxy_used'] = ((getExtensionVersion('sql_patches') >= '0.4.3') && (getConfig('proxy_host') != '') && (getConfig('proxy_port') > 0));
+ $GLOBALS['is_proxy_used'] = ((isExtensionInstalledAndNewer('sql_patches', '0.4.3')) && (getConfig('proxy_host') != '') && (getConfig('proxy_port') > 0));
} // END - if
// Return cache