[Mediawiki-l] External dynamic images

Kasimir Gabert kasimir.g at gmail.com
Wed Mar 14 01:06:34 UTC 2007


Hello Kenneth,

I use something like the following:

=====================
<?php

//buttonLink extension - by Kasimir Gabert

$wgExtensionFunctions[] = 'registerbuttonLinkExtension';
$wgExtensionCredits['parserhook'][] = array(
'name' => 'buttonLink',
'author' => 'Kasimir Gabert',
'url' => 'http://www.dandwiki.com/',
);

/**
* Sets the tag that this extension looks for and the function by which it
* operates
*/
function registerbuttonLinkExtension()
{
global $wgParser;
$wgParser->setHook('buttonLink', 'renderbuttonLink');
}


function renderbuttonLink($input)
{
	list($img,$href) = explode(",", $input);
	if (strpos($img,"<",">",'"') || strpos($href,"<",">",'"'))
	{
		return 'Invalid input.';
	}
	$return = '<a href="' . $href . '"><img src="' . $img . '" alt="Link"/></a>';
	return $return;
}

?>
=====================

On 3/13/07, Kenneth Porter <shiva at sewingwitch.com> wrote:
> Is there a way to display a dynamically-generated image from an external
> site and make it a link to that site?
>
> The resulting HTML should look like this:
>
> <a
> href="http://sewingwitch.com/imajia/roster/char.php?name=Concerto&amp;server=Eldre%27Thalas"><img
> src="http://sewingwitch.com/imajia/roster/addons/siggen/av.php?name=Concerto&amp;saveonly=0"
> alt="" border="0"></a>
>
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l at lists.wikimedia.org
> http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>


-- 
Kasimir Gabert



More information about the MediaWiki-l mailing list