Page MenuHomePhabricator

More PST magic, e.g. editor username
Closed, ResolvedPublic

Description

Author: FT2.wiki

Description:
Recongizing the caching concerns of bug 4196

http://bugzilla.wikimedia.org/show_bug.cgi?id=4196

Can we have one extra ~~ code for "the name (not signature) of the present editor making a post".

Something like:

~~~ == signature of poster
~~~~ == sig of poster + timestamp of post
~~~~~ == timestamp of post
~~~~~~ == username of poster

#A variable {{CURRENTUSER}} was declined due to caching concerns, but this is different and, I suggest, useful. There are many templates where one would like to pre-fill in the name of the user posting, for example:

"This request posted by [[User:~~~~~~|~~~~~~]] at ~~~~~"

in a template. It would see very wide use to pre-fill many templates.

Please? :)


Version: unspecified
Severity: enhancement

Details

Reference
bz12733

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:01 PM
bzimport set Reference to bz12733.
bzimport added a subscriber: Unknown Object (MLST).

FT2.wiki wrote:

Also in section headers in templates, such as:

"== Request by ~~~~~~ ==
{{{1}}}

..."

where one would want to autofill the users name, not their signature.

FT2.wiki wrote:

Or more accurately as a template, perhaps like this, to show possible uses:

"== Request by ~<includeonly>~~~~</includeonly>~ ==

: User links: <includeonly>{{userlinks|~~~~~~}}</includeonly>

{{{1|''Please add your request here''}}}

..."

A user SUBSTing this template would end up with the section header filled out.

cbm.wikipedia wrote:

add six-tilde shortcut for user name

I believe this is all that needs to be changed.

Attached:

Note that ~<includeonly>~~~~</includeonly>~ would not work, the ~~~~ in the middle would be expanded to the signature, you would have to use <includeonly></includeonly>~~

I'm very disinclined to add yet another tilde sequence.

See also bug 10336.

FT2.wiki wrote:

Its not so important its code, so long as the functionality's possible.

Previous thoughts floundered because {{CURRENTUSER}} were conceived as being "the user reading the page", which killed caching.

The idea here is a code for "the user posting the page" that can be hard substituted into the page markup.

I did have one thought. Suppose codes were added such as these:

{{INSERTSIG}}
{{INSERTSIGANDTIMESTAMP}}
{{INSERTTIMESTAMP}}
{{INSERTUSERNAME}}

and then ~~~ ~~~~ ~~~~~ were simply allowed to be aliases ("convenience abbreviations") to the first three?

Then these abbreviations would work as normal, but other items such as "username of the posting user" could be inserted too.

FT2.wiki wrote:

To clarify:

In the above, the codes such as {{INSERTSIG}} would be the "formal" name for the command to "insert the users sig here as markup", ie identically to how ~~~ does. ~~~ would be an alias of this.

Then additional inserts on the same theme such as "insert username" would simply not have a tilde-based alias, but would be accessed by {{INSERTUSERNAME}}, which would be immediately replaced in the markup by the posting user's name, as per the original idea.

Rather than the {{...}} syntax which could be confused with templates, and syntax could get confusing because they would technically be substed when you haven't defined subst:, How about the ... syntax used for things like NOTOC. Those wouldn't be as confusing for use.

SIG - ~~~
SIG&TIMESTAMP or SIG TIMESTAMP - ~~~~
TIMESTAMP - ~~~~~
USERNAME

Technically, SIG&TIMESTAMP isn't actually needed, and the latter is also cleaner, so I'd swing for that method a bit more.

FT2.wiki wrote:

So maybe:

~~~ is a "convenience shortcut" for INSERTSIG
~~~~ is a "convenience shortcut" for INSERTSIG INSERTTIMESTAMP
~~~~~ is a "convenience shortcut" for INSERTTIMESTAMP

and then INSERTUSERNAME exists and can likewise be used, but doesn't have a ~~* shortcut?

(I've kept the INSERT wording so its very clear that the code *inserts* the poster's sig, username or timestamp of posting, and is not kept in the actual posted markup)

The suggested syntax (6 tildes) is terrible. 5 tildes was terrible too and I should have vetoed it at the time. I've changed the bug title so that we don't appear to be supporting such syntax.

My preferred syntax for the feature in question is {{subst:USERNAME}}. {{USERNAME}} without the subst: prefix would break in some (preferably informative) way.

FT2.wiki wrote:

Sounds good.

Signature, timestamp, username... are there any other "elemental items" that're useful, or is it just those three in various combinations that we want to be able to add to the markup (via subst or tildes)?

Probably just those three, isn't it?

redwwjd wrote:

Same effect as {{subst:USERNAME}} can be achieved via {{subst:REVISIONUSER}} as of r48149

Tweaking bug resolution. WORKSFORME implies that this wasn't an issue prior to the bug being filed.

This is essentially a dupe of bug 10336. Marking as such.

  • This bug has been marked as a duplicate of bug 10336 ***