./inc/libs/rallye_functions.php:910: // Load count @TODO Can't we rewrite this to our API?
./inc/libs/refback_functions.php:61: // @TODO Try to rewrite the following unset()
./inc/libs/register_functions.php:292: // @TODO Rewrite these all to a single filter
-./inc/libs/register_functions.php:371: // @TODO Rewrite this to a filter
-./inc/libs/register_functions.php:378: // @TODO Wether the registration bonus should only be added to user directly or through referal system should be configurable
+./inc/libs/register_functions.php:365: // @TODO Rewrite this to a filter
+./inc/libs/register_functions.php:372: // @TODO Wether the registration bonus should only be added to user directly or through referal system should be configurable
./inc/libs/surfbar_functions.php:1540: // @TODO This can be somehow rewritten
./inc/libs/surfbar_functions.php:712:// @TODO Can't we use our new expression language instead of this ugly code?
./inc/libs/surfbar_functions.php:953: // @TODO Invalid salt should be refused
$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 ((isBegRallyeEnabled()) && (getConfig('beg_new_member_notify') == 'Y')) {
+ if ((isBegRallyeEnabled()) && (isBegNewMemberNotifyEnabled())) {
// 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 ((isExtensionInstalledAndNewer('bonus', '0.9.1')) && (isBonusRallyeActive()) && (getConfig('bonus_new_member_notify') == 'Y')) {
+ if ((isBonusRallyeActive()) && (isBonusNewMemberNotifyEnabled())) {
// Include file for sending out mails
addIncludeToPool('notify', 'inc/mails/bonus_mails.php');
} // END - if
return $GLOBALS['is_beg_rallye_enabled'];
}
+// Checks wether beg_rallye is enabled
+function isBegNewMemberNotifyEnabled () {
+ // Do we have cache?
+ if (!isset($GLOBALS['is_beg_new_member_notify_enabled'])) {
+ // Determine it
+ $GLOBALS['is_beg_new_member_notify_enabled'] = ((isExtensionInstalledAndNewer('beg', '0.2.7')) && (getConfig('beg_new_member_notify') == 'Y'));
+ } // END - if
+
+ // Return cache
+ return $GLOBALS['is_beg_new_member_notify_enabled'];
+}
+
// "Getter" for beg_userid
function getBegUserid () {
// Do we have cache?
}
}
+///////////////////////////////////////////////////////////////////////////////
+// Wrapper functions //
+///////////////////////////////////////////////////////////////////////////////
+
// Determines wether the "bonus rallye" is active
function isBonusRallyeActive () {
// Do we have cache?
return $GLOBALS['bonus_rallye_active'];
}
+// Determines wether the "bonus new_member_notify" is active
+function isBonusNewMemberNotifyEnabled () {
+ // Do we have cache?
+ if (!isset($GLOBALS['bonus_new_member_notify_active'])) {
+ // Just determine it
+ $GLOBALS['bonus_new_member_notify_active'] = (getConfig('bonus_new_member_notify') == 'Y');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS['bonus_new_member_notify_active'];
+}
+
// [EOF]
?>
$GLOBALS['register_sql_data'] = '';
if (isExtensionInstalledAndNewer('theme', '0.0.8')) {
// Okay, add design here
- $GLOBALS['register_sql_columns'] = ', `curr_theme`';
- $GLOBALS['register_sql_data'] = ", '" . getCurrentTheme() . "'";
+ $GLOBALS['register_sql_columns'] .= ', `curr_theme`';
+ $GLOBALS['register_sql_data'] .= ", '" . getCurrentTheme() . "'";
} // END - if
// Check if I shall disable sending mail to newly registered members out about active/begging rallye
//
// First comes first: begging rallye
- if (isExtensionInstalledAndNewer('beg', '0.2.8')) {
- // Okay, shall I disable now?
- if (getConfig('beg_new_member_notify') != 'Y') {
- $GLOBALS['register_sql_columns'] .= ', `beg_rallye_enable_notify`, `beg_rallye_disable_notify`';
- $GLOBALS['register_sql_data'] .= ', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()';
- } // END - if
+ if (!isBegNewMemberNotifyEnabled()) {
+ $GLOBALS['register_sql_columns'] .= ', `beg_rallye_enable_notify`, `beg_rallye_disable_notify`';
+ $GLOBALS['register_sql_data'] .= ', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()';
} // END - if
// Second: active rallye
- if (isExtensionInstalledAndNewer('bonus', '0.9.2')) {
- // Okay, shall I disable now?
- if (getConfig('bonus_new_member_notify') != 'Y') {
- $GLOBALS['register_sql_columns'] .= ', `bonus_rallye_enable_notify`, `bonus_rallye_disable_notify`';
- $GLOBALS['register_sql_data'] .= ', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()';
- } // END - if
+ if (!isBonusNewMemberNotifyEnabled()) {
+ $GLOBALS['register_sql_columns'] .= ', `bonus_rallye_enable_notify`, `bonus_rallye_disable_notify`';
+ $GLOBALS['register_sql_data'] .= ', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()';
} // END - if
// Write user data to table