Hi All,
There's some functionality I'd welcome any testing of, and any code review comments that anyone would care to make.
The functionality is image linking to something besides the image description page. (a.k.a. http://bugzilla.wikimedia.org/show_bug.cgi?id=539 )
The four modes are: # An External link. Example usage: [[Image:Google.gif|link=[http://www.google.com/]]] # An Internal link. Example usage: [[Image:Wikipedia.gif|link=[[Wikipedia]]]], or [[Image:Google.gif|link=[[:en:http://www.google.com/]]]] (yes, there is actually a "http://www.google.com/" redirect on the Wikipedia, which points to [[Google]] ). # No link. Example usage: [[Image:Wikipedia.gif|link=none]] # Linking to the image description page, as per current. To get this, omit the "link=" parameter.
If you don't specify a link, then you just get the current default behaviour. Also the linking for each new type can be enabled or disabled separately in LocalSettings.php , so if you wanted say internal links + no links, but are worried about spam on external links, then you can enable just the 2 linking types you want. The default for all three options is off.
Note that the "link=" does not work inside a <gallery>. However, this is consistent with all the other image attributes, like "right", "center", "thumb", "thumb=", "frame", and "left", none of which work inside galleries either.
There is a temporary test wiki for you to try out on this stuff located at: http://theplaypit.nickj.org/wiki/ . Please feel free to modify whatever you like, or create any test pages or sandbox pages that you like, as I'm planning on killing that test wiki if/when these patches or any equivalent functionality patches are checked in (or in two weeks, whichever happens sooner). The only request I'd make is that you don't destroy the front page, so as to ensure that other people can easily see some examples of it being used there on the Main Page.
The "svn diff" for the changes against SVN is at: http://files.nickj.org/MediaWiki/image-linking-diff.txt
Also, this diff retains the current "longdesc" attribute for <img> tags (i.e. it's there for current images, and you still get it for images using link targets). To access this in Firefox, you right-click on an image, go to Properties, and in the popup box it will say "Description:" and give the URL for the image's description page. This means that you can still get to the image description page for an image, even if that images is linking off to somewhere else, or has no link. The "longdesc" tag is a W3C standard img attribute ( for more info see: http://www.w3.org/TR/html401/struct/objects.html#adef-longdesc-IMG ).
I also want to send a big acknowledgement out to Rowan Collins. Rowan, if you're out there somewhere, your patches were extremely helpful to me - so thank you!
All the best, Nick.