X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fmember%2Fwhat-transfer.php;h=d00378024974bb185b481537860532d9696478e8;hb=56931cd9321119dd37372bd16d6c552857e40066;hp=45c272e081cb6cf20f893333bf68890c0d160e2d;hpb=c6017cf76200e2a5e68bd1984fa2d31f0e3be9d8;p=mailer.git diff --git a/inc/modules/member/what-transfer.php b/inc/modules/member/what-transfer.php index 45c272e081..d003780249 100644 --- a/inc/modules/member/what-transfer.php +++ b/inc/modules/member/what-transfer.php @@ -45,6 +45,7 @@ if (!defined('__SECURITY')) { // Add description as navigation point addYouAreHereLink('member', __FILE__); +// Extension ext-transfer must be avtive if ((!isExtensionActive('transfer')) && (!isAdmin())) { displayMessage('{%pipe,generateExtensionInactiveNotInstalledMessage=transfer%}'); return; @@ -143,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')); @@ -341,7 +354,7 @@ switch ($mode) { `time_trans` VARCHAR(10) NOT NULL DEFAULT 0, `trans_type` ENUM('IN','OUT') NOT NULL DEFAULT 'IN', KEY (`party_userid`) -) TYPE = HEAP COMMENT = 'Temporary transfer table'", array(getMemberId()), __FILE__, __LINE__); +) ENGINE = HEAP COMMENT = 'Temporary transfer table'", array(getMemberId()), __FILE__, __LINE__); // Let's begin with the incoming list $result = SQL_QUERY_ESC("SELECT `trans_id`, `from_userid`, `points`, `reason`, `time_trans` FROM `{?_MYSQL_PREFIX?}_user_transfers_in` WHERE `userid`=%s ORDER BY `id` ASC LIMIT {?transfer_max?}",