<?php
/************************************************************************
- * MXChange v0.2.1 Start: 09/09/2008 *
- * ================ Last change: 09/09/2008 *
+ * Mailer v0.2.1-FINAL Start: 09/09/2008 *
+ * =================== Last change: 09/09/2008 *
* *
* -------------------------------------------------------------------- *
* File : what-primera.php *
$content['refid'] = getConfig(('primera_refid'));
// Are there some entries?
- if (fetchUserData(getUserId())) {
+ if (fetchUserData(getMemberId())) {
// Fetch id
$content['primera_nickname'] = getUserData('primera_nickname');
} // END - if
// And load all rows!
$result = SQL_QUERY_ESC("SELECT `id`,`primera_account`,`primera_amount`,`primera_timestamp`,`primera_type` FROM `{?_MYSQL_PREFIX?}_user_primera` WHERE `userid`=%s ORDER BY `primera_timestamp` DESC",
- array(getUserId()), __FILE__, __LINE__);
+ array(getMemberId()), __FILE__, __LINE__);
// Load all rows
$content['rows'] = ''; $SW = 2;
while ($data = SQL_FETCHARRAY($result)) {
// Prepare data for output
$rowContent = array(
- 'stamp' => generateDateTime($data['primera_timestamp'], 2),
- 'points' => translateComma($data['primera_amount']),
- 'acc' => SQL_ESCAPE($data['primera_account']),
- 'status' => PRIMERA_TRANSFER_STATUS($data['primera_type']),
- 'raw_type' => strtolower($data['primera_type']),
- 'sw' => $SW,
+ 'primera_timestamp' => generateDateTime($data['primera_timestamp'], 2),
+ 'points' => translateComma($data['primera_amount']),
+ 'primera_account' => SQL_ESCAPE($data['primera_account']),
+ 'status' => PRIMERA_TRANSFER_STATUS($data['primera_type']),
+ 'raw_type' => strtolower($data['primera_type']),
+ 'sw' => $SW,
);
// Load row template
if (getRequestElement('mode') == 'pay') {
// Get total points and check if the user can request a payout
- $points = countSumTotalData(getUserId(), 'user_points', 'points') - countSumTotalData(getUserId(), 'user_data', 'used_points');
+ $points = countSumTotalData(getMemberId(), 'user_points', 'points') - countSumTotalData(getMemberId(), 'user_data', 'used_points');
// No dots here...
$points = explode('.', $points);
$content['primera_nickname'] = '';
// Do we have a user account? (should be!)
- if (fetchUserData(getUserId())) {
+ if (fetchUserData(getMemberId())) {
// Fetch id
$content['primera_nickname'] = getUserData('primera_nickname');
} // END - if
$locked = true;
// Shall I 'pay' the referal points imidiately?
- if (getConfig('ref_payout') == 0) {
+ if (getConfig('ref_payout') == '0') {
// Yes, 'pay' it now
$locked = false;
} // END - if
// Remove points from account
- subtractPoints('primera_payout', getUserId(), postRequestElement('amount'));
+ subtractPoints('primera_payout', getMemberId(), postRequestElement('amount'));
// Update primera nickname
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `primera_nickname`=%s WHERE `userid`=%s LIMIT 1",
- array(postRequestElement('primera_nickname'), getUserId()), __FILE__, __LINE__);
+ array(postRequestElement('primera_nickname'), getMemberId()), __FILE__, __LINE__);
// All done!
loadTemplate('admin_settings_saved', false, getMessage('PRIMERA_MEMBER_PAYOUT_DONE'));