Extension:EntreCard/es

This page is a translated version of the page Extension:EntreCard and the translation is 25% complete.
Other languages:
English • ‎Türkçe • ‎español • ‎polski • ‎中文 • ‎日本語
Extensión matemática MediaWiki
OOjs UI icon advanced.svg
EntreCard
Estado de lanzamiento estable
Descripción EntreCard extension allow you to put EntreCard widgets on your Wiki pages.
Autor(es) Jung Lee aka Max Lee (zedomaxtalk)
Última versión 0.1
Licencia Ninguna licencia especificó
Descarga Download
Verificar uso y versión de la matriz.

What can this extension do?

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

Uso

Use the following wiki syntax in your pages.

Set the id for your campaign and size.

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

Instalación

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

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

Código

<?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