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];
}
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
//-----------------------------------------------------------------------------