]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/bonus_functions.php
More rewrites/fixes (not all is fixed) for ext-sponsor
[mailer.git] / inc / libs / bonus_functions.php
index 556cb910184134fdab79b7b15db096a6cde2043c..155196386b1743194dacf46a1c0588440a6c615e 100644 (file)
@@ -65,7 +65,7 @@ function addTurboBonus ($mid, $userid, $type) {
                default:
                        logDebugMessage(__FUNCTION__, __LINE__, sprintf("Invalid type %s detected.", $type));
                        break;
-       }
+       } // END - switch
 
        // Is a column name set?
        if (empty($column)) {
@@ -128,7 +128,7 @@ function addBonusRanks ($data, $type, $userid) {
                array(
                        $type,
                        $data,
-                       $userid
+                       bigintval($userid)
                ), __FUNCTION__, __LINE__);
 
        // Entry found?
@@ -140,9 +140,7 @@ function addBonusRanks ($data, $type, $userid) {
                $self  = true;
 
                // Transfer data to template
-               $GLOBALS['ranking_content']['yr_level']  = $GLOBALS['ranking_content']['level'];
-               $GLOBALS['ranking_content']['yr_points'] = translateComma($GLOBALS['ranking_content']['points']);
-               $GLOBALS['ranking_content']['yr_tmark']  = generateDateTime($GLOBALS['ranking_content']['timemark'], 1);
+               $GLOBALS['ranking_content']['timemark'] = generateDateTime($GLOBALS['ranking_content']['timemark'], 1);
 
                // Load template
                $GLOBALS['ranking_content']['own'] = loadTemplate('show_bonus_yr', true, $GLOBALS['ranking_content']);
@@ -199,14 +197,14 @@ LIMIT 1",
 
                if ($self === false) {
                        // If current user was not found set constant
-                       $GLOBALS['ranking_content']['rankings'] = '{--BONUS_RANK_YOU_ARE_404--}';
+                       $GLOBALS['ranking_content']['rankings'] = '{--MEMBER_BONUS_RANK_YOU_ARE_404--}';
                } // END - if
        } else {
                // No entries found!
                // @TODO Move this HTML to a template
                $OUT = '<tr>
   <td colspan="3" align="center" height="30" class="bottom">
-    <div class="guest_failed">' . getMaskedMessage('BONUS_NO_RANKS', $data) . '</div>
+    <div class="guest_failed">' . getMaskedMessage('MEMBER_BONUS_NO_RANKS', $data) . '</div>
   </td>
 </tr>';
        }
@@ -263,7 +261,7 @@ function handleBonusPoints ($mode) {
 // Purges expired fast-click bonus entries
 function purgeExpiredTurboBonus() {
        // Remove entries
-       $result = SQL_QUERY("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_bonus_turbo` WHERE `timemark` < (UNIX_TIMESTAMP() - {?bonus_timeout?})", __FUNCTION__, __LINE__);
+       $result = SQL_QUERY('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_bonus_turbo` WHERE `timemark` < (UNIX_TIMESTAMP() - {?bonus_timeout?})', __FUNCTION__, __LINE__);
 
        if (SQL_AFFECTEDROWS() > 0) {
                // Send out email to admin
@@ -271,9 +269,9 @@ function purgeExpiredTurboBonus() {
        } // END - if
 }
 
-///////////////////////////////////////////////////////////////////////////////
-//                              Only filter functions
-///////////////////////////////////////////////////////////////////////////////
+//-----------------------------------------------------------------------------
+//                                Filter Functions
+//-----------------------------------------------------------------------------
 
 // Filter for adding login bonus to the user's account
 function FILTER_ADD_LOGIN_BONUS () {
@@ -307,16 +305,16 @@ LIMIT 1',
 
        if (($bonus === true) && (getRequestParameter('mode') == 'bonus')) {
                // Output message with added points
-               $GLOBALS['message'] .= '<div class="tiny">{--BONUS_LOGIN_BONUS_ADDED--}</div>';
+               $GLOBALS['message'] .= '<div class="tiny">{--MEMBER_BONUS_LOGIN_BONUS_ADDED--}</div>';
        } elseif (isExtensionActive('bonus')) {
                // No login bonus added!
-               $GLOBALS['message'] .= '<div class="member_failed">{--BONUS_LOGIN_BONUS_NOT_ADDED--}</div>';
+               $GLOBALS['message'] .= '<div class="member_failed">{--MEMBER_BONUS_LOGIN_BONUS_NOT_ADDED--}</div>';
        }
 }
 
-///////////////////////////////////////////////////////////////////////////////
-//                             Wrapper functions                             //
-///////////////////////////////////////////////////////////////////////////////
+//-----------------------------------------------------------------------------
+//                             Wrapper Functions
+//-----------------------------------------------------------------------------
 
 // Determines wether the "bonus rallye" is active
 function isBonusRallyeActive () {