From 37b80c9d010fd00324aed37006f0dac548e91315 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 5 Oct 2008 21:45:02 +0000 Subject: [PATCH] Monthly beg/bonus rallye rewritten --- inc/databases.php | 2 +- inc/monthly/monthly_beg.php | 10 +--------- inc/monthly/monthly_bonus.php | 13 ++----------- 3 files changed, 4 insertions(+), 21 deletions(-) diff --git a/inc/databases.php b/inc/databases.php index 4d6a2fb7e9..81b7b59e3d 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -113,7 +113,7 @@ define('USAGE_BASE', "usage"); define('SERVER_URL', "http://www.mxchange.org"); // This current patch level -define('CURR_SVN_REVISION', "455"); +define('CURR_SVN_REVISION', "456"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/monthly/monthly_beg.php b/inc/monthly/monthly_beg.php index 35e62117a9..cc69c583b4 100644 --- a/inc/monthly/monthly_beg.php +++ b/inc/monthly/monthly_beg.php @@ -78,15 +78,7 @@ LIMIT %s", $UIDs = ""; while(list($uid, $email, $points) = SQL_FETCHROW($result_main)) { // Add points to user's account directly - $result_data = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_points -SET points=points+%s WHERE ref_depth=0 AND userid=%s LIMIT 1", - array($points, bigintval($uid)), __FILE__, __LINE__); - - // Update mediadata as well - if (GET_EXT_VERSION("mediadata") >= "0.0.4") { - // Update database - MEDIA_UPDATE_ENTRY(array("total_points"), "add", $points); - } + ADD_POINTS_REFSYSTEM($uid, $points, false, "0", false, "direct"); // Load email template and email it away $msg = LOAD_EMAIL_TEMPLATE("member_beg", $points, bigintval($uid)); diff --git a/inc/monthly/monthly_bonus.php b/inc/monthly/monthly_bonus.php index a014831aeb..c67f734f21 100644 --- a/inc/monthly/monthly_bonus.php +++ b/inc/monthly/monthly_bonus.php @@ -93,21 +93,13 @@ ORDER BY active_bonus DESC, userid LIMIT %s", $UIDs .= ",'".$uid."'"; // Add points to user's account directly - $result_data = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_points -SET points=points+%s WHERE ref_depth=0 AND userid=%s LIMIT 1", - array($points, bigintval($uid)), __FILE__, __LINE__); - - // Update mediadata as well - if (GET_EXT_VERSION("mediadata") >= "0.0.4") - { - // Update database - MEDIA_UPDATE_ENTRY(array("total_points"), "add", $points); - } + ADD_POINTS_REFSYSTEM($uid, $points, false, "0", false, "direct"); // Load email template and email it away $msg = LOAD_EMAIL_TEMPLATE("member_bonus", $points, bigintval($uid)); SEND_EMAIL($email, BONUS_MONTHLY_ONLINE_BONUS, $msg); } + // Remove first commata $UIDs = substr($UIDs, 1); @@ -119,7 +111,6 @@ SET points=points+%s WHERE ref_depth=0 AND userid=%s LIMIT 1", // Reset accounts $result = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_user_data SET turbo_bonus=0, login_bonus=0, bonus_order=0, bonus_stats=0, bonus_ref=0", __FILE__, __LINE__); - } // Free memory -- 2.39.5