Dateien hochladen nach ''

This commit is contained in:
mediawiki 2017-09-08 17:39:21 +02:00
parent 308e4dd138
commit 735f23310e
2 changed files with 629 additions and 0 deletions

569
IPInfo.i18n.php Normal file
View File

@ -0,0 +1,569 @@
<?php
/**
* Internationalisation file for Who's Online extension.
*
* @file
* @ingroup Extensions
*/
$messages = array();
/** English
*/
$messages['en'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Message documentation (Message documentation)
*/
$messages['qqq'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Afrikaans (Afrikaans)
*/
$messages['af'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Gheg Albanian (Gegë)
*/
$messages['aln'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Arabic (???????)
*/
$messages['ar'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Egyptian Spoken Arabic (????)
*/
$messages['arz'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Asturian (Asturianu)
*/
$messages['ast'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Kotava (Kotava)
*/
$messages['avk'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Azerbaijani (Az?rbaycanca)
*/
$messages['az'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Bavarian (Boarisch)
*/
$messages['bar'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Belarusian (Taraškievica orthography) (??????????? (???????????)?)
*/
$messages['be-tarask'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Bulgarian (?????????)
*/
$messages['bg'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Bengali (?????)
*/
$messages['bn'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Tibetan (???????)
*/
$messages['bo'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Breton (Brezhoneg)
*/
$messages['br'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Bosnian (Bosanski)
*/
$messages['bs'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Catalan (Català)
*/
$messages['ca'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Chechen (???????)
*/
$messages['ce'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Czech (Cesky)
*/
$messages['cs'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Danish (Dansk)
*/
$messages['da'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** German (Deutsch)
*/
$messages['de'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Fügt die Tags <ClientIP>, <ClientName> und <IPv4orv6> hinzu.',
);
/** Lower Sorbian (Dolnoserbski)
*/
$messages['dsb'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Greek (????????)
*/
$messages['el'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Esperanto (Esperanto)
*/
$messages['eo'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Spanish (Español)
*/
$messages['es'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Estonian (Eesti)
*/
$messages['et'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Basque (Euskara)
*/
$messages['eu'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Finnish (Suomi)
*/
$messages['fi'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** French (Français)
*/
$messages['fr'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Franco-Provençal (Arpetan)
*/
$messages['frp'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Irish (Gaeilge)
*/
$messages['ga'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Galician (Galego)
*/
$messages['gl'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Swiss German (Alemannisch)
*/
$messages['gsw'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Hebrew (?????)
*/
$messages['he'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Upper Sorbian (Hornjoserbsce)
*/
$messages['hsb'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Hungarian (Magyar)
*/
$messages['hu'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Interlingua (Interlingua)
*/
$messages['ia'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Indonesian (Bahasa Indonesia)
*/
$messages['id'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Icelandic (Íslenska)
*/
$messages['is'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Italian (Italiano)
*/
$messages['it'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Japanese (???)
*/
$messages['ja'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Javanese (Basa Jawa)
*/
$messages['jv'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Khmer (?????????)
*/
$messages['km'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Korean (???)
*/
$messages['ko'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Colognian (Ripoarisch)
*/
$messages['ksh'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Luxembourgish (Lëtzebuergesch)
*/
$messages['lb'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Lithuanian (Lietuviu)
*/
$messages['lt'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Macedonian (??????????)
*/
$messages['mk'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Malayalam (??????)
*/
$messages['ml'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Marathi (?????)
*/
$messages['mr'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Malay (Bahasa Melayu)
*/
$messages['ms'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Dutch (Nederlands)
*/
$messages['nl'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Norwegian Nynorsk (?Norsk (nynorsk)?)
*/
$messages['nn'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Norwegian (bokmål)? (?Norsk (bokmål)?)
*/
$messages['no'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Occitan (Occitan)
*/
$messages['oc'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Polish (Polski)
*/
$messages['pl'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Piedmontese (Piemontèis)
*/
$messages['pms'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Pashto (????)
*/
$messages['ps'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Portuguese (Português)
*/
$messages['pt'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Brazilian Portuguese (Português do Brasil)
*/
$messages['pt-br'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Romanian (Româna)
*/
$messages['ro'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Tarandíne (Tarandíne)
*/
$messages['roa-tara'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Russian (???????)
*/
$messages['ru'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Sinhala (?????)
*/
$messages['si'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Slovak (Slovencina)
*/
$messages['sk'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Slovenian (Slovenšcina)
*/
$messages['sl'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Serbian Cyrillic ekavian (??????? (????????)?)
*/
$messages['sr-ec'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Serbian Latin ekavian (?Srpski (latinica)?)
*/
$messages['sr-el'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Sundanese (Basa Sunda)
*/
$messages['su'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Swedish (Svenska)
*/
$messages['sv'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Tamil (?????)
*/
$messages['ta'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Telugu (??????)
*/
$messages['te'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Thai (???)
*/
$messages['th'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Tagalog (Tagalog)
*/
$messages['tl'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Turkish (Türkçe)
*/
$messages['tr'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Vèneto (Vèneto)
*/
$messages['vec'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Vietnamese (Ti?ng Vi?t)
*/
$messages['vi'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Cantonese (??) */
$messages['yue'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Simplified Chinese (???(??)?)
*/
$messages['zh-hans'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);
/** Traditional Chinese (???(??)?)
*/
$messages['zh-hant'] = array(
'IPInfo' => 'I',
'ipinfo-desc' => 'Add Tags for Client IP, IP-Type and DNS-Name)',
);

60
IPInfo.php Normal file
View File

@ -0,0 +1,60 @@
<?php
if( !defined( 'MEDIAWIKI' ) ) {
echo( "This is an extension to the MediaWiki package and cannot be run standalone.\n" );
die( -1 );
}
// Extension credits that will show up on Special:Version
$wgExtensionCredits['parserhook'][] = array(
'path' => __FILE__,
'name' => 'IPInfo',
'version' => '1.0',
'author' => 'Bernhard Linz',
'url' => 'https://www.mediawiki.org/wiki/Extension:MyExtension',
'descriptionmsg' => 'ipinfo-desc', // Message key in i18n file.
'description' => 'Add Tags for Client IP, Type and DNS-Name'
);
$wgExtensionMessagesFiles['IPInfo'] = dirname( __FILE__ ) . '/' . '/IPInfo.i18n.php';
$wgHooks['ParserFirstCallInit'][] = 'IPInfoExtension::onParserSetup';
class IPInfoExtension {
// Register any render callbacks with the parser
public static function onParserSetup( Parser $parser ) {
// When the parser sees the <sample> tag, it executes renderTagSample (see below)
$parser->setHook( 'ClientIP', 'IPInfoExtension::ClientIP' );
$parser->setHook( 'IPv4orv6', 'IPInfoExtension::IPv4orv6' );
$parser->setHook( 'ClientName', 'IPInfoExtension::ClientName' );
}
// Render <ClientIP>
public static function ClientIP( $input, array $args, Parser $parser, PPFrame $frame ) {
$input = getenv("REMOTE_ADDR");
return htmlspecialchars( $input );
}
// Render <ClientName>
public static function ClientName( $input, array $args, Parser $parser, PPFrame $frame ) {
$input = gethostbyaddr(getenv("REMOTE_ADDR"));
return htmlspecialchars( $input );
}
// Render <IPv4orv6>
public static function IPv4orv6( $input, array $args, Parser $parser, PPFrame $frame ) {
if (strpos(getenv("REMOTE_ADDR"), ":") == false)
{
$input = "IPv4";
} else {
$input = "IPv6";
};
return htmlspecialchars( $input );
}
}
?>