mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/PageImages
synced 2024-11-15 12:00:40 +00:00
32cf6dca61
Add empty message to i18n file. This way it is shown on Special:AllMessages Change-Id: If72cd32953c3787398068a9c8a82a386b6f41f02
71 lines
1.7 KiB
PHP
71 lines
1.7 KiB
PHP
<?php
|
|
|
|
if ( !defined( 'MEDIAWIKI' ) ) {
|
|
die;
|
|
}
|
|
|
|
define( 'PAGE_IMAGES_INSTALLED', true );
|
|
|
|
$wgExtensionCredits['api'][] = array(
|
|
'path' => __FILE__,
|
|
'name' => 'PageImages',
|
|
'descriptionmsg' => 'pageimages-desc',
|
|
'author' => 'Max Semenik',
|
|
'url' => 'https://www.mediawiki.org/wiki/Extension:PageImages'
|
|
);
|
|
|
|
$dir = dirname( __FILE__ );
|
|
$wgAutoloadClasses['ApiQueryPageImages'] = "$dir/ApiQueryPageImages.php";
|
|
$wgAutoloadClasses['PageImages'] = "$dir/PageImages.body.php";
|
|
|
|
$wgExtensionMessagesFiles['PageImages'] = "$dir/PageImages.i18n.php";
|
|
|
|
$wgHooks['ParserMakeImageParams'][] = 'PageImages::onParserMakeImageParams';
|
|
$wgHooks['LinksUpdate'][] = 'PageImages::onLinksUpdate';
|
|
$wgHooks['OpenSearchXml'][] = 'PageImages::onOpenSearchXml';
|
|
|
|
$wgAPIPropModules['pageimages'] = 'ApiQueryPageImages';
|
|
|
|
$wgPageImagesScores = array(
|
|
'position' => array( 8, 6, 4, 3 ),
|
|
'width' => array(
|
|
99 => -100, // Very small images are usually from maintenace or stub templates
|
|
300 => 10,
|
|
500 => 5, // Larger images are panoramas, less suitable
|
|
),
|
|
);
|
|
|
|
$wgPageImagesBlacklist = array(
|
|
array(
|
|
'type' => 'db',
|
|
'page' => 'MediaWiki:Pageimages-blacklist',
|
|
'db' => false, // current wiki
|
|
),
|
|
/*
|
|
array(
|
|
'type' => 'db',
|
|
'page' => 'MediaWiki:Pageimages-blacklist',
|
|
'db' => 'commonswiki',
|
|
),
|
|
array(
|
|
'type' => 'url',
|
|
'url' => 'http://example.com/w/index.php?title=somepage&action=raw',
|
|
),
|
|
*/
|
|
);
|
|
|
|
/**
|
|
* How long blacklist cache lives
|
|
*/
|
|
$wgPageImagesBlacklistExpiry = 60 * 15;
|
|
|
|
/**
|
|
* Whether this extension's image information should be used by OpenSearchXml
|
|
*/
|
|
$wgPageImagesExpandOpenSearchXml = false;
|
|
|
|
/**
|
|
* Collect data only for these namespaces
|
|
*/
|
|
$wgPageImagesNamespaces = array( NS_MAIN );
|