]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/beg_functions.php
Introduced makeNullToZero()
[mailer.git] / inc / libs / beg_functions.php
index 53acc3a45d3af5a1fe8e9a31db8eeb0d8194570b..12941204e087ab21392c7207b88dd38cd7305bd6 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -52,13 +52,12 @@ function addPointsBeg ($userid, $points) {
                        array($points, $userid), __FUNCTION__, __LINE__);
        } else {
                // Add points to account
-               // @TODO Try to rewrite the following unset()
-               unset($GLOBALS['ref_level']);
-               $added = addPointsThroughReferalSystem('beg', $userid, $points, false, 0, strtolower(getBegMode()));
+               initReferalSystem();
+               $added = addPointsThroughReferalSystem('beg', $userid, $points);
        }
 
        // Subtract begged points from member account if the admin has selected one
-       if (getBegUserid() > 0) {
+       if (isValidUserId(getBegUserid())) {
                // Subtract from this account
                subtractPoints('beg_payout', getBegUserid(), $points);
        } // END - if
@@ -67,9 +66,9 @@ function addPointsBeg ($userid, $points) {
        return $added;
 }
 
-// ----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
 //                       Wrapper functions for ext-beg
-// ----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
 
 // "Getter" for beg_new_member_notify
 function getBegNewMemberNotify () {
@@ -215,18 +214,6 @@ function getBegPayMode () {
        return $GLOBALS[__FUNCTION__];
 }
 
-// "Getter" for beg_mode
-function getBegMode () {
-       // Do we have cache?
-       if (!isset($GLOBALS[__FUNCTION__])) {
-               // Determine it
-               $GLOBALS[__FUNCTION__] = getConfig('beg_mode');
-       } // END - if
-
-       // Return cache
-       return $GLOBALS[__FUNCTION__];
-}
-
 // "Getter" for beg_include_own
 function getBegIncludeOwn () {
        // Do we have cache?