EntreCard MediaWiki Extension

From Zedomax Wiki

Jump to: navigation, search

EntreCard MediaWiki Extension by ZedoMax

Save the following as entrecard.php under extensions directory

 
<?php
# EntreCard extension for MediaWiki v.0.1 by Max Lee from Zedomax.com/wiki and Zedomax.net
 
$wgExtensionCredits['parserhook'][] = array(
'name' => 'EntreCard Extension - 11/17/2007',
'author' => 'Max Lee http://zedomax.com',
'url' => 'http://zedomax.com/wiki',
'version' => 'v.0.1',
'description' => 'EntreCard.com plugin for MediaWiki',
); 
 
$wgExtensionFunctions[] = "wfEntreCard";
 
function wfEntreCard() {
    global $wgParser;
   # registers the <entrecard> extension with the WikiText parser
    $wgParser->setHook( "entrecard", "renderEntreCard" );
}
 
# 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='.$argv["id"].'';
   $output .='&type=standard_'.$argv["size"].'" type="text/javascript" id="ecard_widget">"';
   $output .= '</script>';
    return $output;
}
?>

and include:

require_once("extensions/entrecard.php");

at the end of your LocalSettings.php file.


How to use:

Use the following wiki syntax in your pages.

set the id for your campagin and size.

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


See example:

http://onebuckwiki.com/Max

Download File:

File:entrecard.zip

Personal tools