JoshyPHP wrote:...If you're talking about the database, it doesn't really matter. I assume that the username column is indexed, the query will be about as fast whether there are 100 users or 100K. And either way you only want to return the first 10 or so.
True. But maybe we should think about some kind of protection to prevent DDoS attacks, since query will probably use % wildcard to search against username/username_clean columns...
Just cache the query for x amount of time? That's what Facebook does as well as others. Also it might be a good consideration to just have the BBCode for now although this isn't likely going to make it into 3.1 anyways so probably as an extension for now, maybe even an official one.
Type "@" > dropdown with all usernames in the topic, no extra queries. (PayBas, hanakin, etc.)
Type "Pa" > only PayBas remains (still no query)
Type "u" (forming "Pau") > script detects that there are no names like this in the available array, queries userbase for all users starting with "Pau", amongst which is "paulus".
@Pa should show a list (alphabetized) of every username starting with "pa", not just from the topic discussion.
We already have the SQL/AJAX for this, more or less, from the live member search.
We just need to AJAX call that function whenever there is an @ (cancel it if the next char is a space).
The only things the live member search does not do which I would like it and this to do, is allow keyboard control - up/down arrows to move through the list and enter to select one, and escape to cancel the list.
Darkness_demoN wrote:I hope you can make it real in last relice
Hate to break it to you but there is no ticket for it and here is no Pr for it so there is absolutely no chance this will be in the final release at this point. As I've already mentioned the best case scenario would be that an extension gets created for it. The applicable event location(s) should already exist so it shouldn't be a problem to create the extension by someone. However if there isn't even an "Ideas" entry for this on phpBB.com there is very little probability that this will become an official extension.
Just wanted to say, the username selection should not be limited to the users in friends and the users already in the topic. I'd assume that one major use of the feature would be to call other users to the topic, and restricting the allowed mentions to only a handful of users would make this feature less usable.
I like the plan from @Louis7777. That should work for our purposes, and if it needs to be changed based on something we're not considering now, we can handle that later.
I do custom MODs. PM for a quote! View My: MODs | Portfolio Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.
DavidIQ wrote:Just cache the query for x amount of time? That's what Facebook does as well as others. Also it might be a good consideration to just have the BBCode for now although this isn't likely going to make it into 3.1 anyways so probably as an extension for now, maybe even an official one.
BBCode would be the easiest, especially with the plain textarea that's being used now. Kind of defeats the purpose of @mentioning, but it would let you get someones attention in a topic if one wanted, which is the point.