Extension:EntreCard/pl

From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page Extension:EntreCard and the translation is 33% complete.

Other languages:
English • ‎español • ‎polski • ‎日本語
Podręcznik rozszerzeń MediaWiki
OOjs UI icon advanced.svg
EntreCard
Status wydania: stabilne
Opis EntreCard extension allow you to put EntreCard widgets on your Wiki pages.
Autor(zy) Jung Lee aka Max Lee (zedomaxtalk)
Ostatnia wersja 0.1
Licencja Nie określono
Pobieranie Pobieranie
Przetłumacz rozszerzenie EntreCard jeżeli jest dostępne na translatewiki.net
Sprawdź wykorzystywanie i matrycę wersji.

What can this extension do?

EntreCard extension allows you to put EntreCard widgets on your wiki pages.

Użycie

Use the following wiki syntax in your pages.

Set the id for your campagin and size.

<entrecard id="10" size="127"></entrecard>

Instalacja

To install this extension, add the following to LocalSettings.php :

require_once("$IP/extensions/EntreCard.php");

Kod

<?php
/**
 * EntreCard extension for MediaWiki
 *
 * @version 0.1
 * @author Max Lee
 * @link https://www.mediawiki.org/wiki/Extension:EntreCard
 */

//Extension credits that show up on Special:Version 
$wgExtensionCredits['parserhook'][] = array(
	'name' => 'EntreCard',
	'author' => 'Max Lee',
	'url' => 'https://www.mediawiki.org/wiki/Extension:EntreCard',
	'version' => '0.1',
	'description' => 'Allows you to put [http://entrecard.com EntreCard] widgets on your wiki pages',
); 

//Avoid unstubbing $wgParser too early on setHook() on modern (1.12+) MW versions, as per r35980
if ( defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' ) ) {
	$wgHooks['ParserFirstCallInit'][] = 'wfEntreCard';
} else {
	$wgExtensionFunctions[] = 'wfEntreCard';
}

//Registers the <entrecard> tag with the WikiText parser
function wfEntreCard() {
	global $wgParser;
	$wgParser->setHook( 'entrecard', 'renderEntreCard' );
	return true;
}

//The callback function for converting the input text to HTML output
function renderEntreCard( $input, $argv ) {
	$output = '<script type="text/javascript" src="http://entrecard.s3.amazonaws.com/widget.js?user_id='.htmlspecialchars($argv["id"]).'';
	$output .='&type=standard_'.htmlspecialchars($argv["size"]).'" type="text/javascript" id="ecard_widget">"';
	$output .= '</script>';
	return $output;
}

Sites using this extension