$response = sendPostRequest($requestString, $requestData);
// Check the response header if all is fine
- if (strpos($response[0], '200') === false) {
+ if (!isInString('200', $response[0])) {
// Something bad happend... :(
return array(
'status' => 'request_error',
// Log the transfer
function WERNIS_LOG_TRANSFER ($wdsId, $amount, $type = 'FAILED', $message = '', $status = '') {
// Register this wernis movement
- SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_wernis` (`userid`, `wernis_account`, `wernis_amount`, `wernis_timestamp`, `wernis_type`, `wernis_api_message`, `wernis_api_status`) VALUES (%s, %s, %s, UNIX_TIMESTAMP(), '%s', '%s', '%s')",
+ SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_wernis` (`userid`,`wernis_account`,`wernis_amount`,`wernis_timestamp`,`wernis_type`,`wernis_api_message`,`wernis_api_status`) VALUES (%s, %s, %s, UNIX_TIMESTAMP(), '%s', '%s', '%s')",
array(
getMemberId(),
bigintval($wdsId),
// Take fees and factor
function WERNIS_TAKE_FEE ($points, $mode) {
// Payout or withdraw are allowed modes!
- //* DEBUG: */ debugOutput('mode='.$mode.',points='.$points);
+ //* DEBUG: */ debugOutput('mode=' . $mode . ',points=' . $points);
if (!in_array($mode, array('payout', 'withdraw'))) {
// Log error and abort
- logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . getMemberId() . ',mode=' . $mode . ',points=' . $points);
+ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . getMemberId() . ',mode=' . $mode . ',points=' . $points . ' - unknown mode detected.');
return false;
} // END - if