From f56e66ab8aa96c783596b0f391bfb252c12db30e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 14 Jul 2011 13:42:16 +0000 Subject: [PATCH] Important fix for mail and 'percents' renamed to 'click_rate' where it is a click rate --- inc/modules/member/what-stats.php | 15 +++++++++++---- .../emails/guest/guest_user_confirmed_referal.tpl | 2 +- templates/de/html/member/member_stats_row.tpl | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/inc/modules/member/what-stats.php b/inc/modules/member/what-stats.php index 3411c12dff..8b26caedb6 100644 --- a/inc/modules/member/what-stats.php +++ b/inc/modules/member/what-stats.php @@ -66,7 +66,7 @@ if (!SQL_HASZERONUMS($result)) { $OUT = ''; while ($content = SQL_FETCHARRAY($result)) { // Prepare content for output - $content['timestamp'] = generateDateTime($content['timestamp'], 2); + $content['timestamp'] = generateDateTime($content['timestamp'], '2'); // Load template $OUT .= loadTemplate('member_pool_row', true, $content); @@ -98,9 +98,16 @@ if (!SQL_HASZERONUMS($result)) { $OUT = ''; while ($content = SQL_FETCHARRAY($result)) { // Prepare data for the template - $content['timestamp_ordered'] = generateDateTime($content['timestamp_ordered'], 2); - $content['timestamp_sent'] = generateDateTime($content['timestamp_send'], 2); - $content['percents'] = ($content['clicks'] / $content['max_rec'] * 100); + $content['timestamp_ordered'] = generateDateTime($content['timestamp_ordered'], '2'); + $content['timestamp_sent'] = generateDateTime($content['timestamp_send'], '2'); + + // Click rate + $content['click_rate'] = '0'; + + // Better protection against 'divison-by-zero' + if ($content['max_rec'] > 0) { + $content['click_rate'] = ($content['clicks'] / $content['max_rec'] * 100); + } // END - if // Load row template and switch colors $OUT .= loadTemplate('member_stats_row', true, $content); diff --git a/templates/de/emails/guest/guest_user_confirmed_referal.tpl b/templates/de/emails/guest/guest_user_confirmed_referal.tpl index a0801989b1..9839b71220 100644 --- a/templates/de/emails/guest/guest_user_confirmed_referal.tpl +++ b/templates/de/emails/guest/guest_user_confirmed_referal.tpl @@ -4,7 +4,7 @@ Sie haben heute ein neues Mitglied für {?MAIN_TITLE?} geworben! Hier sehen Sie genau, in welcher Ebene Sie ihn geworben haben: ----------------- -Referal-Ebene (translateComma=$content[percents]%}%): $content[level] +Referal-Ebene ({%pipe,translateComma=$content[percents]%}%): $content[level] {?POINTS?}: {%pipe,translateComma=$content[points]%} ID des Mitgliedes: {%user,refid,bigintval=$userid%} ----------------- diff --git a/templates/de/html/member/member_stats_row.tpl b/templates/de/html/member/member_stats_row.tpl index 27aa7e9c1a..a24203a025 100644 --- a/templates/de/html/member/member_stats_row.tpl +++ b/templates/de/html/member/member_stats_row.tpl @@ -39,6 +39,6 @@ {--MEMBER_CLICK_RATE--}:
- {%pipe,translateComma=$content[percents]%}% + {%pipe,translateComma=$content[click_rate]%}% -- 2.39.5