* $Author:: $ *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
- * Copyright (c) 2009 - 2012 by Mailer Developer Team *
+ * Copyright (c) 2009 - 2013 by Mailer Developer Team *
* For more information visit: http://mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
return ((isset($GLOBALS['hourly_enabled'])) && ($GLOBALS['hourly_enabled'] === TRUE));
}
-// Checks whether the reset mode is active
+// Checks whether the daily reset mode is active
+function isDailyResetEnabled () {
+ // Now simply check it
+ return ((isset($GLOBALS['daily_enabled'])) && ($GLOBALS['daily_enabled'] === TRUE));
+}
+
+// Checks whether the weekly reset mode is active
+function isWeeklyResetEnabled () {
+ // Now simply check it
+ return ((isset($GLOBALS['weekly_enabled'])) && ($GLOBALS['weekly_enabled'] === TRUE));
+}
+
+// Checks whether the monthly reset mode is active
+function isMonthlyResetEnabled () {
+ // Now simply check it
+ return ((isset($GLOBALS['monthly_enabled'])) && ($GLOBALS['monthly_enabled'] === TRUE));
+}
+
+// Checks whether one of the reset modes is enabled
function isResetModeEnabled () {
// Now simply check it
- return ((isset($GLOBALS['reset_enabled'])) && ($GLOBALS['reset_enabled'] === TRUE));
+ return ((isHourlyResetEnabled()) || (isDailyResetEnabled()) || (isWeeklyResetEnabled()) || (isMonthlyResetEnabled()));
}
// Checks whether the debug mode is enabled
return $GLOBALS[__FUNCTION__];
}
-// Checks whether the debug reset is enabled
-function isDebugResetEnabled () {
+// Checks whether the debug hourly is enabled
+function isDebugHourlyEnabled () {
+ // Is cache set?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Simply check it
+ $GLOBALS[__FUNCTION__] = ((isConfigEntrySet('DEBUG_HOURLY')) && (getConfig('DEBUG_HOURLY') == 'Y'));
+ } // END - if
+
+ // Return it
+ return $GLOBALS[__FUNCTION__];
+}
+
+// Checks whether the debug daily is enabled
+function isDebugDailyEnabled () {
+ // Is cache set?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Simply check it
+ $GLOBALS[__FUNCTION__] = ((isConfigEntrySet('DEBUG_DAILY')) && (getConfig('DEBUG_DAILY') == 'Y'));
+ } // END - if
+
+ // Return it
+ return $GLOBALS[__FUNCTION__];
+}
+
+// Checks whether the debug weekly is enabled
+function isDebugWeeklyEnabled () {
// Is cache set?
if (!isset($GLOBALS[__FUNCTION__])) {
// Simply check it
- $GLOBALS[__FUNCTION__] = ((isConfigEntrySet('DEBUG_RESET')) && (getConfig('DEBUG_RESET') == 'Y'));
+ $GLOBALS[__FUNCTION__] = ((isConfigEntrySet('DEBUG_WEEKLY')) && (getConfig('DEBUG_WEEKLY') == 'Y'));
+ } // END - if
+
+ // Return it
+ return $GLOBALS[__FUNCTION__];
+}
+
+// Checks whether the debug monthly is enabled
+function isDebugMonthlyEnabled () {
+ // Is cache set?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Simply check it
+ $GLOBALS[__FUNCTION__] = ((isConfigEntrySet('DEBUG_MONTHLY')) && (getConfig('DEBUG_MONTHLY') == 'Y'));
} // END - if
// Return it
// Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
- $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('other', '0.2.2')) && (getConfig('display_debug_sqls') == 'Y'));
+ $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('other', '0.2.2')) && (getDisplayDebugSqls() == 'Y'));
} // END - if
// Return cache
return $GLOBALS[__FUNCTION__];
}
+// "Getter" for internal_stats
+function getInternalStats () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('internal_stats');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
// Checks whether stats are enabled
function ifInternalStatsEnabled () {
// Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
- // Then determine it
- $GLOBALS[__FUNCTION__] = (getConfig('internal_stats') == 'Y');
+ // Then determine it, do not add isExtensionInstalledAndNewer() here as it breaks very first SQL query
+ $GLOBALS[__FUNCTION__] = ((isConfigEntrySet('internal_stats')) && (getInternalStats() == 'Y'));
} // END - if
// Return cached value
// Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
- $GLOBALS[__FUNCTION__] = (getConfig('admin_notify') == 'Y');
+ $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('other', '0.3.0')) && (getAdminNotify() == 'Y'));
} // END - if
// Return cache
return $GLOBALS[__FUNCTION__];
}
-// "Getter" for activate_xchange
-function getActivateXchange () {
+// "Getter" for img_type
+function getImgType () {
// Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
- $GLOBALS[__FUNCTION__] = getConfig('activate_xchange');
+ $GLOBALS[__FUNCTION__] = getConfig('img_type');
} // END - if
// Return cache
return $GLOBALS[__FUNCTION__];
}
-// "Getter" for img_type
-function getImgType () {
+// "Getter" for code_length
+function getCodeLength () {
// Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
- $GLOBALS[__FUNCTION__] = getConfig('img_type');
+ $GLOBALS[__FUNCTION__] = getConfig('code_length');
} // END - if
// Return cache
return $GLOBALS[__FUNCTION__];
}
-// "Getter" for code_length
-function getCodeLength () {
+// "Getter" for pass_len
+function getPassLen () {
// Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
- $GLOBALS[__FUNCTION__] = getConfig('code_length');
+ $GLOBALS[__FUNCTION__] = getConfig('pass_len');
} // END - if
// Return cache
return $GLOBALS[__FUNCTION__];
}
-// "Getter" for least_cats
-function getLeastCats () {
+// "Getter" for admin_menu
+function getAdminMenu () {
// Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
- $GLOBALS[__FUNCTION__] = getConfig('least_cats');
+ $GLOBALS[__FUNCTION__] = getConfig('admin_menu');
} // END - if
// Return cache
return $GLOBALS[__FUNCTION__];
}
-// "Getter" for pass_len
-function getPassLen () {
+// "Getter" for last_hourly
+function getLastHourly () {
// Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
- $GLOBALS[__FUNCTION__] = getConfig('pass_len');
+ $GLOBALS[__FUNCTION__] = getConfig('last_hourly');
} // END - if
// Return cache
return $GLOBALS[__FUNCTION__];
}
-// "Getter" for admin_menu
-function getAdminMenu () {
+// "Getter" for last_daily
+function getLastDaily () {
// Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
- $GLOBALS[__FUNCTION__] = getConfig('admin_menu');
+ $GLOBALS[__FUNCTION__] = getConfig('last_daily');
} // END - if
// Return cache
return $GLOBALS[__FUNCTION__];
}
-// "Getter" for last_month
-function getLastMonth () {
+// "Getter" for last_weekly
+function getLastWeekly () {
// Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
- $GLOBALS[__FUNCTION__] = getConfig('last_month');
+ $GLOBALS[__FUNCTION__] = getConfig('last_weekly');
} // END - if
// Return cache
return $GLOBALS[__FUNCTION__];
}
-// "Getter" for max_send
-function getMaxSend () {
+// "Getter" for last_monthly
+function getLastMonthly () {
// Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
- $GLOBALS[__FUNCTION__] = getConfig('max_send');
+ $GLOBALS[__FUNCTION__] = getConfig('last_monthly');
} // END - if
// Return cache
return $GLOBALS[__FUNCTION__];
}
-// Getter for 'check_double_email'
-function getCheckDoubleEmail () {
- // Is the cache entry set?
- if (!isset($GLOBALS[__FUNCTION__])) {
- // No, so determine it
- $GLOBALS[__FUNCTION__] = getConfig('check_double_email');
- } // END - if
-
- // Return cached entry
- return $GLOBALS[__FUNCTION__];
-}
-
-// Checks whether 'check_double_email' is 'Y'
-function isCheckDoubleEmailEnabled () {
- // Is the cache entry set?
- if (!isset($GLOBALS[__FUNCTION__])) {
- // No, so determine it
- $GLOBALS[__FUNCTION__] = (getCheckDoubleEmail() == 'Y');
- } // END - if
-
- // Return cached entry
- return $GLOBALS[__FUNCTION__];
-}
-
// Getter for 'display_home_in_index'
function getDisplayHomeInIndex () {
// Is the cache entry set?
return $GLOBALS[__FUNCTION__][$userid];
}
-// Wrapper to check if url_blacklist is enabled
-function isUrlBlacklistEnabled () {
- // Is there cache?
- if (!isset($GLOBALS[__FUNCTION__])) {
- // Determine it
- $GLOBALS[__FUNCTION__] = (getConfig('url_blacklist') == 'Y');
- } // END - if
-
- // Return cache
- return $GLOBALS[__FUNCTION__];
-}
-
// Checks whether direct payment is allowed in configuration
function isDirectPaymentEnabled () {
// Is there cache?
}
// Fills (prepend) a string with zeros. This function has been taken from user comments at de.php.net/str_pad
-function prependZeros ($mStretch, $length = 2) {
+function prependZeros ($str, $length = 2) {
// Return prepended string
- return sprintf('%0' . (int) $length . 's', $mStretch);
+ return sprintf('%0' . (int) $length . 's', $str);
}
// Wraps convertSelectionsToEpocheTime()
// Is the not level NULL?
if (!is_null($level)) {
// Then add referral level
- $add = ' AND r.`level`=' . bigintval($level);
+ $add = ' AND `r`.`level`=' . bigintval($level);
} // END - if
// Check for all referrals
$result = SQL_QUERY_ESC("SELECT
- COUNT(d.`userid`) AS `cnt`
+ COUNT(`d`.`userid`) AS `cnt`
FROM
- `{?_MYSQL_PREFIX?}_user_data` AS d
+ `{?_MYSQL_PREFIX?}_user_data` AS `d`
INNER JOIN
- `{?_MYSQL_PREFIX?}_user_refs` AS r
+ `{?_MYSQL_PREFIX?}_user_refs` AS `r`
ON
- d.`userid`=r.`refid`
+ `d`.`userid`=`r`.`refid`
WHERE
- d.`status` != 'CONFIRMED' AND
- r.`userid`=%s
+ `d`.`status` != 'CONFIRMED' AND
+ `r`.`userid`=%s
" . $add . "
ORDER BY
- d.`userid` ASC
+ `d`.`userid` ASC
LIMIT 1",
array(
$userid
// Wrapper for str_pad() with left padding zeros
function padLeftZero ($str, $amount = 2) {
- // Pad it
- return str_pad($str, $amount, '0', STR_PAD_LEFT)
+ // Is str_pad() there?
+ if (function_exists('str_pad')) {
+ // Use prependZeros()
+ return prependZeros($str, $amount);
+ } else {
+ // Pad it
+ return str_pad($str, $amount, '0', STR_PAD_LEFT);
+ }
}
// [EOF]