]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-points.php
Added update_year.sh (still not fully flexible) and updated all years with it.
[mailer.git] / inc / modules / member / what-points.php
index 7975df0833ab8eef7cec152aac50ab1ae3384f8f..459500bc2b7d26728458a710d1248e1ef7f91782 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2015 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -52,10 +52,10 @@ if ((!isExtensionActive('user')) && (!isAdmin())) {
 } // END - if
 
 // Query for referral levels and percents
-$result_depths = SQL_QUERY('SELECT `level`,`percents` FROM `{?_MYSQL_PREFIX?}_refdepths` ORDER BY `level` ASC', __FILE__, __LINE__);
+$result_depths = sqlQuery('SELECT `level`, `percents` FROM `{?_MYSQL_PREFIX?}_refdepths` ORDER BY `level` ASC', __FILE__, __LINE__);
 
 // Get total depths
-$numDepths = SQL_NUMROWS($result_depths);
+$numDepths = sqlNumRows($result_depths);
 
 // Add many more rows for the login/turbo/ref/order bonus
 // @TODO Should we rewrite this to a filter?
@@ -82,7 +82,7 @@ $content['part_locked_order']   = '0.00000';
 $OUT = '';
 
 // Load ref levels
-while ($data = SQL_FETCHARRAY($result_depths)) {
+while ($data = sqlFetchArray($result_depths)) {
        // Init points and counter here
        $content['counter']             = '0';
        $content['points']              = '0.00000';
@@ -94,24 +94,24 @@ while ($data = SQL_FETCHARRAY($result_depths)) {
        $content = merge_array($content, $data);
 
        // Default for referral level > 0
-       $depth = 'p.`ref_depth`=%s';
+       $depth = '`p`.`ref_depth`=%s';
        if (is_null($content['level'])) {
-               $depth = 'p.`ref_depth` IS NULL';
+               $depth = '`p`.`ref_depth` IS NULL';
        } // END - if
 
        // Load referral points
-       $result_points = SQL_QUERY_ESC('SELECT
+       $result_points = sqlQueryEscaped('SELECT
        ' . getAllPointColumns('p.', ',') . '
-       r.`counter`
+       `r`.`counter`
 FROM
-       `{?_MYSQL_PREFIX?}_user_points` AS p
+       `{?_MYSQL_PREFIX?}_user_points` AS `p`
 LEFT JOIN
-       `{?_MYSQL_PREFIX?}_refsystem` AS r
+       `{?_MYSQL_PREFIX?}_refsystem` AS `r`
 ON
-       p.`userid`=r.`userid` AND
-       p.`ref_depth`=r.`level`
+       `p`.`userid`=`r`.`userid` AND
+       `p`.`ref_depth`=`r`.`level`
 WHERE
-       p.`userid`=%s AND
+       `p`.`userid`=%s AND
        ' . $depth . '
 LIMIT 1',
                array(
@@ -119,10 +119,10 @@ LIMIT 1',
                        convertZeroToNull($content['level'])
                ), __FILE__, __LINE__);
 
-       // Do we have an entry?
-       if (SQL_NUMROWS($result_points) == 1) {
+       // Is there an entry?
+       if (sqlNumRows($result_points) == 1) {
                // Load data
-               $content = merge_array($content, SQL_FETCHARRAY($result_points));
+               $content = merge_array($content, sqlFetchArray($result_points));
 
                // Add locked-/points
                $content['part_points']       += $content['points'];
@@ -139,14 +139,14 @@ LIMIT 1',
        } // END - if
 
        // Free result
-       SQL_FREERESULT($result_points);
+       sqlFreeResult($result_points);
 
        // Output row
-       $OUT .= loadTemplate('member_points_row', true, $content);
+       $OUT .= loadTemplate('member_points_row', TRUE, $content);
 } // END - while
 
 // Free memory
-SQL_FREERESULT($result_depths);
+sqlFreeResult($result_depths);
 
 // Add userid
 $content['userid'] = getMemberId();
@@ -168,10 +168,10 @@ if ((isExtensionInstalledAndNewer('bonus', '0.2.2')) && (isExtensionActive('bonu
        $content['bonus_total_points'] = getUserData('turbo_bonus') + getUserData('login_bonus') + getUserData('bonus_ref') + getUserData('bonus_order') + getUserData('bonus_stats');
 
        // Output rows
-       $content['special_rows'] = loadTemplate('member_points_bonus_rows', true, $content);
+       $content['special_rows'] = loadTemplate('member_points_bonus_rows', TRUE, $content);
 } elseif ((isExtensionActive('bonus')) && (!isBonusRallyeActive())) {
        // Bonus active rallye deactivated
-       $content['special_rows'] = loadTemplate('member_points_bonus_disabled', true);
+       $content['special_rows'] = loadTemplate('member_points_bonus_disabled', TRUE);
 } elseif ((isAdmin()) && (isExtensionInstalledAndOlder('bonus', '0.2.2')) && (isExtensionActive('bonus'))) {
        // Please upgrade your bonus extension to v0.2.2 or newer!
        $content['special_rows'] = loadTemplate('member_points_upgrade');
@@ -180,7 +180,7 @@ if ((isExtensionInstalledAndNewer('bonus', '0.2.2')) && (isExtensionActive('bonu
 // Load final template
 if (isExtensionActive('user')) {
        // Load template when required extension is there
-       loadTemplate('member_points', false, $content);
+       loadTemplate('member_points', FALSE, $content);
 } elseif (isAdmin()) {
        // Missing extension
        displayMessage('{%pipe,generateExtensionInactiveNotInstalledMessage=user%}');