- $content = array(
- 'sw' => $SW,
- 'cat' => getCategory($content['cat_id']),
- 'pay' => getPaymentTitlePrice($content['payment_id']),
- 'subj' => COMPILE_CODE($content['subject']),
- 'url' => DEREFERER($content['url']),
- 'stamp' => generateDateTime($content['timestamp_ordered'], '2'),
- 'recs' => $content['max_rec'],
- 'sent' => generateDateTime($content['timestamp_send'], '2'),
- 'clix' => $content['clicks'],
- 'perc' => COMPILE_CODE($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