]> git.mxchange.org Git - mailer.git/commitdiff
Important fix for mail and 'percents' renamed to 'click_rate' where it is a click...
authorRoland Häder <roland@mxchange.org>
Thu, 14 Jul 2011 13:42:16 +0000 (13:42 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 14 Jul 2011 13:42:16 +0000 (13:42 +0000)
inc/modules/member/what-stats.php
templates/de/emails/guest/guest_user_confirmed_referal.tpl
templates/de/html/member/member_stats_row.tpl

index 3411c12dff23b800d53172b8564e1a601f59cdec..8b26caedb61913290193d6345bc7d2378f49db64 100644 (file)
@@ -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);
index a0801989b12e6152e5857bffb206a1068c7cb5eb..9839b7122037875c9c14334fcda8c46ade3bc910 100644 (file)
@@ -4,7 +4,7 @@ Sie haben heute ein neues Mitglied f&uuml;r {?MAIN_TITLE?} geworben!
 
 Hier sehen Sie genau, in welcher Ebene Sie ihn geworben haben:
 -----------------
-Referal-Ebene (translateComma=$content[percents]%}&#37;): $content[level]
+Referal-Ebene ({%pipe,translateComma=$content[percents]%}&#37;): $content[level]
 {?POINTS?}: {%pipe,translateComma=$content[points]%}
 ID des Mitgliedes: {%user,refid,bigintval=$userid%}
 -----------------
index 27aa7e9c1ad8cf8d7c7cf7af91e8a2e4b64909de..a24203a025c8c499a1199edacf5803ecd966aeb8 100644 (file)
@@ -39,6 +39,6 @@
        </td>
        <td align="center" class="{%template,ColorSwitch%} top">
                {--MEMBER_CLICK_RATE--}:<br />
-               <strong>{%pipe,translateComma=$content[percents]%}&#37;</strong>
+               <strong>{%pipe,translateComma=$content[click_rate]%}&#37;</strong>
        </td>
 </tr>