2012-02-29 09:30:06 +00:00
|
|
|
<?php
|
2012-02-29 10:50:36 +00:00
|
|
|
|
|
|
|
if ( !defined( 'MEDIAWIKI' ) ) {
|
|
|
|
die;
|
|
|
|
}
|
|
|
|
|
2012-03-12 12:54:17 +00:00
|
|
|
define( 'PAGE_IMAGES_INSTALLED', true );
|
|
|
|
|
2012-03-02 16:42:17 +00:00
|
|
|
$wgExtensionCredits['api'][] = array(
|
2012-03-01 20:00:29 +00:00
|
|
|
'path' => __FILE__,
|
|
|
|
'name' => 'PageImages',
|
|
|
|
'descriptionmsg' => 'pageimages-desc',
|
|
|
|
'author' => 'Max Semenik',
|
|
|
|
'url' => 'https://www.mediawiki.org/wiki/Extension:PageImages'
|
|
|
|
);
|
2012-02-29 10:50:36 +00:00
|
|
|
|
|
|
|
$dir = dirname( __FILE__ );
|
2012-03-01 17:37:16 +00:00
|
|
|
$wgAutoloadClasses['ApiQueryPageImages'] = "$dir/ApiQueryPageImages.php";
|
2012-02-29 10:50:36 +00:00
|
|
|
$wgAutoloadClasses['PageImages'] = "$dir/PageImages.body.php";
|
|
|
|
|
2012-03-05 21:36:43 +00:00
|
|
|
$wgExtensionMessagesFiles['PageImages'] = "$dir/PageImages.i18n.php";
|
|
|
|
|
2012-03-01 14:33:28 +00:00
|
|
|
$wgHooks['ParserMakeImageParams'][] = 'PageImages::onParserMakeImageParams';
|
|
|
|
$wgHooks['LinksUpdate'][] = 'PageImages::onLinksUpdate';
|
2012-03-08 14:01:00 +00:00
|
|
|
$wgHooks['OpenSearchXml'][] = 'PageImages::onOpenSearchXml';
|
2012-03-01 12:25:57 +00:00
|
|
|
|
2012-03-01 17:37:16 +00:00
|
|
|
$wgAPIPropModules['pageimages'] = 'ApiQueryPageImages';
|
|
|
|
|
2012-03-01 12:25:57 +00:00
|
|
|
$wgPageImagesScores = array(
|
|
|
|
'extension' => array(
|
|
|
|
'jpg' => 5,
|
|
|
|
'jpeg' => 5,
|
|
|
|
'png' => 1,
|
|
|
|
'svg' => 1,
|
|
|
|
),
|
|
|
|
'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
|
|
|
|
),
|
2012-03-02 16:42:17 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
$wgPageImagesBlacklist = array(
|
|
|
|
array(
|
|
|
|
'type' => 'db',
|
|
|
|
'page' => 'MediaWiki:Pageimages-blackist',
|
|
|
|
'db' => false, // current wiki
|
|
|
|
),
|
|
|
|
/*
|
|
|
|
array(
|
|
|
|
'type' => 'db',
|
|
|
|
'page' => 'MediaWiki:Pageimages-blackist',
|
|
|
|
'db' => 'commonswiki',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'type' => 'url',
|
|
|
|
'url' => 'http://example.com/w/index.php?title=somepage&action=raw',
|
|
|
|
),
|
|
|
|
*/
|
|
|
|
);
|
|
|
|
|
2012-03-08 14:01:00 +00:00
|
|
|
/**
|
|
|
|
* How long blacklist cache lives
|
|
|
|
*/
|
2012-03-02 16:42:17 +00:00
|
|
|
$wgPageImagesBlacklistExpiry = 60 * 15;
|
2012-03-08 14:01:00 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether this extension's image information should be used by OpenSearchXml
|
|
|
|
*/
|
|
|
|
$wgPageImagesExpandOpenSearchXml = false;
|