Poll: What sort of mention structure should MentionMe use?
You do not have permission to vote in this poll.
Name-based (Currently Using)
31.82%
7 31.82%
UID-based
13.64%
3 13.64%
Just wait for MyBB to put mentions in the core
45.45%
10 45.45%
UID-based w/backward compatibility (labrocca's idea)
9.09%
2 9.09%
Total 22 vote(s) 100%
* You voted for this item. [Show Results]

Should MentionMe Change From @username To @<mention:123>
#1
I've been asked quite a few times lately about converting MentionMe to a uid-based strategy rather than continuing with the username-based mentions we use currently. For those that don't understand the difference, let me try to explain.

User Name Mentions (Currently Used)

Mentions look like this in posts (raw): @username OR @"username"

PROS:
  • works with copy-and-paste
  • intuitive works/looks similar to Twitter
  • doesn't leave much undesirable effects in post (two character max)
  • autocomplete is convenient, but optional
CONS:
  • mentions no longer work if a user changes names
  • (with caching) mentions do not immediately update when user's change groups
  • without delimiters, detection can be tricky or in some cases impossible, ie. @user name, will tag @user if that name exists even if the user intended to tag "user name".
User ID Mentions (Proposed)

Mentions look like this in posts (raw): <mention:123>

PROS:
  • mentions still work if users change names
  • mentions immediately update when user's change groups
  • detection is easy peasy
CONS:
  • user must know uid to mention (w/o autocomplete), therefore...
  • ...autocomplete is a must
  • leaves  undesirable effects in posts which would need to fixes so...
  • ...will require a conversion script for forums currently using MentionMe
It is important to keep in mind that the parsed mentions will look identical no matter which way this goes; that we have (and will have) autocomplete in either case, so knowing the uid won't be necessary; and that if a change is voted for, it will still be a long time before it gets done as I am trying to help with MyBB 1.9

Which brings me to my final point: Why not just wait for MyBB to get mentions in the core?

If you use MentionMe, please take a moment to vote and comment. If you think I have missed any Pros or Cons, then please let me know. Thank you. Smile

EDIT: Added labrocca's option
Reply
#2
Ok, it depends how you would add them to the plugin. Will be compatible with old style mentions, or not? Could be nice to use same way how xenforo does. It puts mentioned users betweend tags, something like that [mention:user-id]generated username[/mention]. These tags are disppayed only in source mode.
[MyBB 1.8 Czech translation] [MyBB 1.8 plugins]: Prune old PMs + optimize DB plugin --- Thank you/like system
Reply
#3
(2018-01-17, 12:35 PM)Eldenroot Wrote: Will be compatible with old style mentions, or not?

No. I listed that as one of the cons. Will require a conversion script.

(2018-01-17, 12:35 PM)Eldenroot Wrote: Could be nice to use same way how xenforo does. It puts mentioned users betweend tags, something like that [mention:user-id]generated username[/mention]. These tags are disppayed only in source mode.

The format I would use is listed in the OP: <mention:uid>
Reply
#4
I have a better idea for you.

Biggest issue for @username is name changes.

When the post is made you grab the existing UID and alter the post to be "@<UID>".

The when parsing you only check for "@<UID>" but when posting or editing you look for @username.

That should work and even be partially backward compatible.
Reply
#5
That sounds like the beginning of a good plan, but I have a question.

(2018-01-17, 07:23 PM)labrocca Wrote: The when parsing you only check for "@<UID>" but when posting or editing you look for @username.

I see what you are saying, but if we only look for <mention:uid> when parsing, we would still need some sort of conversion script. Otherwise, none of the old mentions would be recognized until the post is updated.
Reply
#6
Quote:I see what you are saying, but if we only look for <mention:uid> when parsing, we would still need some sort of conversion script. Otherwise, none of the old mentions would be recognized until the post is updated.

Nope, you can actually convert them when viewed if you want to. More overhead but it's doable. You can even make it a setting in case Big Boards don't want to bother or after some time has passed disable that part of the code for efficiency.
Reply
#7
(2018-01-17, 12:35 PM)Eldenroot Wrote: Ok, it depends how you would add them to the plugin. Will be compatible with old style mentions, or not? Could be nice to use same way how xenforo does. It puts mentioned users between tags, something like that [mention:user-id]generated username[/mention]. These tags are displayed only in source mode.


I think both formats should be supported, but it should be saved using the uid and current username. Using a username in the UI makes it a lot easier to autocomplete.
Reply
#8
My own plugin simply uses [@UID] and never changes the post content. I don't see it as much effort to have to find the UID of the user I want to mention, it takes an extra 2 or 3 seconds at most.
Reply
#9
(2018-01-17, 08:14 PM)kawaii Wrote: My own plugin simply uses [@UID] and never changes the post content. I don't see it as much effort to have to find the UID of the user I want to mention, it takes an extra 2 or 3 seconds at most.

You could also use some fancy JS to provide an autocomplete with a dropdown based upon usernames that actually inserts the UID instead. I'd then rewrite it to something like:

[mention="1"]

There is precedent for this type of MyCode too, like the "hr" mycode which is a single tag without a closing tag.
Reply
#10
(2018-01-17, 10:04 PM)Euan T Wrote:
(2018-01-17, 08:14 PM)kawaii Wrote: My own plugin simply uses [@UID] and never changes the post content. I don't see it as much effort to have to find the UID of the user I want to mention, it takes an extra 2 or 3 seconds at most.

You could also use some fancy JS to provide an autocomplete with a dropdown based upon usernames that actually inserts the UID instead. I'd then rewrite it to something like:

[mention="1"]

There is precedent for this type of MyCode too, like the "hr" mycode which is a single tag without a closing tag.

The reason for having a closing mention tag would be to avoid looking up the username based on uid.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)