56
edits
John Stanton (talk | contribs) |
(Extensions to Install) |
||
Line 212: | Line 212: | ||
: They allow you to do local and remote site transclusion, check both for maximum capability :-) You can actually suck in pages from a remote wiki into your page. See some of the examples I put on the [[InterWiki]] page. [[User:John Stanton|John]] 18:10, 29 October 2006 (EST) | : They allow you to do local and remote site transclusion, check both for maximum capability :-) You can actually suck in pages from a remote wiki into your page. See some of the examples I put on the [[InterWiki]] page. [[User:John Stanton|John]] 18:10, 29 October 2006 (EST) | ||
== Extensions to Install == | |||
Since Peu wanted to allow the logos of wikis to link to the sites I thought I'd do that because I already know the only ways images can be made into links on media wiki. | |||
Firstly, I don't know if it will work in the template but [http://meta.wikimedia.org/wiki/LinkedImage this extension] may let people create linked images at will if you want it. | |||
But this is the best way I can think of to make it work. I basically created a simple extension that is similar to the Fullurl and Localurl functions already built into MediaWiki. They are Fullimage and Localimage, they basicly instead of doing links to articles they make external links to local images so that they can be embeded in a method that allows for linking. | |||
Here's the code (Just place it in extensions/FullLocalImage.php and include it int LocalSettings.php) | |||
<pre><?php | |||
/** | |||
* @Extension Full/Local Image | |||
* @Author Daniel Friesen( Aka: Dantman ) | |||
* @Description Creates 2 parserfunctions. Localimage and Fullimage, they work similar | |||
* to the Localurl and Fullurl functions except they return the path to a image not a article. | |||
*/ | |||
$wgExtensionFunctions[] = 'wfFLImage'; | |||
$wgExtensionCredits['parserhook'][] = array( | |||
'name' => 'Full/Local Image', | |||
'author' => 'Daniel Friesen( Aka: Dantman )' | |||
); | |||
function wfFLImage() { | |||
global $wgParser; | |||
$wgParser->setFunctionHook( 'Localimage', array( wgFLImageFuncts, 'Localimage' ), SFH_NO_HASH ); | |||
$wgParser->setFunctionHook( 'Fullimage', array( wgFLImageFuncts, 'Fullimage' ), SFH_NO_HASH ); | |||
} | |||
class wgFLImageFuncts { | |||
function Localimage ( &$parser, $name = '', $arg = null ) { | |||
return wfImageDir( $name ) . '/' . ucfirst( $name ); | |||
} | |||
function Fullimage ( &$parser, $name = '', $arg = null ) { | |||
global $wgServer; | |||
return $wgServer . wfImageDir( $name ) . '/' . ucfirst( $name ); | |||
} | |||
}</pre> | |||
It would be much apreciated, If you can get that I can get some stuff working in [[Template:Wiki/3]] that couldn't before. [[User:Dantman|Dantman]] 19:50, 29 October 2006 (EST) |
edits