r59690 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59689‎ | r59690 | r59691 >
Date:02:14, 3 December 2009
Author:tomasz
Status:ok
Tags:
Comment:
Fixing a bug in conversion rate due to wrong values being compared. Displaying correct total clicks
Modified paths:
  • /trunk/extensions/ContributionReporting/ContributionTrackingStatistics_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ContributionReporting/ContributionTrackingStatistics_body.php
@@ -100,7 +100,7 @@
101101 continue;
102102 }
103103 // Pull together templates, clicks, donations, conversion rate
104 - $conversion_rate = ( $template[1] == 0 ) ? 0 : ( $template[2] / $template[1] ) * 100;
 104+ $conversion_rate = ( $template[2] == 0 ) ? 0 : ( $template[2] / ( $template[1] + $template[2] ) ) * 100;
105105 $amount = ( $template[3] == 0 ) ? 0 : $template[3];
106106
107107 $link = $wgContributionReportingBaseURL.$expanded_template[0];
@@ -116,7 +116,7 @@
117117 Xml::tags( 'td', array( 'align' => 'left'), $template_link ) .
118118 Xml::element( 'td', array( 'align' => 'left'), $expanded_template[1] ) .
119119 Xml::element( 'td', array( 'align' => 'left'), $expanded_template[2] ) .
120 - Xml::element( 'td', array( 'align' => 'right'), $template[1] ) .
 120+ Xml::element( 'td', array( 'align' => 'right'), $template[1] + $template[2] ) .
121121 Xml::element( 'td', array( 'align' => 'right'), $template[2] ) .
122122 Xml::element( 'td', array( 'align' => 'right'), $amount ) .
123123 Xml::element( 'td', array( 'align' => 'right'), round($average, 2) ) .

Follow-up revisions

RevisionCommit summaryAuthorDate
r59691Pulling in r59690 for conversion rate fixestomasz02:16, 3 December 2009

Status & tagging log