Hello Forum lurkers specifically Wiki Editors or readers, I bring you today an idea to save the editors a lot of the hassle I have been noticing recently in the Recent Changes page
I guess this should have been posted on the other forums but I don't honestly remember my log in information there and I am hoping someone here can guide me to a wiki moderator (Mosu seems active but I don't know if he has an account on WP forums)
Basically to cut the chase the idea is to install this extension which I have already checked whether or not it will work with the WikiMedia/PHP/MySQL versions iROwiki is using and the answer is yes it will
Then use Regex to replace all the co-ordinates in every single page on the wiki with the new {{Navi}} template that has been getting implemented slowly
Of course needs a moderator to install the extension and then they can grant me access to its special page if they wish or take the Regular Expressions which I am going to include below and mass edit everything out
For the sake of showing it working I edited 3 pages using a chain of the three expression I made and the results can be seen here: Spy Quest, Ayothaya Dungeon Entrance Quest, and Eye of Hellion Quest
In case this was not accepted by moderators or unnoticed but you want to edit using the commands you may use this site if you're inexperienced with regex (Just make sure to click on the check "Enable regular expression") otherwise SublimeText and RegReplace are much more efficient
And finally the code:
Expression 1: (Replaces all old /navi whether they contain a link or not) (Updated to include chance of white spaces between the parentheses and the /navi, thanks Mosu)
\(?\s*'*/navi\s(?:\{\{map\|id\=)?([^\s]+)(?:\s[^\s]+\}\})?\s([0-9]{1,3})/([0-9]{1,3})'*\s*\)?
Expression 2: (Replaces all co-ordinates following the format of (prontera 52, 36) )
\(([^\s]+)\s([0-9]{1,3}),\s*([0-9]{1,3})\)
Expression 3: (Replaces all co-ordinates following the format of prontera (52, 36) only if prontera is linked because otherwise I found it replacing things like "go to spot (52, 36)")
\[\[([^\s]+)\]\]\s\(([0-9]{1,3}),\s*([0-9]{1,3})\)
All of which are replaced with this:
{{Navi|$1|$2|$3}}
Ah and final note, I learnt most of what I know about Regex today... So if you know a way to improve any of the expressions or mix all three magically please go ahead! I am by no means an expert but I just believe this will be way faster than editing hundreds of pages by hand.
Edited by Mathspy, 02 January 2017 - 09:02 AM.