[Mediawiki-l] Function to get imagepath by wiki-imagename?

Rob Church robchur at gmail.com
Mon Mar 13 20:51:32 UTC 2006

Call the built-in Image class functions. Given a title like
"Image:Foo.png", do something like...

$title = Title::newFromText( $text );
$image = new Image( $title );

...then use the accessors, e.g. $image->getUrl() etc. to access it.

Rob Church

On 13/03/06, Kraus, Alexander (KBV) <AKraus at kbv.de> wrote:
> Hi,
> I'm writing an extension to display an linked image within an article.
> Usualy any displayed image in mediawiki ist linked to its own article.
> I need to display images what are linked to an other article - for example Main_Page.
> My problem is, that i like to use the common wiki imagename as a parameter and I don't know how to get the image's path by its name.
> For exapmle:
> <linkedimage>
> image=Imagage:Imagename.png
> <linkedimage>
> The question is, how to get the location (path) of the image represented by 'Image:Imagename.png'.
> Is there any function to get the path, by Imagename or something similar?
> thanks in advance
> Alex
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l at Wikimedia.org
> http://mail.wikipedia.org/mailman/listinfo/mediawiki-l

More information about the MediaWiki-l mailing list