return $GLOBALS['block_mode'];
}
-// Wrapper function for addPointsThroughReferalSystem()
+/**
+ * Wrapper function for addPointsThroughReferalSystem(), you should generally
+ * avoid this function and use addPointsThroughReferalSystem() directly and add
+ * your special payment method entry to points_data instead.
+ *
+ * @param $subject A string-encoded subject for this add
+ * @param $userid The recipient (member) for given points
+ * @param $points Points to be added to member's account
+ * @return $added Wether the points has been added to the user's account
+ */
function addPointsDirectly ($subject, $userid, $points) {
// Reset level here
- unset($GLOBALS['ref_level']);
+ initReferalSystem();
// Call more complicated method (due to more parameters)
return addPointsThroughReferalSystem($subject, $userid, $points, false, 0, 'DIRECT');
// Wrapper for fetchUserData() and getUserData() calls
function getFetchedUserData ($keyColumn, $userid, $valueColumn) {
+ /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'keyColumn=' . $keyColumn . ',userid=' . $userid . ',valueColumn=' . $valueColumn . ' - ENTERED!');
// Is it cached?
if (!isset($GLOBALS[__FUNCTION__][$userid][$keyColumn][$valueColumn])) {
// Default is 'guest'
} // END - if
// Return it
+ /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'keyColumn=' . $keyColumn . ',userid=' . $userid . ',valueColumn=' . $valueColumn . ',value=' . $GLOBALS[__FUNCTION__][$userid][$keyColumn][$valueColumn] . ' - EXIT!');
return $GLOBALS[__FUNCTION__][$userid][$keyColumn][$valueColumn];
}
// Wrapper to check if user points are locked
function ifUserPointsLocked ($userid) {
+ /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ' - ENTERED!');
// Do we have cache?
if (!isset($GLOBALS[__FUNCTION__][$userid])) {
// Determine it
} // END - if
// Return cache
+ /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',locked=' . intval($GLOBALS[__FUNCTION__][$userid]) . ' - EXIT!');
return $GLOBALS[__FUNCTION__][$userid];
}
} // END - foreach
}
+/**
+ * Parses a string into a US formated float variable, taken from user comments
+ * from PHP documentation website.
+ *
+ * @param $floatString A string holding a float expression
+ * @return $float Corresponding float variable
+ * @author chris<at>georgakopoulos<dot>com
+ * @link http://de.php.net/manual/en/function.floatval.php#92563
+ */
+function parseFloat ($floatString){
+ $LocaleInfo = localeconv();
+ $floatString = str_replace($LocaleInfo['mon_thousands_sep'] , '', $floatString);
+ $floatString = str_replace($LocaleInfo['mon_decimal_point'] , '.', $floatString);
+ return floatval($floatString);
+}
+
+// Generates a YES/NO option list from given default
+function generateYesNoOptionList ($default = '') {
+ // Generate it
+ return generateOptionList('/ARRAY/', array('Y', 'N'), array('{--YES--}', '{--NO--}'), $default);
+}
+
+//-----------------------------------------------------------------------------
+// Configuration wrapper
+//-----------------------------------------------------------------------------
+
// Getter for 'check_double_email'
function getCheckDoubleEmail () {
// Is the cache entry set?
return $GLOBALS[__FUNCTION__];
}
-// Checks wether 'check_double_email' is "YES"
+// Checks wether 'check_double_email' is 'Y'
function isCheckDoubleEmailEnabled () {
// Is the cache entry set?
if (!isset($GLOBALS[__FUNCTION__])) {