[08:58:28] [[Tech]]; Pentagonspace11; /* which is the best software testing training institute in bangalore? */ new section; https://meta.wikimedia.org/w/index.php?diff=23535165&oldid=23520360&rcid=24501668 [10:36:09] Can anyone kindly point me in the right direction on where and how to best modify the behaviour of File links? [10:36:55] For example, if a page exists in Main and has any image display, such as: [10:36:56] [[File:myimage.jpg]] [10:36:58] By default, it would link to mydomain.com/File:myimage.jpg [10:38:09] Instead, I would like it to link to a custom page where I have custom jpeg displays. [10:38:10] For example, the default link would instead become: [10:38:12] mydomain.com/display.cgi?myimage.jpg [10:38:57] But only if there is no other link specified in the markup, as in [[File:myimage.jpg|link=someotherlink]] [10:39:29] And only if the file is a jpg. And only for non-login visitors/users. [10:41:39] Thanks in advance for any tips on in which MW files to make these code tweaks. [10:49:57] Maybe in StreamFile.php or is there a template for modifying this behaviour? [15:37:12] [[Tech]]; Johannnes89; Undo revision 23535165 by [[Special:Contributions/Pentagonspace11|Pentagonspace11]] ([[User talk:Pentagonspace11|talk]]) linkspam; https://meta.wikimedia.org/w/index.php?diff=23537095&oldid=23535165&rcid=24504411 [16:55:32] [[Tech]]; -revi; /* Hide partial block & temporary watchlist stuff */ tx; https://meta.wikimedia.org/w/index.php?diff=23537651&oldid=23537095&rcid=24505084 [16:56:55] Hi all, Yesterday, I used the UrlShortener function at the beta wikipedias (so https://meta.wikimedia.beta.wmflabs.org/wiki/Special:UrlShortener). I noticed that the produced url did not thave the https:// in front of it (that I do get from meta). Is this normal (or should I forward this to Phabircator...)? [17:04:21] Hello and testing, is this working? [17:04:35] Anyone here? [17:05:35] no [17:05:57] :-) [17:18:10] I would like to modify the default behaviour of File links from the Main namespace by changing all target links to a custom display page for jpeg request while including the filename as a parameter of the target links. Do some special template procedures exist or if not, which php script files can be modified to to achieve this? [17:31:47] Tuxedo: using a template is probably your best bet [17:37:28] I've been searching mediawiki.org but could not find anything anyone had done before. Is perhaps Linker.php a relevant file to modify? [17:40:15] I would suggest not to directly edit the MediaWiki core. [17:47:21] Yes, I agree. But how? Is there another existing solution? [17:51:18] Probably https://www.mediawiki.org/wiki/Manual:Hooks/HtmlPageLinkRendererBegin ? [17:52:11] Many thanks [18:02:39] That's from 1.28 and unfortunately I'm still on 1.27. [18:04:20] Then probably https://www.mediawiki.org/wiki/Manual:Hooks/LinkBegin ? [18:08:28] I think I'm out of luck today, removed from core in 1.26 [18:15:50] It shouldn't according to the documentation? [18:15:55] > This feature was removed from MediaWiki core in version 1.36.0 (after being deprecated in 1.28.0). [18:18:43] * > This feature was removed from MediaWiki core in version 1.36.0 (after being deprecated in 1.28.0). [18:21:36] All I have in includes/ with Link something are LinkFilter.php and Linker.php [18:26:42] My goal is to change pages in Main with [[File:myimage.jpg]] to link images to example.com/display.cgi?myimage.jpg but only if no other link is specified in the markup (as in ..|link=someotherlink]]) and only if the file is a jpg and only for non-login visitors. [18:29:47] If it's done in the source files, it's Ok, as it's not a permanent solution for a old but still useful wiki installation. Eventually, it the MW will be upgraded, but which depends on external factors relating to the existing server, which cannot be upgraded easily due to various dependency issues...