Editing
Template talk:Pp
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Red padlock == I'm trying to produce a red padlock on a page such as [[Wikipedia:Content disclaimer]] (which seems to fit as "permanent full protection"). What parameters are needed to do this? Thanks — Martin <small>([[User:MSGJ|MSGJ]] · [[User talk:MSGJ|talk]])</small> 10:31, 17 December 2015 (UTC) :This is the test: <pre> ( namespace == 10 or namespace == 828 or reason and obj._cfg.indefImageReasons[reason] ) and action == 'edit' and level == 'sysop' and not protectionObj:isTemporary() </pre> :The first two check for templates and modules, which [[Wikipedia:Content disclaimer]] isn't, so it needs to satisfy the third, which is kinda obscure. I've decided that it's somehow set by [[Module:Protection banner/config]], which only mentions indefImageReasons once, and it helps not at all. Anyway, is a red lock important? I managed to display a gold one. --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] ([[User talk:Redrose64|talk]]) 13:10, 17 December 2015 (UTC) ::''indefImageReasons'' is obviously about protection of images so probably not relevant to [[Wikipedia:Content disclaimer]]. I'm not sure of the exact difference between the gold lock and the red lock. Do we even need to distinguish between them? According to the [[Wikipedia:Protection policy|protection policy]], [[WP:REDLOCK]] is for ''pages that should not be modified for copyright or legal reasons'' which this page seems to fall under. — Martin <small>([[User:MSGJ|MSGJ]] · [[User talk:MSGJ|talk]])</small> 17:15, 17 December 2015 (UTC) :::I don't think that indefImageReasons is about protection of images; I think that it's to do with the padlock image to be displayed. If you look at the very bottom of [[Module:Protection banner/config]], you'll see code that sets two image filenames, one of these is <code>['image-filename-indef'] = 'Padlock-red.svg',</code> - if you search for <code>image-filename-indef</code> in the same page, there is code like this: <pre> -- Pages with a reason specified in this table will show the special "indef" -- padlock, defined in the 'image-filename-indef' message, if no expiry is set. indefImageReasons = { template = true }, </pre> :::so <code>indefImageReasons</code> has something to do with it. --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] ([[User talk:Redrose64|talk]]) 19:01, 17 December 2015 (UTC) ::::{{ul|Mr. Stradivarius}}, {{ul|Jackmcbarn}}: can we get some advice on this please? — Martin <small>([[User:MSGJ|MSGJ]] · [[User talk:MSGJ|talk]])</small> 09:02, 18 December 2015 (UTC) :::::I think the red lock is kind of pointless and poorly specified as it exists now. Perhaps we should completely replace it with the gold one. [[User:Jackmcbarn|Jackmcbarn]] ([[User talk:Jackmcbarn|talk]]) 17:07, 18 December 2015 (UTC) ::::::That sounds like a reasonable idea. I'll open a thread at [[Wikipedia talk:Protection policy]] — Martin <small>([[User:MSGJ|MSGJ]] · [[User talk:MSGJ|talk]])</small> 19:18, 20 December 2015 (UTC) ::::::'''Keep''' the red for "permanently" protected pages and '''use gold''' for indef-but-not-permanently-protected pages. Now, what do we do about pages that are "indef-protected" but which are not "permanently" protected? My recommendation: If you see a an indef-protected page that isn't "forever" change the protection to expire "a long time from now (such as 2099-12-31)" and slap a gold lock on it. If you see an indef-protected page that IS "forever, at least as far as the eye can see" slap a red lock on it and put a note in the edit summary explaining why (or un- and re-protect the page and put the note in the protection log). [[User:davidwr|davidwr]]/<small><small>([[User_talk:davidwr|talk]])/([[Special:Contributions/Davidwr|contribs]])</small></small> 21:54, 20 December 2015 (UTC) :::::::But what exactly is the difference? At the moment, a "permanently protected" page seems to be defined as one that has full edit protection and is either a template or a module. There are also two somewhat-obscure rules, the lines <code>reason and obj._cfg.indefImageReasons[reason]</code> and <code>not protectionObj:isTemporary()</code> in the test above, which neither {{user|Mr. Stradivarius}} nor {{user|Jackmcbarn}} (they being the people who made all but four edits to [[Module:Protection banner]]) seem willing to explain properly. Those two rules aside, why is an indef-full-protected template described as "permanently" protected, whereas a page in another namespace, which should rarely (or never) be altered because of legal implications (such as [[Wikipedia:Content disclaimer]], [[Wikipedia:Copyrights]] or [[Wikipedia:Text of Creative Commons Attribution-ShareAlike 3.0 Unported License]]) apparently is ''not'' permanently protected? --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] ([[User talk:Redrose64|talk]]) 23:34, 20 December 2015 (UTC) ::::::::The definition of permanent protection can be found at [[Wikipedia:Protection policy#Permanent protection]]. If the definition needs to be changed or the "vague" areas clarified (what exactly does "frequently" transcluded mean?), we can discuss it at its talk page. The padlock templates and their use should reflect what's on the policy page. [[User:davidwr|davidwr]]/<small><small>([[User_talk:davidwr|talk]])/([[Special:Contributions/Davidwr|contribs]])</small></small> 23:46, 20 December 2015 (UTC) ::::::::{{ping|Redrose64}} [[Module:Protection banner]] only does red locks the way it does because that's what the previous non-module system did. It really wasn't our decision at all. [[User:Jackmcbarn|Jackmcbarn]] ([[User talk:Jackmcbarn|talk]]) 23:59, 20 December 2015 (UTC) :::::::::But why won't you explain exactly what those two lines ''actually do''? --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] ([[User talk:Redrose64|talk]]) 08:28, 21 December 2015 (UTC) ::::::::::<code>reason and obj._cfg.indefImageReasons[reason]</code> specifies that there is a reason and that that reason is present in the indefImageReasons config table. That table only contains a key of "template", so the code effectively checks whether <code>reason</code> is equal to "template". (The <code>reason and</code> part is only necessary because if the <code>reason</code> variable does not have a value set, trying to look it up in the table will cause an error.) <code>not protectionObj:isTemporary()</code> negates the result of <code>Protection:isTemporary()</code>, which in turn checks whether <code>protectionObj.expiry</code> has a numerical value. The code that sets the expiry is fairly complex. Here is the code block: <syntaxhighlight lang="lua"> -- Set expiry local effectiveExpiry = effectiveProtectionExpiry(obj.action, obj.title) if effectiveExpiry == 'infinity' then obj.expiry = 'indef' elseif effectiveExpiry ~= 'unknown' then obj.expiry = validateDate(effectiveExpiry, 'expiry date') elseif args.expiry then if cfg.indefStrings[args.expiry] then obj.expiry = 'indef' elseif type(args.expiry) == 'number' then obj.expiry = args.expiry else obj.expiry = validateDate(args.expiry, 'expiry date') end end </syntaxhighlight> ::::::::::The reason for the complexity is that we use <code><nowiki>{{PROTECTIONEXPIRY}}</nowiki></code>, which has recently been enabled on this wiki, and to make it easier to use from Lua, [[User:Cenarium|Cenarium]] has created [[Module:Effective protection expiry]]. Effectively, if <code><nowiki>{{PROTECTIONEXPIRY}}</nowiki></code> returns "infinity", then <code>protectionObj.expiry</code> is set to "indef". If it's a date, then <code>protectionObj.expiry</code> is set to that date as a number in Unix time. If the expiry is unknown - which at the moment means that the page is unprotected or under pending changes protection - then {{para|expiry}} is checked, and if it's a value similar to "indef" then <code>protectionObj.expiry</code> is set to "indef", and if it's a date, then <code>protectionObj.expiry</code> is set to that date as a number in Unix time. If the expiry is unknown and there is no {{para|expiry}} parameter, then <code>protectionObj.expiry</code> will be <code>nil</code>. So essentially, <code>not protectionObj:isTemporary()</code> checks whether we were not able to find an expiry date, either from <code><nowiki>{{PROTECTIONEXPIRY}}</nowiki></code> or from {{para|expiry}}. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 11:03, 21 December 2015 (UTC) :::::::The distinction between indef and permanent is too vague and will be lost on most people (myself included). I really see no advantage in distinguishing between the two. The fantastically weird hacks with the expiry dates suggested by davidwr will overcomplicate things for no benefit. — Martin <small>([[User:MSGJ|MSGJ]] · [[User talk:MSGJ|talk]])</small> 09:09, 21 December 2015 (UTC) ::::::::You make some valid points, but any discussion to treat "permanently protected" pages differently than they are now (e.g. changing the padlock color from red to gold) needs to happen at [[Wikipedia talk:Protection policy]]. [[User:davidwr|davidwr]]/<small><small>([[User_talk:davidwr|talk]])/([[Special:Contributions/Davidwr|contribs]])</small></small> 14:54, 21 December 2015 (UTC) :::::::::That's why I attempted to initiate a discussion on [[Wikipedia talk:Protection policy]] a few days ago but you turned up here instead ;) — Martin <small>([[User:MSGJ|MSGJ]] · [[User talk:MSGJ|talk]])</small> 09:52, 22 December 2015 (UTC) Just to follow up on this, the red padlock is now history. — Martin <small>([[User:MSGJ|MSGJ]] · [[User talk:MSGJ|talk]])</small> 09:49, 15 January 2016 (UTC)
Summary:
Please note that all contributions to Mirrorplay: Fae are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
MPFae:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Template
Discussion
English
Views
Read
Edit
Add topic
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information