+ $added = ($added && subtractPoints('beg_payout', getBegUserid(), $points));
+ } // END - if
+
+ // Return result
+ return $added;
+}
+
+//-----------------------------------------------------------------------------
+// Template functions
+//-----------------------------------------------------------------------------
+
+// Outputs points which a member can get
+function doTemplateOutputBegPoints ($templateName, $clear = FALSE) {
+ // Default is not the same
+ $return = '{--BEG_POINTS_MIN_MAX--}';
+
+ // Is min/max points the same?
+ if (getBegPoints() == getBegPointsMax()) {
+ // Is the same, output different message
+ $return = '{--BEG_POINTS_FIXED--}';
+ } // END - if
+
+ // Return message
+ return $return;
+}
+
+//-----------------------------------------------------------------------------
+// Wrapper functions for ext-beg
+//-----------------------------------------------------------------------------
+
+// "Getter" for beg_new_member_notify
+function getBegNewMemberNotify () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Get it
+ $GLOBALS[__FUNCTION__] = getConfig('beg_new_member_notify');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// Checks whether beg_new_member_notify is enabled
+function isBegNewMemberNotifyEnabled () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('beg', '0.2.7')) && (getBegNewMemberNotify() == 'Y'));
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_userid
+function getBegUserid () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Get it
+ $GLOBALS[__FUNCTION__] = getConfig('beg_userid');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_timeout
+function getBegTimeout () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('beg_timeout');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_userid_timeout
+function getBegUseridTimeout () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('beg_userid_timeout');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_ip_timeout
+function getBegIpTimeout () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('beg_ip_timeout');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_ranks
+function getBegRanks () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('beg_ranks');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_points_max
+function getBegPointsMax () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('beg_points_max');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_points
+function getBegPoints () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('beg_points');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for beg_notify_bonus
+function getBegNotifyBonus () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('beg_notify_bonus');