Page MenuHomePhabricator

Create a tool/user script/template to load multilock SRG requests into Special:MultiLock
Closed, ResolvedPublic

Description

Currently when dealing with a multilock request (example) on SRG we have to manually copy and paste the list of accounts into Special:MultiLock and then strip the {{LockHide|...}} templates.

*{{LockHide|DemetriusKaye0}}

to

DemetriusKaye0

To speed up large requests, a tool or template which one-click adds the list of accounts (with the template pre-stripped) would be very useful.

Event Timeline

I think it's possible with a template too,
Template:LockHide could be modified so that in can include many usernames:
{{LockHide|LillianaTillery|GailHarvill613|RobtPiddington}}

And then we get this URL that let you lock all accounts given in template:
https://meta.wikimedia.org/wiki/Special:MultiLock?wpTarget=LillianaTillery%0AGailHarvill613%0ARobtPiddington

We can also create a new template for multiple users.

That makes a lot more sense :-)

Perhaps {{MultiLock|...}} ?

TheresNoTime renamed this task from Create a tool/user script to load multilock SRG requests into Special:MultiLock to Create a tool/user script/template to load multilock SRG requests into Special:MultiLock.Aug 5 2018, 4:40 PM
TheresNoTime updated the task description. (Show Details)

I was hoping

[{{fullurl:Special:MultiLock|wpTarget={{#if:{{{1}}}|{{{1}}}}}{{#if:{{{2}}}|%0A{{{2}}}}}{{#if:{{{3}}}|%0A{{{3}}}}}{{#if:{{{4}}}|%0A{{{4}}}}}{{#if:{{{5}}}|%0A{{{5}}}}}}}]

would do the trick, but it prints:

username1
username2
username3
{{{4}}}
{{{5}}}

I should be able to create a template for this, but I won't be able to test it.

I was hoping

[{{fullurl:Special:MultiLock|wpTarget={{#if:{{{1}}}|{{{1}}}}}{{#if:{{{2}}}|%0A{{{2}}}}}{{#if:{{{3}}}|%0A{{{3}}}}}{{#if:{{{4}}}|%0A{{{4}}}}}{{#if:{{{5}}}|%0A{{{5}}}}}}}]

would do the trick, but it prints:

username1
username2
username3
{{{4}}}
{{{5}}}

Is the only thing wrong with this the fact that the last two lines should not be there?

Is the only thing wrong with this the fact that the last two lines should not be there?

Yep!

I wrote a script that may help, at https://meta.wikimedia.org/wiki/User:Enterprisey/multi-lock-helper.js. It adds a link in the section header with a link to Special:MultiLock.

Give @Aperson's script a try. It looks like a better solution than a template.

If you still want a template, let me know.

I was hoping

[{{fullurl:Special:MultiLock|wpTarget={{#if:{{{1}}}|{{{1}}}}}{{#if:{{{2}}}|%0A{{{2}}}}}{{#if:{{{3}}}|%0A{{{3}}}}}{{#if:{{{4}}}|%0A{{{4}}}}}{{#if:{{{5}}}|%0A{{{5}}}}}}}]

would do the trick

This should work.

[{{fullurl:Special:MultiLock|wpTarget={{urlencode:{{{1|Example user}}}}}{{#if:{{{2|}}}|%0A{{urlencode:{{{2}}}}}}}{{#if:{{{3|}}}|%0A{{urlencode:{{{3}}}}}}}{{#if:{{{4|}}}|%0A{{urlencode:{{{4}}}}}}}{{#if:{{{5|}}}|%0A{{urlencode:{{{5}}}}}}}}} Lock all]

@APerson
your script is good, but it doesn't always give a "lock all" link in header ( for example here: https://meta.wikimedia.org/w/index.php?title=Steward_requests/Global&oldid=18284165#Global_lock_for_socks_of_Avoided_(or_an_impostor) because there is text before the account list ) and always requires a new header to work.

@JJMC89
Yes it works as I wanted :) Even better would be if it could show all account names on https://meta.wikimedia.org/wiki/Steward_requests/Global and add links "(talk • contribs • block • x-wiki • CA • lwcheckuser)" after every username as https://meta.wikimedia.org/wiki/Template:LockHide does.

I've created [[ https://meta.wikimedia.org/wiki/Template:MultiLock | {{MultiLock}} ]]. Let me know if it does what you want.

JJMC89 claimed this task.

@Stryn added {{MultiLock}} to the SRG lock header.