]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-transfer.php
Referal system refactured (and some parts fixed), wrapper function introduced:
[mailer.git] / inc / modules / member / what-transfer.php
index 6376feb75388e665b03bb30eaee2697fd3fb0b22..d00378024974bb185b481537860532d9696478e8 100644 (file)
@@ -144,12 +144,24 @@ switch ($mode) {
 
                                // Add entries to both tables
                                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_transfers_in` (`userid`, `from_userid`, `points`, `reason`, `time_trans`, `trans_id`) VALUES (%s,%s,%s,'%s', UNIX_TIMESTAMP(),%s)",
-                                       array(bigintval(postRequestParameter('to_userid')), getMemberId(), bigintval(postRequestParameter('points')), postRequestParameter('reason'), $content['trans_id']), __FILE__, __LINE__);
+                                       array(
+                                               bigintval(postRequestParameter('to_userid')),
+                                               getMemberId(),
+                                               bigintval(postRequestParameter('points')),
+                                               postRequestParameter('reason'),
+                                               $content['trans_id']
+                                       ), __FILE__, __LINE__);
                                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_transfers_out` (`userid`, `to_userid`, `points`, `reason`, `time_trans`, `trans_id`) VALUES (%s,%s,%s,'%s', UNIX_TIMESTAMP(),%s)",
-                                       array(getMemberId(), bigintval(postRequestParameter('to_userid')), bigintval(postRequestParameter('points')), postRequestParameter('reason'), $content['trans_id']), __FILE__, __LINE__);
+                                       array(
+                                               getMemberId(),
+                                               bigintval(postRequestParameter('to_userid')),
+                                               bigintval(postRequestParameter('points')),
+                                               postRequestParameter('reason'),
+                                               $content['trans_id']
+                                       ), __FILE__, __LINE__);
 
                                // Add points to account *directly* ...
-                               addPointsDirectly('transfer', bigintval(postRequestParameter('to_userid')), bigintval(postRequestParameter('points')));
+                               addPointsThroughReferalSystem('transfer', bigintval(postRequestParameter('to_userid')), bigintval(postRequestParameter('points')));
 
                                // ... and add it to current user's used points
                                subtractPoints('transfer', getMemberId(), postRequestParameter('points'));