Extension:EntreCard/es
Jump to navigation
Jump to search
![]() | This extension stores its source code on a wiki page. Please be aware that this code may be unreviewed or maliciously altered. They may contain security holes, outdated interfaces that are no longer compatible etc. Nota: No localisation updates are provided for this extension by translatewiki.net . |
![]() | ¡En estos momentos no hay nadie que se encargue del mantenimiento de esta extensión! Aunque todavía puede que funcione, los informes sobre errores o peticiones de nuevas funcionalidades serán probablemente ignorados. |
EntreCard Estado de lanzamiento sin mantenimiento |
|
---|---|
Descripción | EntreCard extension allow you to put EntreCard widgets on your Wiki pages. |
Autor(es) | Jung Lee aka Max Lee (zedomax~mediawikiwikidiscusión) |
Última versión | 0.1 |
Licencia | Ninguna licencia especificó |
Descarga | Download |
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;
}