Fixes for rallye extension, refs are now no longer removed from rallye if ref was...
[mailer.git] / inc / modules / member / what-order.php
index a85be7e4686e695d87866544fffe6f2ef4a6f76c..462f6bad3ca594836d96eb94ba61ee24a80a61b8 100644 (file)
@@ -96,16 +96,9 @@ if ($_CONFIG['order_max_full'] == "MAX") $ALLOWED = $MAXI;
 $HTML_EXT = EXT_IS_ACTIVE("html_mail");
 
 // Now check his points amount
-$result_p = SQL_QUERY_ESC("SELECT SUM(points) FROM "._MYSQL_PREFIX."_user_points WHERE userid=%s",
- array($GLOBALS['userid']), __FILE__, __LINE__);
-
-$TOTAL = 0;
-if (SQL_NUMROWS($result_p) > 0)
-{
-       // Load points
-       list($TOTAL) = SQL_FETCHROW($result_p);
-       SQL_FREERESULT($result_p);
+$TOTAL = GET_TOTAL_DATA($GLOBALS['userid'], "user_points", "points");
 
+if ($TOTAL > 0) {
        // And subtract his used points...
        $TOTAL -= GET_TOTAL_DATA($GLOBALS['userid'], "user_data", "used_points");
 
@@ -113,14 +106,11 @@ if (SQL_NUMROWS($result_p) > 0)
        if (!ereg(".", $TOTAL)) $TOTAL .= ".00000";
 }
 
-if (($HOLIDAY == "Y") && (GET_EXT_VERSION("holiday") >= "0.1.3"))
-{
+if (($HOLIDAY == "Y") && (GET_EXT_VERSION("holiday") >= "0.1.3")) {
        // Holiday is active!
        SQL_FREERESULT($result_p);
        LOAD_TEMPLATE("admin_settings_saved", false, HOLIDAY_ORDER_NOT_POSSIBLE);
-}
- elseif ((!empty($_POST['frametester'])) && ($ALLOWED > 0) && ($_POST['receiver'] > 0))
-{
+} elseif ((!empty($_POST['frametester'])) && ($ALLOWED > 0) && ($_POST['receiver'] > 0)) {
        // Continue with the frametester, we first need to store the data temporary in the pool
        //
        // First we would like to store the data and get it's pool position back...