r53730 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53729‎ | r53730 | r53731 >
Date:22:30, 24 July 2009
Author:demon
Status:deferred
Tags:
Comment:
(bug 17601) Fix the wrong linked message, add the missing header, make phpFlickr path configurable so that also other versions of phpFlickr can be used. Based on patch by DaSch.
Modified paths:
  • /trunk/extensions/ImportFreeImages/ImportFreeImages.body.php (modified) (history)
  • /trunk/extensions/ImportFreeImages/ImportFreeImages.i18n.php (modified) (history)
  • /trunk/extensions/ImportFreeImages/ImportFreeImages.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ImportFreeImages/ImportFreeImages.body.php
@@ -21,12 +21,18 @@
2222 public function execute( $par ) {
2323 global $wgUser, $wgOut, $wgRequest, $wgIFI_FlickrAPIKey, $wgEnableUploads;
2424 global $wgIFI_ResultsPerPage, $wgIFI_FlickrSort, $wgIFI_FlickrLicense, $wgIFI_ResultsPerRow;
25 - global $wgIFI_PromptForFilename, $wgIFI_FlickrSearchBy, $wgIFI_ThumbType;
 25+ global $wgIFI_PromptForFilename, $wgIFI_FlickrSearchBy, $wgIFI_ThumbType, $wgIFphpFlickr;
2626
2727 wfLoadExtensionMessages( 'ImportFreeImages' );
2828
 29+ $this->setHeaders();
 30+
2931 wfSetupSession();
30 - require_once("phpFlickr-2.2.0/phpFlickr.php");
 32+ if( !is_readable( $wgIFphpFlickr ) ) {
 33+ $wgOut->errorpage( 'error', 'importfreeimages_nophpflickr' );
 34+ return;
 35+ }
 36+ require_once( $wgIFphpFlickr );
3137
3238 $importPage = SpecialPage::getTitleFor( 'ImportFreeImages' );
3339
@@ -77,7 +83,7 @@
7884 $q = $wgRequest->getText( 'q' );
7985
8086 global $wgScript;
81 - $wgOut->addHTML( wfMsg( 'importfreeimages-description' ) . "<br /><br />
 87+ $wgOut->addHTML( wfMsg( 'importfreeimages_description' ) . "<br /><br />
8288 <form method=GET action=\"$wgScript\">".wfMsg('search').
8389 Xml::hidden( 'title', $importPage->getPrefixedDBkey() ) .
8490 ": <input type=text name=q value='" . htmlspecialchars($q) . "'><input type=submit value=".wfMsg('search')."></form>");
Index: trunk/extensions/ImportFreeImages/ImportFreeImages.i18n.php
@@ -16,7 +16,7 @@
1717 'importfreeimages-desc' => 'Provides a way of [[Special:ImportFreeImages|importing properly licensed photos]] from [http://www.flickr.com flickr]',
1818 'importfreeimages_description' => 'This page allows you to search properly licensed photos from flickr and import them into your wiki.',
1919 'importfreeimages_noapikey' => 'You have not configured your Flickr API Key.
20 -To do so, please obtain a API key from [http://www.flickr.com/services/api/misc.api_keys.html here] and set wgFlickrAPIKey in ImportFreeImages.php.',
 20+To do so, please obtain a API key from [http://www.flickr.com/services/api/misc.api_keys.html here] and set $wgFlickrAPIKey in ImportFreeImages.php.',
2121 'importfreeimages_nophotosfound' => 'No photos were found for your search criteria \'$1\', please try again.',
2222 'importfreeimages_invalidurl' => 'The URL "$1" is not a valid Flickr image.',
2323 'importfreeimages_owner' => 'Author',
@@ -25,6 +25,7 @@
2626 'importfreeimages_filefromflickr' => '$1 by user <b>[$2]</b> from flickr. Original URL',
2727 'importfreeimages_promptuserforfilename' => 'Please enter a destination filename:',
2828 'importfreeimages_returntoform' => 'Or, click <a href=\'$1\'>here</a> to return to your search results',
 29+ 'importfreeimages_nophpflickr' => 'You have not installed phpFlickr, please set $wgIFphpFlickr in your LocalSettings.php.',
2930 );
3031
3132 /** Message documentation (Message documentation)
Index: trunk/extensions/ImportFreeImages/ImportFreeImages.php
@@ -17,6 +17,7 @@
1818 $wgIFI_CreditsTemplate = 'flickr'; // use this to format the image content with some key parameters
1919 $wgIFI_GetOriginal = true; // import the original version of the photo
2020 $wgIFI_PromptForFilename = true; // prompt the user through javascript for the destination filename
 21+$wgIFphpFlickr = 'phpFlickr-2.2.0/phpFlickr.php'; // Path to your phpFlickr file
2122
2223 $wgIFI_ResultsPerPage = 20;
2324 $wgIFI_ResultsPerRow = 4;
@@ -34,7 +35,7 @@
3536 'path' => __FILE__,
3637 'name' => 'ImportFreeImages',
3738 'author' => 'Travis Derouin',
38 - 'version' => '1.0',
 39+ 'version' => '1.1',
3940 'description' => 'Provides a way of importing properly licensed photos from flickr.',
4041 'descriptionmsg' => 'importfreeimages-desc',
4142 'url' => 'http://www.mediawiki.org/wiki/Extension:ImportFreeImages',

Status & tagging log