Extension talk:LaunchExternal

From MediaWiki.org

Jump to: navigation, search

[edit] Thank you

I'm sure this is useful.

Very useful but doesn't work on mozilla v.2.0.0.18 thank you.

Great extension!

Works great on our intranet wiki.

I have a request, is possible to add code to render the color of the link to another color? This will help my users visually see what is local and what is not.

Thanks raudelh@tgce.com

[edit] split() deprecated

Evidently, function split() is deprecated. What would be a good replacement? Tisane 23:30, 11 March 2010 (UTC)

[edit] changes

Hello, I made some changes in your code :

<       $arrInput = split("::",$input); // use a different display then the file reference...
---
>       #modified separator of link: using "|" (JPA)
>       $arrInput = explode("|",$input,2);      // use a different display then the file reference...
40a42
>       $href = str_replace("'","%27",$reference);
52c54
<         return  "<a href='" . $reference . "' target='new'>" . ($display == "" ? $reference : $display) . "$server</a>";
---
>         return  "<a href='" . $href . "' target='new'>" . ($display == "" ? $reference : $display) . "$server</a>";

The first modification use explode instead of split, and pipe as separator (which is more conform to mediawiki style) The second replace apostrophe by urlencode character, otherwise a link with an apostroph causes a syntax error.

JP Ayanidès, 2010-03-15