https://www.mediawiki.org/wiki/Special:Code/MediaWiki/115400
Revision: 115400 Author: ashley Date: 2012-05-18 21:29:36 +0000 (Fri, 18 May 2012) Log Message: ----------- update social tools not to call File::getThumbnail(), which was removed in r87349. Based on http://trac.wikia-code.com/changeset/53285 written by Federico 'Lox' Lucignano Modified Paths: -------------- trunk/extensions/BlogPage/SpecialArticleLists.php trunk/extensions/BlogPage/SpecialArticlesHome.php trunk/extensions/FanBoxes/MiniAjaxUpload.php trunk/extensions/PictureGame/AjaxUploadForm.php trunk/extensions/PictureGame/PictureGameHome.body.php trunk/extensions/PollNY/MiniAjaxUpload.php trunk/extensions/QuizGame/QuestionGameHome.body.php trunk/extensions/QuizGame/QuestionGameUpload.php trunk/extensions/RandomImageByCategory/RandomImageByCategory.php trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php Modified: trunk/extensions/BlogPage/SpecialArticleLists.php =================================================================== --- trunk/extensions/BlogPage/SpecialArticleLists.php 2012-05-18 10:02:09 UTC (rev 115399) +++ trunk/extensions/BlogPage/SpecialArticleLists.php 2012-05-18 21:29:36 UTC (rev 115400) @@ -92,7 +92,7 @@ $img = wfFindFile( $pageImage ); $imgTag = ''; if ( is_object( $img ) ) { - $thumb = $img->getThumbnail( 65, 0, true ); + $thumb = $img->transform( array( 'width' => 65, 'height' => 0 ) ); $imgTag = $thumb->toHtml(); } Modified: trunk/extensions/BlogPage/SpecialArticlesHome.php =================================================================== --- trunk/extensions/BlogPage/SpecialArticlesHome.php 2012-05-18 10:02:09 UTC (rev 115399) +++ trunk/extensions/BlogPage/SpecialArticlesHome.php 2012-05-18 21:29:36 UTC (rev 115400) @@ -210,7 +210,7 @@ $img = wfFindFile( $pageImage ); $imgTag = ''; if ( is_object( $img ) ) { - $thumb = $img->getThumbnail( 65, 0, true ); + $thumb = $img->transform( array( 'width' => 65, 'height' => 0 ) ); $imgTag = $thumb->toHtml(); } @@ -578,7 +578,7 @@ $img = wfFindFile( $pageImage ); $imgTag = ''; if ( is_object( $img ) ) { - $thumb = $img->getThumbnail( 65, 0, true ); + $thumb = $img->transform( array( 'width' => 65, 'height' => 0 ) ); $imgTag = $thumb->toHtml(); } Modified: trunk/extensions/FanBoxes/MiniAjaxUpload.php =================================================================== --- trunk/extensions/FanBoxes/MiniAjaxUpload.php 2012-05-18 10:02:09 UTC (rev 115399) +++ trunk/extensions/FanBoxes/MiniAjaxUpload.php 2012-05-18 21:29:36 UTC (rev 115400) @@ -279,7 +279,7 @@ $img = $this->mLocalFile; if ( !$img ) { - // This should NOT be happening...the getThumbnail() call below + // This should NOT be happening...the transform() call below // will cause a fatal error if $img is not an object error_log( 'FanBox/MiniAjaxUpload FATAL! $this->mUpload is:' . @@ -287,7 +287,7 @@ ); } - $thumb = $img->getThumbnail( $thumbWidth ); + $thumb = $img->transform( array( 'width' => $thumbWidth ) ); $img_tag = $thumb->toHtml(); $slashedImgTag = addslashes( $img_tag ); Modified: trunk/extensions/PictureGame/AjaxUploadForm.php =================================================================== --- trunk/extensions/PictureGame/AjaxUploadForm.php 2012-05-18 10:02:09 UTC (rev 115399) +++ trunk/extensions/PictureGame/AjaxUploadForm.php 2012-05-18 21:29:36 UTC (rev 115400) @@ -294,7 +294,7 @@ $img = $this->mLocalFile; if ( !$img ) { - // This should NOT be happening...the getThumbnail() call below + // This should NOT be happening...the transform() call below // will cause a fatal error if $img is not an object error_log( 'PictureGame/MiniAjaxUpload FATAL! $this->mUpload is: ' . @@ -302,7 +302,7 @@ ); } - $thumb = $img->getThumbnail( $thumbWidth ); + $thumb = $img->transform( array( 'width' => $thumbWidth ) ); $img_tag = $thumb->toHtml(); $slashedImgTag = addslashes( $img_tag ); Modified: trunk/extensions/PictureGame/PictureGameHome.body.php =================================================================== --- trunk/extensions/PictureGame/PictureGameHome.body.php 2012-05-18 10:02:09 UTC (rev 115399) +++ trunk/extensions/PictureGame/PictureGameHome.body.php 2012-05-18 21:29:36 UTC (rev 115400) @@ -476,13 +476,13 @@ $img_one_tag = $img_two_tag = ''; $img_one = wfFindFile( $row->img1 ); if ( is_object( $img_one ) ) { - $thumb_one = $img_one->getThumbnail( 128 ); + $thumb_one = $img_one->transform( array( 'width' => 128 ) ); $img_one_tag = $thumb_one->toHtml(); } $img_two = wfFindFile( $row->img2 ); if ( is_object( $img_two ) ) { - $thumb_two = $img_two->getThumbnail( 128 ); + $thumb_two = $img_two->transform( array( 'width' => 128 ) ); $img_two_tag = $thumb_two->toHtml(); } @@ -536,13 +536,13 @@ $img_one_tag = $img_two_tag = ''; $img_one = wfFindFile( $row->img1 ); if ( is_object( $img_one ) ) { - $thumb_one = $img_one->getThumbnail( 128 ); + $thumb_one = $img_one->transform( array( 'width' => 128 ) ); $img_one_tag = $thumb_one->toHtml(); } $img_two = wfFindFile( $row->img2 ); if ( is_object( $img_two ) ) { - $thumb_two = $img_two->getThumbnail( 128 ); + $thumb_two = $img_two->transform( array( 'width' => 128 ) ); $img_two_tag = $thumb_two->toHtml(); } @@ -865,13 +865,13 @@ $gallery_thumbnail_one = $gallery_thumbnail_two = ''; $img_one = wfFindFile( $row->img1 ); if ( is_object( $img_one ) ) { - $gallery_thumb_image_one = $img_one->getThumbnail( 80 ); + $gallery_thumb_image_one = $img_one->transform( array( 'width' => 80 ) ); $gallery_thumbnail_one = $gallery_thumb_image_one->toHtml(); } $img_two = wfFindFile( $row->img2 ); if ( is_object( $img_two ) ) { - $gallery_thumb_image_two = $img_two->getThumbnail( 80 ); + $gallery_thumb_image_two = $img_two->transform( array( 'width' => 80 ) ); $gallery_thumbnail_two = $gallery_thumb_image_two->toHtml(); } @@ -1151,7 +1151,7 @@ if( $next_id ) { $img_one = wfFindFile( $nextrow->img1 ); if( is_object( $img_one ) ) { - $preload_thumb = $img_one->getThumbnail( 256 ); + $preload_thumb = $img_one->transform( array( 'width' => 256 ) ); } if( is_object( $preload_thumb ) ) { $preload_one_tag = $preload_thumb->toHtml(); @@ -1159,7 +1159,7 @@ $img_two = wfFindFile( $nextrow->img2 ); if( is_object( $img_two ) ) { - $preload_thumb = $img_two->getThumbnail( 256 ); + $preload_thumb = $img_two->transform( array( 'width' => 256 ) ); } if( is_object( $preload_thumb ) ) { $preload_two_tag = $preload_thumb->toHtml(); @@ -1295,14 +1295,14 @@ if( $isPermalink || $isShowVotes ) { if( is_object( $img_one ) ) { - $vote_one_thumb = $img_one->getThumbnail( 40 ); + $vote_one_thumb = $img_one->transform( array( 'width' => 40 ) ); } if( is_object( $vote_one_thumb ) ) { $vote_one_tag = $vote_one_thumb->toHtml(); } if( is_object( $img_two ) ) { - $vote_two_thumb = $img_two->getThumbnail( 40 ); + $vote_two_thumb = $img_two->transform( array( 'width' => 40 ) ); } if( is_object( $vote_two_thumb ) ) { $vote_two_tag = $vote_two_thumb->toHtml(); Modified: trunk/extensions/PollNY/MiniAjaxUpload.php =================================================================== --- trunk/extensions/PollNY/MiniAjaxUpload.php 2012-05-18 10:02:09 UTC (rev 115399) +++ trunk/extensions/PollNY/MiniAjaxUpload.php 2012-05-18 21:29:36 UTC (rev 115400) @@ -281,7 +281,7 @@ $img = $this->mLocalFile; if ( !$img ) { - // This should NOT be happening...the getThumbnail() call below + // This should NOT be happening...the transform() call below // will cause a fatal error if $img is not an object error_log( 'PollNY/MiniAjaxUpload FATAL! $this->mUpload is: ' . @@ -289,7 +289,7 @@ ); } - $thumb = $img->getThumbnail( $thumbWidth ); + $thumb = $img->transform( array( 'width' => $thumbWidth ) ); $img_tag = $thumb->toHtml(); $slashedImgTag = addslashes( $img_tag ); Modified: trunk/extensions/QuizGame/QuestionGameHome.body.php =================================================================== --- trunk/extensions/QuizGame/QuestionGameHome.body.php 2012-05-18 10:02:09 UTC (rev 115399) +++ trunk/extensions/QuizGame/QuestionGameHome.body.php 2012-05-18 21:29:36 UTC (rev 115400) @@ -314,7 +314,7 @@ // You know why this check is here, just grep for the function // name (I'm too lazy to copypaste it here for the third time). if ( is_object( $image ) ) { - $thumb = $image->getThumbnail( 80, 0, true ); + $thumb = $image->transform( array( 'width' => 80, 'height' => 0 ) ); $thumbnail = $thumb->toHtml(); } } @@ -568,7 +568,7 @@ // independently deleted from the quiz game, poor users will // stumble upon nasty fatals without this check here. if ( is_object( $image ) ) { - $thumb = $image->getThumbnail( 80 ); + $thumb = $image->transform( array( 'width' => 80 ) ); $thumbtag = $thumb->toHtml(); } Modified: trunk/extensions/QuizGame/QuestionGameUpload.php =================================================================== --- trunk/extensions/QuizGame/QuestionGameUpload.php 2012-05-18 10:02:09 UTC (rev 115399) +++ trunk/extensions/QuizGame/QuestionGameUpload.php 2012-05-18 21:29:36 UTC (rev 115400) @@ -296,7 +296,7 @@ $img = $this->mLocalFile; if ( !$img ) { - // This should NOT be happening...the getThumbnail() call below + // This should NOT be happening...the transform() call below // will cause a fatal error if $img is not an object error_log( 'QuizGame/MiniAjaxUpload FATAL! $this->mUpload is: ' . @@ -304,7 +304,7 @@ ); } - $thumb = $img->getThumbnail( $thumbWidth ); + $thumb = $img->transform( array( 'width' => $thumbWidth ) ); $img_tag = $thumb->toHtml(); $slashedImgTag = addslashes( $img_tag ); Modified: trunk/extensions/RandomImageByCategory/RandomImageByCategory.php =================================================================== --- trunk/extensions/RandomImageByCategory/RandomImageByCategory.php 2012-05-18 10:02:09 UTC (rev 115399) +++ trunk/extensions/RandomImageByCategory/RandomImageByCategory.php 2012-05-18 21:29:36 UTC (rev 115400) @@ -110,7 +110,7 @@ $image_title = Title::makeTitle( NS_FILE, $random_image ); $render_image = wfFindFile( $random_image ); - $thumb_image = $render_image->getThumbnail( $width ); + $thumb_image = $render_image->transform( array( 'width' => $width ) ); $thumbnail = "<a href=\"{$image_title->escapeFullURL()}\">{$thumb_image->toHtml()}</a>"; } Modified: trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php =================================================================== --- trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php 2012-05-18 10:02:09 UTC (rev 115399) +++ trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php 2012-05-18 21:29:36 UTC (rev 115400) @@ -440,13 +440,13 @@ $image_1 = $image_2 = ''; $render_1 = wfFindFile( $item['img1'] ); if ( is_object( $render_1 ) ) { - $thumb_1 = $render_1->getThumbnail( 25 ); + $thumb_1 = $render_1->transform( array( 'width' => 25 ) ); $image_1 = $thumb_1->toHtml(); } $render_2 = wfFindFile( $item['img2'] ); if ( is_object( $render_2 ) ) { - $thumb_2 = $render_2->getThumbnail( 25 ); + $thumb_2 = $render_2->transform( array( 'width' => 25 ) ); $image_2 = $thumb_2->toHtml(); } _______________________________________________ MediaWiki-CVS mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
