hi All, I'm a bit new to MediaWiki and coming from pure HTML/PHP etc, i can't seem to figure out what i hope i can do:
1. i am working on an internal intranet, and we have lots of directories on networked servers. I would like to link to these via a URL so users can get to them. In HTML, it would be: file://pathToServer\pathToDir
but, i see the file:// prefix is not allowed for the URL [[ ]] feature. Is there another way???
2. for some of my external links, i want to open a new browser. In HTML: <a href="example.com" target="_blank">Click Here</a>
how to do in MediaWiki?
Thanks! mark
-----Original Message----- From: mediawiki-l-bounces@Wikimedia.org [mailto:mediawiki-l-bounces@Wikimedia.org]On Behalf Of Mark Lilly Sent: Wednesday, June 08, 2005 1:49 AM To: mediawiki-l@wikimedia.org Subject: [Mediawiki-l] Two URL q's. Link to files and directories,and target = blank for new browser window
hi All, I'm a bit new to MediaWiki and coming from pure HTML/PHP etc, i can't seem to figure out what i hope i can do:
- i am working on an internal intranet, and we have lots of
directories on networked servers. I would like to link to these via a URL so users can get to them. In HTML, it would be: file://pathToServer\pathToDir
but, i see the file:// prefix is not allowed for the URL [[ ]] feature. Is there another way???
This isn't really a mediawiki problem... you can't access a remote file using file:// unless you've got an NFS link, no matter what software you are using.
Not sure if you have an NFS, SMB, or other setup... but you'd have to put an http server on whatever server can see files as if they were local. Sorry if I've misunderstood your question but I don't see any other way.
On Wed, 08 Jun 2005, Carlton B wrote:
but, i see the file:// prefix is not allowed for the URL [[ ]] feature. Is there another way???
I would try changing this line in includes/Parser.php: define( 'URL_PROTOCOLS', 'http|https|ftp|irc|gopher|news|mailto' );
christof
Mark Lilly wrote:
- i am working on an internal intranet, and we have lots of directories on
networked servers. I would like to link to these via a URL so users can get to them. In HTML, it would be: file://pathToServer\pathToDir
See the FAQ for info on this: http://meta.wikimedia.org/wiki/MediaWiki_FAQ
- for some of my external links, i want to open a new browser. In HTML:
<a href="example.com" target="_blank">Click Here</a>
There's no support for this unless you hack it in. We hate it. :D
Search the list archives for past posts on this topic. (Use Google.)
-- brion vibber (brion @ pobox.com)
Brion Vibber <brion@...> writes:
Mark Lilly wrote:
- i am working on an internal intranet, and we have lots of directories on
networked servers. I would like to link to these via a URL so users can get
to
them. In HTML, it would be: file://pathToServer\pathToDir
See the FAQ for info on this: http://meta.wikimedia.org/wiki/MediaWiki_FAQ
got it. thanks.
- for some of my external links, i want to open a new browser. In HTML:
<a href="example.com" target="_blank">Click Here</a>
There's no support for this unless you hack it in. We hate it. :D
OK, here's a hack; i changed the makeExternalLink() function in Skin.php and it seems to work fine; here it is in case anyone wants it. I added the keyword _BLANK to my world. That anywhere after the URL in an external link, and voila, target="_BLANK" and the link opens in a new browser window. tested on IE6. should work everywhere.
thx, mark
function makeExternalLink( $url, $text, $escape = true ) { $style = $this->getExternalLinkAttributes( $url, $text ); global $wgNoFollowLinks; if( $wgNoFollowLinks ) { $style .= ' rel="nofollow"'; } $url = htmlspecialchars( $url );
//check for _BLANK keyword $blank = '_BLANK'; $posBlank = strpos($text, $blank);
//replace _BLANK with '' if found if ($posBlank !== false) { $text = str_replace($blank, '', $text); }
if( $escape ) { $text = htmlspecialchars( $text ); }
//if _BLANK, add the target attribute if ($posBlank !== false) { return '<a href="'.$url.'"'.$style.' target="'.$blank.'">'.$text.'</a>'; } else { return '<a href="'.$url.'"'.$style.'>'.$text.'</a>'; } }
On Wed, Jun 08, 2005 at 06:55:29PM +0000, Mark Lilly wrote:
- for some of my external links, i want to open a new browser. In HTML:
<a href="example.com" target="_blank">Click Here</a>
There's no support for this unless you hack it in. We hate it. :D
OK, here's a hack; i changed the makeExternalLink() function in Skin.php and it seems to work fine; here it is in case anyone wants it. I added the keyword _BLANK to my world. That anywhere after the URL in an external link, and voila, target="_BLANK" and the link opens in a new browser window. tested on IE6. should work everywhere.
Hello Mark,
Thanks for the patch... works well and it would be great if this was included in future versions as standard.
Regards
James
mediawiki-l@lists.wikimedia.org