./inc/functions.php:92: // @TODO Extension 'msg' does not exist
./inc/gen_sql_patches.php:95:// @TODO Rewrite this to a filter
./inc/install-functions.php:57: // @TODO DEACTIVATED: changeDataInLocalConfigurationFile('OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestParameter('omode'), 0);
-./inc/language/de.php:1083: // @TODO Rewrite these two constants
-./inc/language/de.php:1104: // @TODO Rewrite these three constants
+./inc/language/de.php:1085: // @TODO Rewrite these two constants
+./inc/language/de.php:1106: // @TODO Rewrite these three constants
./inc/language/de.php:778:// @TODO Are these constants longer used?
./inc/language-functions.php:255: // @TODO These are all valid languages, again hard-coded
./inc/language-functions.php:44:// @TODO Rewrite all language constants to this function.
} // END - if
// Append debug line
- appendLineToFile(getCachePath() . 'mysql.log', $F . '(LINE=' . $L . '|NUM=' . SQL_NUMROWS($result) . '|AFFECTED=' . SQL_AFFECTEDROWS() . '|QUERYTIME:' . $queryTime . '): ' . str_replace("\r", '', str_replace("\n", ' ', $GLOBALS['last_sql'])));
+ appendLineToFile(getCachePath() . 'mysql.log', basename($F) . '|LINE=' . $L . '|NUM=' . (is_resource($result) ? SQL_NUMROWS($result) : 'false') . '|AFFECTED=' . SQL_AFFECTEDROWS() . '|QUERYTIME:' . $queryTime . '): ' . str_replace("\r", '', str_replace("\n", ' ', $GLOBALS['last_sql'])));
} // END - if
// Count DB hits
// Remove old entries
$OLD = getBegTimeout();
if (getBegUseridTimeout() > $OLD) $OLD = getBegUseridTimeout();
- SQL_QUERY('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_beg_ips` WHERE `timeout` < (UNIX_TIMESTAMP() - ' . ($OLD + 60*60) . ')', __FILE__, __LINE__);
+ SQL_QUERY('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_beg_ips` WHERE (UNIX_TIMESTAMP() - `timeout`) >= ' . ($OLD + 60*60) . '', __FILE__, __LINE__);
// Check for beg rallye is active and send mails out
if ((isBegRallyeEnabled()) && (isBegNewMemberNotifyEnabled())) {
// Init differences
$GLOBALS['lang_diff'][$target] = array();
$GLOBALS['lang_diff_count'][$target] = 0;
- if (!isset($GLOBALS['lang_diff_count']['total'])) $GLOBALS['lang_diff_count']['total'] = 0;
+ if (!isset($GLOBALS['lang_diff_count']['total'])) {
+ $GLOBALS['lang_diff_count']['total'] = 0;
+ } // END - if
// *Does* match by default
$matches = true;
'ADMIN_CHANGE_PAYMENT' => "Mailvergütungen ändern",
'ADMIN_REMOVE_PAYMENT' => "Mailvergütungen löschen",
'REFERALS' => "Referals",
- 'MEMBER_TOTAL_POINTS' => "Gesamtsumme",
+ 'MEMBER_PART_POINTS' => "Teilsummen",
'KBYTES' => "KBytes",
'DEFAULT_SUBJECT_LINE' => "Klick-Mail von {?MAIN_TITLE?}",
'MEBER_UPDATE_PWD_WRONG' => "Sie haben das falsche Passwort eingegeben! Bitte nochmal versuchen.",
'DEBUG_REPORT_BUG_SUBJECT' => "[BUG!] Es wurde ein Bug im Script erkannt:",
'ADMIN_EXTENSION_ALWAYS_ACTIVE' => "Die Erweiterung <span class=\"data\">%s</span> kann nicht deaktiviert werden, da sie immer aktiv bleiben muss.",
'MEMBER_REFERAL_LINKS_FOOTER' => "Ihr Referal-Link eingebaut in Ihrer Homepage bringt Ihnen passiv mehr Referals. (Aber Ihren Referal-Link bewerben schadet auch nicht... ;-) )",
+ 'POINTS_ORDER' => "Werbeguthaben",
+ 'MEMBER_TOTAL_POINTS' => "Gesamtguthaben",
'MEMBER_MAIL_BONUS_CONFIRMED_ON' => "Sie haben diese Bonusmail <span class=\"data\">%s</span> bestätigt.",
'MEMBER_MAIL_BONUS_CONFIRMED_UNKNOWN' => "Es konnte nicht festgestellt werden, wann Sie die Bonus-Mail <span class=\"data\">%s</span> bestätigt hatten.",
$message = '{--PAYOUT_STATUS_' . strtoupper($status) . '--}';
// Return it
+ return $message;
+}
+
+// "Getter" for payoutable user points
+function getPayoutPoints ($userid) {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__][$userid])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__][$userid] = countSumTotalData($userid, 'user_points', 'points') - countSumTotalData($userid, 'user_data', 'used_points');
+ } // END - if
+
+ // Return it
+ return $GLOBALS[__FUNCTION__][$userid];
}
// [EOF]
$content['rows'] = $OUT;
// Remeber total amount
-$content['total'] = $total;
+$content['total_points'] = $total;
// Set title
$content['title'] = '{--TRANSFER_LIST_ALL--}';
} // END - while
$content['rows'] = $OUT;
- $content['total'] = $total;
+ $content['total_points'] = $total;
// Check if we need to display form or not with manuel withdraw
if (getLastMonth() == getMonth()) {
} // END - while
$content['rows'] = $OUT;
- $content['total'] = $total;
+ $content['total_points'] = $total;
// Check if we need to display form or not with manuel withdraw
if (getLastMonth() == getMonth()) {
$content['rows'] = $OUT;
// Remeber total amount
-$content['total'] = $total;
+$content['total_points'] = $total;
// Set title
$content['title'] = '{--TRANSFER_LIST_ALL--}';
$content['joined'] = generateDateTime($content['joined'], 0);
$content['last_update'] = generateDateTime($content['last_update'], 0);
$content['last_profile_sent'] = generateDateTime($content['last_profile_sent'], 0);
- $content['total'] = countSumTotalData($userid, 'user_points', 'points');
+ $content['total_points'] = countSumTotalData($userid, 'user_points', 'points');
$content['locked'] = countSumTotalData($userid, 'user_points', 'locked_points');
$content['lock_timestamp'] = generateDateTime($content['lock_timestamp'], 2);
$content['nickname'] = '{--EXT_NICKNAME_404--}';
SQL_FREERESULT($result);
// Output user's points
- $content['total'] = $total;
+ $content['total_points'] = $total;
// Check how many mail orders he has placed today and how many he's allowed to send
switch (getConfig('order_max_full')) {
} // END - if
// Translate point into comma
-$totalPoints = getTotalPoints(getMemberId());
+$payoutPoints = getPayoutPoints(getMemberId());
if (!isGetRequestParameterSet('payout')) {
// Load payout types
%s >= `min_points`
ORDER BY
`type` ASC",
- array($totalPoints), __FILE__, __LINE__);
+ array($payoutPoints), __FILE__, __LINE__);
if (!SQL_HASZERONUMS($result)) {
// Free memory
SQL_FREERESULT($result);
SQL_FREERESULT($result_payouts);
// Output payout list
- outputPayoutList($totalPoints);
+ outputPayoutList($payoutPoints);
} else {
// No payout types setup
displayMessage('{--MEMBER_PAYOUT_SETUP_INCOMPLETE--}');
$content = SQL_FETCHARRAY($result);
// Calculate maximum value
- $max = round($totalPoints * $content['rate'] - 0.5);
+ $max = round($payoutPoints * $content['rate'] - 0.5);
$PAY_MAX = '0';
// Calulcate points from submitted amount
}
// Has enougth points to payout?
- if ($totalPoints >= $content['min_points']) {
+ if ($payoutPoints >= $content['min_points']) {
// Ok, he can get be paid
if ((isFormSent()) && ($points <= $PAY_MAX) && ($points >= $content['min_points'])) {
// Remember points in array
// Remember row count in constant
$content['rowspan'] = ($numDepths * 2 + 15);
-// Init some vars...
-$content['total_points'] = '0';
-$content['total_referals'] = '0';
-$content['total_locked'] = '0';
+// Initialize array elements
+$content['part_points'] = '0.00000';
+$content['part_referals'] = '0';
+$content['part_locked'] = '0.00000';
+$content['part_order'] = '0.00000';
+$content['part_locked_order'] = '0.00000';
+$content['counter'] = '0';
+$content['points'] = '0.00000';
+$content['order_points'] = '0.00000';
+$content['locked_points'] = '0.00000';
+$content['locked_order_points'] = '0.00000';
+
+// And output variable
$OUT = '';
// Load ref levels
// Merge it together
$content = merge_array($content, $data);
- // Initialize array elements
- $content['counter'] = '0';
- $content['points'] = '0.00000';
- $content['locked_points'] = '0.00000';
-
// Load referal points
$result_points = SQL_QUERY_ESC("SELECT
p.`points`,
+ p.`order_points`,
p.`locked_points`,
+ p.`locked_order_points`,
r.`counter`
FROM
`{?_MYSQL_PREFIX?}_user_points` AS p
-INNER JOIN
+LEFT JOIN
`{?_MYSQL_PREFIX?}_refsystem` AS r
ON
p.`userid`=r.`userid` AND
p.`ref_depth`=r.`level`
WHERE
p.`userid`=%s AND
- p.`ref_depth`='%s'
+ p.`ref_depth`=%s
LIMIT 1",
array(
getMemberId(),
$content = merge_array($content, SQL_FETCHARRAY($result_points));
// Add all entries
- $content['total_points'] += $content['points'];
- $content['total_locked'] += $content['locked_points'];
- $content['total_referals'] += $content['counter'];
+ $content['part_points'] += $content['points'];
+ $content['part_order'] += $content['order_points'];
+ $content['part_locked'] += $content['locked_points'];
+ $content['part_locked_order'] += $content['locked_order_points'];
+ $content['part_referals'] += $content['counter'];
} // END - if
// Free result
$content['rows'] = $OUT;
// Remember several values in constants
-$content['total_points'] = ($content['total_points'] - getUserData('used_points'));
+$content['total_points'] = $content['part_points'] - getUserData('used_points') + $content['part_order'];
// Fixes a bug when there is no bonus extension installed
if (isExtensionInstalledAndOlder('bonus', '0.4.4')) {
// Display login bonus and turbo-click bonus
if ((isExtensionInstalledAndNewer('bonus', '0.2.2')) && (isExtensionActive('bonus')) && (isBonusRallyeActive())) {
// Total bonus points
- $content['total'] = getUserData('turbo_bonus') + getUserData('login_bonus') + getUserData('bonus_ref') + getUserData('bonus_order') + getUserData('bonus_stats');
+ $content['bonus_total_points'] = getUserData('turbo_bonus') + getUserData('login_bonus') + getUserData('bonus_ref') + getUserData('bonus_order') + getUserData('bonus_stats');
// Output rows
$content['special_rows'] = loadTemplate('member_points_bonus_rows', true, $content);
if (isExtensionActive('payout')) {
// Payput extension is installed and active so we can check if the user has enougth points
- outputPayoutList($content['total_points'] - getUserData('used_points'));
+ outputPayoutList($content['part_points'] - getUserData('used_points'));
} // END - if
// [EOF]
$content['rows'] = $OUT;
// Remeber total amount
- $content['total'] = $totalPoints;
+ $content['total_points'] = $totalPoints;
// Load final template
loadTemplate('member_transfer_list', false, $content);
$content['rows'] = $OUT;
// Remeber total amount
- $content['total'] = $total;
+ $content['total_points'] = $total;
// Set title
$content['title'] = '{--TRANSFER_LIST_ALL--}';
// Do we have cache?
if (!isset($GLOBALS[__FUNCTION__][$userid])) {
// Determine it
- $GLOBALS[__FUNCTION__][$userid] = countSumTotalData($userid, 'user_points', 'points') - countSumTotalData($userid, 'user_data', 'used_points');
+ $GLOBALS[__FUNCTION__][$userid] = countSumTotalData($userid, 'user_points', 'points') - countSumTotalData($userid, 'order_points', 'points') - countSumTotalData($userid, 'user_data', 'used_points');
} // END - if
// Return cache
} // END - if
// Load total points
- $content['total'] = getTotalPoints($userId);
+ $content['total_points'] = getTotalPoints($userId);
// Add payment points
$content['points'] = $payment;
<u>{--MEMBER_BEG_TOTAL--}:</u>
</td>
<td class="header_column bottom right">
- <u>{%pipe,translateComma=$content[total]%} {?POINTS?}</u>
+ <u>{%pipe,translateComma=$content[total_points]%} {?POINTS?}</u>
</td>
<td class="header_column bottom">
<u>{--ADMIN_TOTAL_MEMBER_BONUS--}:</u>
</td>
<td class="header_column bottom right">
- <u>{%pipe,translateComma=$content[total]%} {?POINTS?}</u>
+ <u>{%pipe,translateComma=$content[total_points]%} {?POINTS?}</u>
</td>
<td class="header_column bottom"> </td>
</tr>
<strong>{--ADMIN_TRANSFER_POINTS_TOTAL--}</strong>
</td>
<td align="center" class="header_column bottom">
- {%pipe,translateComma=$content[total]%}
+ {%pipe,translateComma=$content[total_points]%}
</td>
</tr>
<tr>
</td>
<td align="center" class="top right">
{--TOTAL_POINTS--}:<br />
- <strong>{%pipe,translateComma=$content[total]%}</strong>
+ <strong>{%pipe,translateComma=$content[total_points]%}</strong>
</td>
<td align="center" class="top right">
{--TOTAL_REFERALS--}:<br />
<tr>
<td width="220" align="center">
{%message,MEMBER_THANX_POINTS_ADDED=$content[points]%}<br />
- {%message,MEMBER_MAILID_TOTAL_POINTS=$content[total]%}
+ {%message,MEMBER_MAILID_TOTAL_POINTS=$content[total_points]%}
</td>
<td align="center">
<div class="banner dashed">
<td width="220" align="center">
<div class="tiny">
{%message,MEMBER_THANX_POINTS_ADDED=$content[points]%}<br />
- {%message,MEMBER_MAILID_TOTAL_POINTS=$content[total]%}<br />
+ {%message,MEMBER_MAILID_TOTAL_POINTS=$content[total_points]%}<br />
<br />
<a href="{%url=show_bonus.php?userid=$content[userid]&t=$content[type]&d=$content[data]%}" target="_blank">{--MEMBER_SHOW_TURBO_BONUS_LINK--}
</div>
<div class="table dashed">
<div align="center">
{--MEMBER_POINTS_LEFT--}:
- <strong>{%pipe,translateComma=$content[total]%} {?POINTS?}</strong>
+ <strong>{%pipe,translateComma=$content[total_points]%} {?POINTS?}</strong>
</div>
<div align="center">
<tr>
<td align="center" class="header_column bottom"><strong>{--REFERAL_LEVEL--}</strong></td>
<td align="center" class="header_column bottom"><strong>{?POINTS?}</strong></td>
+ <td align="center" class="header_column bottom"><strong>{--POINTS_ORDER--}</strong></td>
<td align="center" class="header_column bottom"><strong>{--REFERALS--}</strong></td>
</tr>
$content[rows]
+ <tr>
+ <td class="member_data bottom top">
+ <strong>{--MEMBER_PART_POINTS--}</strong>
+ </td>
+ <td class="member_data bottom top">
+ <strong>{%pipe,translateComma=$content[part_points]%} {?POINTS?}</strong>
+ </td>
+ <td class="member_data bottom top">
+ <strong>{%pipe,translateComma=$content[part_order]%} {?POINTS?}</strong>
+ </td>
+ <td class="member_data bottom top" align="center">-</td>
+ </tr>
<tr>
<td class="member_data bottom">{--POINTS_USED--}</td>
<td class="member_data bottom">{%user,used_points,translateComma%} {?POINTS?}</td>
+ <td class="member_data bottom">-</td>
<td class="member_data bottom" align="center">-</td>
</tr>
<tr>
<td class="member_data bottom">
<strong>{%pipe,translateComma=$content[total_points]%} {?POINTS?}</strong>
</td>
+ <td class="member_data bottom">-</td>
<td class="member_data bottom" align="center">
- <strong>{%pipe,translateComma=$content[total_referals]%}</strong>
+ <strong>{%pipe,translateComma=$content[part_referals]%}</strong>
</td>
</tr>
<tr>
<td class="member_data">{--POINTS_LOCKED--}</td>
- <td class="member_data">{%pipe,translateComma=$content[total_locked]%} {?POINTS?}</td>
+ <td class="member_data">{%pipe,translateComma=$content[part_locked]%} {?POINTS?}</td>
+ <td class="member_data">{%pipe,translateComma=$content[part_locked_order]%} {?POINTS?}</td>
<td class="member_data" align="center">-</td>
</tr>
$content[special_rows]
<tr>
- <td colspan="3" class="header_column bottom top">
+ <td colspan="4" class="header_column bottom top">
<div align="center"><strong>{--MEMBER_CLICK_STATISTICS--}</strong></div>
</td>
</tr>
<tr>
<td class="member_data">{--MEMBER_RECEIVED_MAILS--}:</td>
- <td class="member_data">{%user,emails_received,translateComma%}</td>
+ <td class="member_data" align="center">{%user,emails_received,translateComma%}</td>
+ <td class="member_data">-</td>
<td class="member_data" align="center">-</td>
</tr>
<tr>
<td class="member_data">{--MEMBER_UNCONFIRMED_LOCKED--}:</td>
- <td class="member_data">{%user,ref_payout,translateComma%}</td>
+ <td class="member_data" align="center">{%user,ref_payout,translateComma%}</td>
+ <td class="member_data">-</td>
<td class="member_data" align="center">-</td>
</tr>
<tr>
<td class="member_data">{--MEMBER_CONFIRMED_MAILS--}:</td>
- <td class="member_data">{%user,mails_confirmed,translateComma%}</td>
+ <td class="member_data" align="center">{%user,mails_confirmed,translateComma%}</td>
+ <td class="member_data">-</td>
<td class="member_data" align="center">-</td>
</tr>
<tr>
<td class="member_data">{--MEMBER_SENT_MAILS--}:</td>
- <td class="member_data">{%user,emails_sent,translateComma%}</td>
+ <td class="member_data" align="center">{%user,emails_sent,translateComma%}</td>
+ <td class="member_data">-</td>
<td class="member_data" align="center">-</td>
</tr>
</table>
<tr>
- <td colspan="3" align="center" class="header_column">
+ <td colspan="4" align="center" class="header_column">
<strong>{--MEMBER_BONUS_RALLYE_DISABLED--}</strong>
</td>
</tr>
<tr>
- <td colspan="5" align="center" class="header_column bottom top">
+ <td colspan="4" align="center" class="header_column bottom top">
<strong>{--MEMBER_BONUS_POINTS_TITLE--}</strong>
</td>
</tr>
<tr>
- <td colspan="5" class="member_data bottom">
+ <td colspan="4" class="member_data bottom">
<div align="center" class="notice">{--MEMBER_BONUS_LOGIN_TURBO_NOTE--}</div>
</td>
</tr>
<tr>
<td class="member_data">{--MEMBER_BONUS_LOGIN_TOTAL--}</td>
<td class="member_data">{%user,login_bonus,translateComma%} {?POINTS?}</td>
+ <td class="member_data">-</td>
<td class="member_data" align="center">-</td>
</tr>
<tr>
<td class="member_data">{--MEMBER_BONUS_TURBO_TOTAL--}</td>
<td class="member_data">{%user,turbo_bonus,translateComma%} {?POINTS?}</td>
+ <td class="member_data">-</td>
<td class="member_data" align="center">-</td>
</tr>
<tr>
<td class="member_data">{--MEMBER_BONUS_REFERAL_TOTAL--}</td>
<td class="member_data">{%user,bonus_ref,translateComma%} {?POINTS?}</td>
+ <td class="member_data">-</td>
<td class="member_data" align="center">-</td>
</tr>
<tr>
<td class="member_data">{--MEMBER_BONUS_ORDER_TOTAL--}</td>
<td class="member_data">{%user,bonus_order,translateComma%} {?POINTS?}</td>
+ <td class="member_data">-</td>
<td class="member_data" align="center">-</td>
</tr>
<tr>
<td class="member_data bottom">{--MEMBER_BONUS_STATS_TOTAL--}</td>
<td class="member_data bottom">{%user,bonus_stats,translateComma%} {?POINTS?}</td>
+ <td class="member_data bottom">-</td>
<td class="member_data bottom" align="center">-</td>
</tr>
<tr>
<td class="member_data"><strong>{--MEMBER_BONUS_TOTAL--}</strong></td>
- <td class="member_data"><strong>{%pipe,translateComma=$content[total]%} {?POINTS?}</strong></td>
+ <td class="member_data"><strong>{%pipe,translateComma=$content[bonus_total_points]%} {?POINTS?}</strong></td>
+ <td class="member_data">-</td>
<td class="member_data" align="center">-</td>
</tr>
<tr>
<td class="member_data">$content[level]. {--REFERAL_LEVEL--} ({%pipe,translateComma=$content[percents]%}%)</td>
<td class="member_data">{%pipe,translateComma=$content[points]%} {?POINTS?}</td>
+ <td class="member_data">{%pipe,translateComma=$content[order_points]%} {?POINTS?}</td>
<td class="member_data" align="center">{%pipe,translateComma=$content[counter]%}</td>
</tr>
<tr>
- <td colspan="3" align="center" class="member_data">
+ <td colspan="4" align="center" class="member_data">
<strong class="notice">{--BONUS_EXTENSION_UPGRADE--}</strong>
</td>
</tr>
$content[balance] ({?POINTS?}):
</td>
<td width="80" align="center" class="table_footer">
- <strong>{%pipe,translateComma=$content[total]%}</strong>
+ <strong>{%pipe,translateComma=$content[total_points]%}</strong>
</td>
</tr>
</table>