r100355 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100354‎ | r100355 | r100356 >
Date:17:38, 20 October 2011
Author:reedy
Status:ok
Tags:
Comment:
1.18wmf1 MFT r100324
Modified paths:
  • /branches/wmf/1.18wmf1/extensions/Contest (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/Contest/Contest.hooks.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/Contest/Contest.sql (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/Contest/includes/ContestContestant.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/Contest/includes/ContestantPager.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/Contest/specials/SpecialContestant.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/Contest/sql/UpdateContestantRatingField.sql (added) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/extensions/Contest/Contest.hooks.php
@@ -37,6 +37,12 @@
3838 dirname( __FILE__ ) . '/sql/AddContestEmailFields.sql',
3939 true
4040 ) );
 41+
 42+ $updater->addExtensionUpdate( array(
 43+ 'applyPatch',
 44+ dirname( __FILE__ ) . '/sql/UpdateContestantRatingField.sql',
 45+ true
 46+ ) );
4147
4248 return true;
4349 }
Index: branches/wmf/1.18wmf1/extensions/Contest/sql/UpdateContestantRatingField.sql
@@ -0,0 +1 @@
 2+ALTER TABLE /*_*/contest_contestants MODIFY contestant_rating SMALLINT unsigned NOT NULL;
\ No newline at end of file
Property changes on: branches/wmf/1.18wmf1/extensions/Contest/sql/UpdateContestantRatingField.sql
___________________________________________________________________
Added: svn:eol-style
13 + native
Index: branches/wmf/1.18wmf1/extensions/Contest/specials/SpecialContestant.php
@@ -205,7 +205,7 @@
206206 $stats['rating'] = htmlspecialchars( wfMsgExt(
207207 'contest-contestant-rating',
208208 'parsemag',
209 - $this->getLang()->formatNum( $contestant->getField( 'rating' ) ),
 209+ $this->getLang()->formatNum( $contestant->getField( 'rating' ) / 100 ),
210210 $this->getLang()->formatNum( $contestant->getField( 'rating_count' ) )
211211 ) );
212212
Index: branches/wmf/1.18wmf1/extensions/Contest/includes/ContestantPager.php
@@ -220,7 +220,7 @@
221221 $value = htmlspecialchars( wfMsgExt(
222222 'contest-contestant-rating',
223223 'parsemag',
224 - $this->getLang()->formatNum( $value ),
 224+ $this->getLang()->formatNum( $value / 100 ),
225225 $this->getLang()->formatNum( $this->mCurrentRow->contestant_rating_count )
226226 ) );
227227 break;
Index: branches/wmf/1.18wmf1/extensions/Contest/includes/ContestContestant.php
@@ -558,7 +558,7 @@
559559 }
560560
561561 $this->setField( 'rating_count', $amount );
562 - $this->setField( 'rating', $amount > 0 ? $total / $amount : 0 );
 562+ $this->setField( 'rating', $amount > 0 ? $total / $amount * 100 : 0 );
563563 }
564564
565565 /**
Index: branches/wmf/1.18wmf1/extensions/Contest/Contest.sql
@@ -41,7 +41,7 @@
4242
4343 contestant_submission TINYBLOB NOT NULL, -- URL to the users submission
4444
45 - contestant_rating TINYINT unsigned NOT NULL, -- The average rating of the contestant
 45+ contestant_rating SMALLINT unsigned NOT NULL, -- The average rating of the contestant, multiplied by 100 for precision
4646 contestant_rating_count SMALLINT unsigned NOT NULL, -- The number of ratings
4747 contestant_comments SMALLINT unsigned NOT NULL -- The number of comments
4848 ) /*$wgDBTableOptions*/;
Property changes on: branches/wmf/1.18wmf1/extensions/Contest
___________________________________________________________________
Added: svn:mergeinfo
4949 Merged /branches/REL1_17/phase3/extensions/Contest:r81445,81448
5050 Merged /trunk/extensions/Contest:r99592,99653,100324
5151 Merged /branches/sqlite/extensions/Contest:r58211-58321
5252 Merged /trunk/phase3/extensions/Contest:r92580,92634,92713,92762,92765,92791,92854,92884,92886-92887,92894,92898,92907,92932,92958,93141,93149,93151,93233-93234,93258,93266,93303,93516-93518,93520,93818-93822,93847,93858,93891,93935-93936,94058,94062,94068,94107,94155,94235,94277,94346,94372,94422,94425,94444,94448,94456,94498,94517,94601,94630,94728,94738,94825,94862,94995-94997,95023,95042,95072-95073,95155,95327,95332,95410,95422,95426,95442,95468,95601,95812,98578,98598,98656
5353 Merged /branches/new-installer/phase3/extensions/Contest:r43664-66004
5454 Merged /branches/REL1_15/phase3/extensions/Contest:r51646

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r100324fix rounding issues with votesjeroendedauw02:17, 20 October 2011

Status & tagging log