[RFC] Ability to @mention specific users in posts

Discuss requests for comments/changes posted in the Issue Tracker for the development of phpBB. Upcoming releases are 3.2/Rhea and 3.3.
Post Reply
User avatar
jsebean
Registered User
Posts: 165
Joined: Wed Nov 17, 2010 1:40 am
Location: Atlantic Canada

Re: [RFC] Ability to @mention specific users in posts

Post by jsebean » Wed Apr 11, 2012 11:41 am

Erik Frèrejean wrote:
brunoais wrote:Personally I wouldn't like to have this kind of PM mixedup with the rest of the PMs, I'd rather have a folder specially made for these warnings. I think you should take that in mind while implementing this feature, don't force the user to receive the PM about this in the inbox, allow him to choose the folder to receive this.
^ that.
There should be some sort of "notification" box which is used for these kind of notifications. I don't think that the end user should be able to chose, just add a new special box for these kind of notifications.
+1, exactly how I saw Xenforo work. If you had a seperate area for notifications then that would also leave room to add more features, and allow mods to take advantage of it.
-Jonah

User avatar
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Karlsruhe, Germany
Contact:

Re: [RFC] Ability to @mention specific users in posts

Post by naderman » Wed Apr 11, 2012 11:42 am

I agree with this not being sent out as PMs, I think it should be a new type of notification which the user can select to receive via email like topic reply notifications etc.

What are we going to do about usernames containing spaces?

This should be combined with username autocomplete in the post editor.

User avatar
jsebean
Registered User
Posts: 165
Joined: Wed Nov 17, 2010 1:40 am
Location: Atlantic Canada

Re: [RFC] Ability to @mention specific users in posts

Post by jsebean » Wed Apr 11, 2012 11:46 am

naderman wrote: What are we going to do about usernames containing spaces?

This should be combined with username autocomplete in the post editor.
Same as facebook tagging does.
-Jonah

Senky
Extension Customisations
Extension Customisations
Posts: 298
Joined: Thu Jul 16, 2009 4:41 pm

Re: [RFC] Ability to @mention specific users in posts

Post by Senky » Wed Apr 11, 2012 12:01 pm

+1

Even though I think of...how would posts change when @mention option will be turned off in ACP? You will process all the posts and remove links? I would rather add new BBCode, which can be used independently (ie: [user]Senky[/user]) + each @mention will be parsed to this BBCode - and disallowing it in ACP would make parser not to parse BBCode to URL, but simply to plain text.

User avatar
callumacrae
Infrastructure Team
Infrastructure Team
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: [RFC] Ability to @mention specific users in posts

Post by callumacrae » Wed Apr 11, 2012 12:06 pm

Senky wrote:+1

Even though I think of...how would posts change when @mention option will be turned off in ACP? You will process all the posts and remove links? I would rather add new BBCode, which can be used independently (ie: [user]Senky[/user]) + each @mention will be parsed to this BBCode - and disallowing it in ACP would make parser not to parse BBCode to URL, but simply to plain text.
-1 to the BBCode.

When the mention option is turned off, simply leave the old posts alone and don't parse new ones.
Made by developers, for developers!
My blog

User avatar
brunoais
Registered User
Posts: 964
Joined: Fri Dec 18, 2009 3:55 pm

Re: [RFC] Ability to @mention specific users in posts

Post by brunoais » Wed Apr 11, 2012 12:43 pm

^
AFAIK, posts are parsed before being shown to the user that is viewing the forum. So this is not actually a problem

Senky
Extension Customisations
Extension Customisations
Posts: 298
Joined: Thu Jul 16, 2009 4:41 pm

Re: [RFC] Ability to @mention specific users in posts

Post by Senky » Wed Apr 11, 2012 12:56 pm

brunoais wrote:...posts are parsed before being shown to the user that is viewing the forum. So this is not actually a problem
In fact, it is, when it will be parsed to URL BBCode. You cannot simply define which URL BBCode was generated by @mention and which was added separatelly. You can either remove all links to users' profiles, or keep them all. Anyway, we can do it as callumacrae advises...

User avatar
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Karlsruhe, Germany
Contact:

Re: [RFC] Ability to @mention specific users in posts

Post by naderman » Wed Apr 11, 2012 1:01 pm

This should be handled entirely separate from bbcodes. It should not generate a BBCode and it should not be a BBCode.
jsebean wrote:
naderman wrote: What are we going to do about usernames containing spaces?
Same as facebook tagging does.
Well for facebook that is a lot easier, since it only needs to look for your friends. On a phpBB board the number of usernames may be hundreds of thousands, so checking all of them isn't an option. So we need to generate a SQL query to search for users by the name following an @. How do we do that if any number of words following the @ can make up a name?

merged content:
Actually to answer my own question, it's not that difficult. We just do SELECT FROM phpbb_users WHERE username LIKE 'firstword %'; and then check if any of those match the following words. If the query returns too many results we can repeat it with WHERE username LIKE 'firstword secondword %', etc.
Last edited by bonelifer on Wed Apr 11, 2012 2:47 pm, edited 1 time in total.
Reason: merged double post

User avatar
jsebean
Registered User
Posts: 165
Joined: Wed Nov 17, 2010 1:40 am
Location: Atlantic Canada

Re: [RFC] Ability to @mention specific users in posts

Post by jsebean » Wed Apr 11, 2012 2:00 pm

If there is a wide match you could use the already existing find user system that's already used in PMs and the ACP.
-Jonah

Senky
Extension Customisations
Extension Customisations
Posts: 298
Joined: Thu Jul 16, 2009 4:41 pm

Re: [RFC] Ability to @mention specific users in posts

Post by Senky » Wed Apr 11, 2012 2:15 pm

Plase note this:
if you want to add an option to @mention multi-word usernames, it is not problem with JS, however without JS, you need to think of how to do it in plain textarea! I would suggest an option to @mention someone with quotes, like:

@"my nickname"

otherwise it is almost impossible to correctly catch all mentions of multi-word usernames by php parser.

Post Reply