FlightGear wiki:Village pump: Difference between revisions

Jump to navigation Jump to search
Line 111: Line 111:


::: [[User:Bugman|Bugman]] ([[User talk:Bugman|talk]]) 11:28, 7 June 2019 (EDT)
::: [[User:Bugman|Bugman]] ([[User talk:Bugman|talk]]) 11:28, 7 June 2019 (EDT)
=== Update ===
I've eliminated all <code>flightgear.org/forums</code> hard links on the wiki to use {{tl|forum url}} and {{tl|forum link}}.  The numbers are now:
* <code><nowiki>http://forum.flightgear.org</nowiki></code>: [http://wiki.flightgear.org/index.php?title=Special:LinkSearch&limit=3000&offset=0&target=http%3A%2F%2Fforum.flightgear.org 1,918 hits].
* <code><nowiki>https://forum.flightgear.org</nowiki></code>: [http://wiki.flightgear.org/index.php?title=Special:LinkSearch&limit=3000&offset=0&target=https%3A%2F%2Fforum.flightgear.org 3,000 hits].
* <code><nowiki>http://flightgear.org/forums</nowiki></code>: [http://wiki.flightgear.org/index.php?title=Special:LinkSearch&limit=500&offset=0&target=http%3A%2F%2Fflightgear.org%2Fforums 0 hits]
* <code><nowiki>https://flightgear.org/forums</nowiki></code>: [http://wiki.flightgear.org/index.php?title=Special:LinkSearch&limit=500&offset=0&target=https%3A%2F%2Fflightgear.org%2Fforums 0 hits]
For reference, here are my vim macros.  These are placed into the <code>~/.vimrc</code> file:
<syntaxhighlight lang=vim>
" --- FlightGear forum conversions ---
" Link: Convert [http://www.flightgear.org/forums forums] to {{forum link|text=forums}}.
let @f='/[http.*forum^Mv/ ^Mc{{forum link|text=^[/]^Mvc}}^[/forum^MN'
" Link: Convert [http://flightgear.org/forums/viewforum.php?f=13 section of our forum] to {{forum link|f=13|text=section of our forum}}.
let @g='/[http.*forum^Mv/f=^Mhc{{forum link|^[/ ^Mvc|text=^[/]^Mvc}}^[/forum^MN'
" Link: Convert [http://flightgear.org/forums/viewtopic.php?f=5&t=7485#p102005] to {{forum link|p=102005}}.
let @p='/[http.*forum^Mv/#^Mc{{forum link|^[la=^[/]^Mvc}}^[/forum^MN'
" Link: Convert [http://www.flightgear.org/forums/viewtopic.php?f=5&t=14254 thread] to {{forum link|t=14254|text=thread}}.
let @t='/[http.*forum^Mv/t=^Mhc{{forum link|^[/ ^Mvc|text=^[/]^Mvc}}^[/forum^MN'
" Link: Convert [http://flightgear.org/forums/viewtopic.php?f=42&t=15267#p149971 this short essay] to {{forum link|p=149971|text=this short essay}}.
let @s='/[http.*forum^Mv/#^Mc{{forum link|^[la=^[/ ^Mvc|text=^[/]^Mvc}}^[/forum^MN'
" Link: Convert [http://flightgear.org/forums/viewtopic.php?f=2&t=1697&p=12549 ARINC] to {{forum link|p=12549|text=ARINC}}.
let @r='/[http.*forum^Mv/p=^Mhc{{forum link|^[/ ^Mvc|text=^[/]^Mvc}}^[/forum^MN'
" Link: Convert [http://forum.flightgear.org/viewtopic.php?f=79&t=22840] to {{forum link|t=22840}}.
let @l='/[http.*forum^Mv/t=^Mhc{{forum link|^[/]^Mvc}}^[/forum^MN'
" Link: Convert [http://flightgear.org/forums/viewtopic.php?f=28&t=10488&p=144233&hilit=snapshot#p144233 at the forum] to {{forum link|hilit=snapshot|p=144233|text=at the forum}}.
let @i='/[http.*forum^Mv/hilit^Mhc{{forum link|^[/#^Mxi|^[la=^[/ ^[vc|text=^[/]^Mvc}}^[/forum^MN'
" Link: Convert [http://flightgear.org/forums/viewtopic.php?f=17&t=20214&p=186020&hilit=xml+french#p185963] to {{forum link|hilit=xml+french|p=185963}}.
let @j='/[http.*forum^Mv/hilit^Mhc{{forum link|^[/#^Mxi|^[la=^[/]^Mvc}}^[/forum^MN'
" URL: Convert http://flightgear.org/forums/viewtopic.php?f=6&t=14758 to {{forum url|t=14758}}.
let @w='/http.*forum^Mv/t=^Mhc{{forum url|^[llea}}^[/forum^MN'
" URL: Convert http://flightgear.org/forums/viewtopic.php?f=17&t=2766&p=26459&hilit=generic+protocol#p26459 to {{forum url|hilit=generic+protocol|p=26459}}.
let @h='/http.*forum^Mv/hilit^Mhc{{forum url|^[/#^Mxi|^[la=^[ea}}^[/forum^MN'
" URL: Convert http://flightgear.org/forums/viewtopic.php?f=2&t=3430&start=0&st=0&sk=t&sd=a&hilit=oscillations+x to {{forum url|t=3430|hilit=oscillations+x}}
let @b='/http.*forum^Mv/t=^Mhc{{forum url|^[llelv/hilit^Mhxi|^[/.[\n ]^[a}}^[/forum^MN'
" URL: Convert http://www.flightgear.org/forums/viewtopic.php?f=4&t=6890 to {{forum url|t=6890}}.
let @v='/http.*forum^Mi{{forum url|^[lv/t=^Mhxllea}}^[/forum^MN'
" URL: Convert http://flightgear.org/forums/viewtopic.php?f=6&t=3085&p=28982#p28982 to {{forum url|p=28982}}.
let @x='/http.*forum^Mv/#^Mc{{forum url|^[la=^[ea}}^[/forum^MN'
" URL: Convert http://flightgear.org/forums/viewtopic.php?f=6&t=5814&p=44566 to {{forum url|p=44566}}.
let @y='/http.*forum^Mv/p=^Mhc{{forum url|^[llea}}^[/forum^MN'
" Member: Convert [http://www.flightgear.org/forums/memberlist.php?mode=viewprofile&u=510 Gijs] to {{forum list|type=member|u=510|text=Gijs}}.
let @m='/[http.*forum^Mv/member^Mhc{{forum link|type=^[/list^[v/u=^Mhc|^[/ ^[xi|text=^[/]^Mvc}}^[/forum^MN'
" Search: Convert [http://www.flightgear.org/forums/search.php?st=0&amp;sk=t&amp;sd=d&amp;sr=posts&amp;keywords=head+tracking head tracking] to {{forum list|type=search|keywords=head+tracking|text=head tracking}}.
let @a='/[http.*forum^Mv/search^Mhc{{forum link|type=^[/.php^[v/keywords=^Mhc|^[/ ^[xi|text=^[/]^Mvc}}^[/forum^MN'
</syntaxhighlight>
The <code>^[</code> and <code>^M</code> characters have to be converted into the escape and enter escape sequences for this to work (using e.g. {{key press|i}}, {{key press|ctrl|v}}, {{key press|esc}}, {{key press|esc}} and {{key press|i}}, {{key press|ctrl|v}}, {{key press|enter}}, {{key press|esc}}).  These handle the <code>forum.flightgear.org</code> hard links as well, but only cover maybe 90% of all hard links.  One link that often needs manual intervention is when ''start=X'' is in the URL.  This requires following the link, finding the post number, and then supplying the {{param|p}} parameter, which is absent from the original URL, to the templates.
'''Roadmap:'''  Once all the <code>http</code> links are converted, all links will be present in the <code>https</code> search.  Then the {{tl|project infrastructure}} template can be modified to produce <code>http</code> forum URLs rather than <code>https</code>.  This will cause only the unconverted <code>https</code> links in be present in the <code>https</code> search.
[[User:Bugman|Bugman]] ([[User talk:Bugman|talk]]) 04:19, 11 June 2019 (EDT)


== Language flags on the main page ==
== Language flags on the main page ==

Navigation menu