Index: trunk/extensions/ImportFreeImages/ImportFreeImages.body.php |
— | — | @@ -21,12 +21,18 @@ |
22 | 22 | public function execute( $par ) { |
23 | 23 | global $wgUser, $wgOut, $wgRequest, $wgIFI_FlickrAPIKey, $wgEnableUploads; |
24 | 24 | 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; |
26 | 26 | |
27 | 27 | wfLoadExtensionMessages( 'ImportFreeImages' ); |
28 | 28 | |
| 29 | + $this->setHeaders(); |
| 30 | + |
29 | 31 | 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 ); |
31 | 37 | |
32 | 38 | $importPage = SpecialPage::getTitleFor( 'ImportFreeImages' ); |
33 | 39 | |
— | — | @@ -77,7 +83,7 @@ |
78 | 84 | $q = $wgRequest->getText( 'q' ); |
79 | 85 | |
80 | 86 | global $wgScript; |
81 | | - $wgOut->addHTML( wfMsg( 'importfreeimages-description' ) . "<br /><br /> |
| 87 | + $wgOut->addHTML( wfMsg( 'importfreeimages_description' ) . "<br /><br /> |
82 | 88 | <form method=GET action=\"$wgScript\">".wfMsg('search'). |
83 | 89 | Xml::hidden( 'title', $importPage->getPrefixedDBkey() ) . |
84 | 90 | ": <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 @@ |
17 | 17 | 'importfreeimages-desc' => 'Provides a way of [[Special:ImportFreeImages|importing properly licensed photos]] from [http://www.flickr.com flickr]', |
18 | 18 | 'importfreeimages_description' => 'This page allows you to search properly licensed photos from flickr and import them into your wiki.', |
19 | 19 | '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.', |
21 | 21 | 'importfreeimages_nophotosfound' => 'No photos were found for your search criteria \'$1\', please try again.', |
22 | 22 | 'importfreeimages_invalidurl' => 'The URL "$1" is not a valid Flickr image.', |
23 | 23 | 'importfreeimages_owner' => 'Author', |
— | — | @@ -25,6 +25,7 @@ |
26 | 26 | 'importfreeimages_filefromflickr' => '$1 by user <b>[$2]</b> from flickr. Original URL', |
27 | 27 | 'importfreeimages_promptuserforfilename' => 'Please enter a destination filename:', |
28 | 28 | '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.', |
29 | 30 | ); |
30 | 31 | |
31 | 32 | /** Message documentation (Message documentation) |
Index: trunk/extensions/ImportFreeImages/ImportFreeImages.php |
— | — | @@ -17,6 +17,7 @@ |
18 | 18 | $wgIFI_CreditsTemplate = 'flickr'; // use this to format the image content with some key parameters |
19 | 19 | $wgIFI_GetOriginal = true; // import the original version of the photo |
20 | 20 | $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 |
21 | 22 | |
22 | 23 | $wgIFI_ResultsPerPage = 20; |
23 | 24 | $wgIFI_ResultsPerRow = 4; |
— | — | @@ -34,7 +35,7 @@ |
35 | 36 | 'path' => __FILE__, |
36 | 37 | 'name' => 'ImportFreeImages', |
37 | 38 | 'author' => 'Travis Derouin', |
38 | | - 'version' => '1.0', |
| 39 | + 'version' => '1.1', |
39 | 40 | 'description' => 'Provides a way of importing properly licensed photos from flickr.', |
40 | 41 | 'descriptionmsg' => 'importfreeimages-desc', |
41 | 42 | 'url' => 'http://www.mediawiki.org/wiki/Extension:ImportFreeImages', |