This is a trivial patch of MediaWiki Extension:Anysite to shift x-wise the included frame.
<?php
Minseong Extension
- Tag :
- <anyweb>website</anyweb>
- Ex :
- from url http://aurora1.sourceforge.net
- <anyweb>http://aurora1.sourceforge.net</anyweb>
- <anyweb mywidth="800" myheight="600" myshift="30">http://my.server.com/</anyweb> to shift x-wise -- F.P.L. laussy.org
- Enjoy !
$wgExtensionFunctions[] = 'wfanyweb';
$wgExtensionCredits['parserhook'][] = array(
'name' => 'anysite extension',
'description' => 'Display sites',
'author' => 'Minseong Kim and Others',
'url' => 'http://www.mediawiki.org/wiki/Extension:Anysite'
);
function wfanyweb() {
global $wgParser;
$wgParser->setHook('anyweb', 'renderanyweb');
}
- The callback function for converting the input text to HTML output
function renderanyweb($input, $argv) {
if (isset($argv['mywidth'])) {
$width = $argv['mywidth'];
} else {
$width = 770;
}
if (isset($argv['myheight'])) {
$height = $argv['myheight'];
} else {
$height = 500;
}
if (isset($argv['myshift'])) {
$shift = $argv['myshift'];
} else {
$shift = 30;
}
$output= '<iframe style="position:relative; right:'.$shift.'px;" name="anyweb" src="'.htmlspecialchars($input).'" width="'.$width.'" height="'.$height.'" frameborder="0">'.'</iframe>';
return $output;
}
You can now use
<anyweb myshift="30">http://wikipedia.org</anyweb>
to shift it 30px from the right (i.e., on the left).