Page 1 of 21

[ABD] @Mention System

Posted: Tue Feb 03, 2015 9:37 pm
by Wolfsblvt
Image

Extension Name: @Mention System
Author: Wolfsblvt

Extension Description: Allows users to mention other users in posts. If a user is mentioned, he will recieve a notification unless he deactivated this notification. Meantioned usernames can be automatically colored in their username color. Mentioned users will be autosuggested.
Extension Version: 1.0.0

Requirements:
  • PHP: >= 5.4.0
Features:
Current Features
****************
  • Send Mention notifications as notification or email
  • Mention with @Username, [mention]Username[/mention] or [mention="Username"]Nickname[/mention]
  • All three can be deactivated separately
  • Mentions are replaced in text with username color
  • Autocomplete feature whily typing mentions...
  • ... with avatars and username color
  • Suggest user who have posted in this topic first
  • Automatically closes mention BBCodes
  • Defining of own [mention] BBCode is forbidden
Planned Features
****************
  • None
Screenshots:
Image

Image

Image

Image


Extension Download: wolfsblvt.mentions.zip

GitHub Repository: http://github.com/Wolfsblvt/mentions/
(Just for viewing purposes, do not install this extension from GitHub!)

More Information:
This extension is based on some event requests, here, here and here.
I think since the notification center was first introduced for phpBB, many thought of this feature, and it is even discussed to be integrated in phpBB maybe. I don't want to wait till then, so I have done that for all of you :P

I have tested this extension several times, also on my board, wich is some kind of big, but I am quite sure there will e issues with even bigger forums maybe. So I need heavy testing from you all!
Whoever has a board with many many users should test that extension and tell me if it is slowing down the site.
For this, I have implemented a small runtime tracking function in the dev version. So all you have to do is create some posts with mentions of all kind (especially the @mention please) in a thread, and then add the parameter measure_time=1 to the url of the thread. The site will load several seconds then and it will lead to an output of runtime. I would be pleased if you could post some of those times here, especially when the runtome takes more than a few miliseconds.

Bug reports for this extension in this thread please, or on GitHub.

══════════════════════════════════════════════════
If you like what I am doing, you can Image me or buy me something here Image or here Image so that I keep doing what I am doing.

Re: [DEV] @Mention System

Posted: Tue Feb 03, 2015 9:37 pm
by Wolfsblvt
Changelog:
Actual Version
**************

-- Version 1.0.0 --------------
• First implementation for 3.1
• Implemented php requirement checker
• Implemented autocomplete feature
• Implemented sorting for autocomplete
• Implemented auto bbcode closing
• Implemented parsing function for mentions
• Implemented Notification + Email
• Implemented prevention of [mention] bbcode create
• Implemented ACP options
• Implemented check for php version on extension enable

###########################################################################
Past Versions
*************

None

Re: [DEV] @Mention System

Posted: Tue Feb 03, 2015 10:23 pm
by frax
Great job. Really nice, I try it now. Thanks.

Re: [DEV] @Mention System

Posted: Tue Feb 03, 2015 10:38 pm
by Jessica
Very nice!

Re: [DEV] @Mention System

Posted: Tue Feb 03, 2015 10:51 pm
by Volksdevil
Testing finds:

* Doesn't seem to work in quick reply? Although I guess that can be looked into/discussed?

*Seems to be a conflict with the Quick reply EXT, the 'refer by username' part of that EXT.

Looking good though! :D

Re: [DEV] @Mention System

Posted: Tue Feb 03, 2015 11:02 pm
by draky
Volksdevil wrote:Testing finds:

* Doesn't seem to work in quick reply? Although I guess that can be looked into/discussed?

*Seems to be a conflict with the Quick reply EXT, the 'refer by username' part of that EXT.

Looking good though! :D
Impressive extension, but same question here about Quick Reply EXT...

Re: [DEV] @Mention System

Posted: Tue Feb 03, 2015 11:02 pm
by Wolfsblvt
Volksdevil wrote:Doesn't seem to work in quick reply? Although I guess that can be looked into/discussed?
Yes, currently it will not work with quick reply. Or to be more specific: Mentioning will work of course, the users will recieve a notification when you send the post, but autosuggest doesn't work there.
Can be discussed if I should implement that, yes. Shouldn't be too much work.
Volksdevil wrote:Seems to be a conflict with the Quick reply EXT, the 'refer by username' part.
Conflict in wich direction? I haven't tested the linked extension, but from what I see it just inserts the username, or what does it do?
Or what conflict do you mean? Something I have to fix?

I don't really understand.

Re: [DEV] @Mention System

Posted: Tue Feb 03, 2015 11:04 pm
by Peter77sx
Will the notification announce each and every single time the mention is used in a post, or only once per topic?
maybe an option for this in ucp could be useful.

If someone edits their post a year from now and uses/reuses mention, re submits edited post, will the person get the notification? currently it seems that's how quoting works in 3.1.

Re: [DEV] @Mention System

Posted: Tue Feb 03, 2015 11:16 pm
by Wolfsblvt
Peter77sx wrote:Will the notification announce each and every single time the mention is used in a post, or only once per topic?
maybe an option for this in ucp could be useful.

If someone edits their post a year from now and uses/reuses mention, re submits edited post, will the person get the notification? currently it seems that's how quoting works in 3.1.
Once per post, no matter how often you will be mentioned there, but every time someone mentions you in a post in this topic, yes. It is exactly The same way like the "quote" notification works.
Is it wrong to notify a user everytime he is mentioned?

For the second question, it is also the same like for the "quote" notification. If you edit the post and add a new username, he will be notfied, no motter how old the post is. Users who were already notified will not be notified again.

Re: [DEV] @Mention System

Posted: Tue Feb 03, 2015 11:22 pm
by Volksdevil
Sorry clemens, I just added quick findings in my last post, I can elaborate now. :)

The quick reply extension...When you click a username, it generates a small popup which has a link 'Refer by username'.

This extension seems to be affected. As in, if you mention somebody in a post, you click the username, and the popup from the quick reply extension appears (Quite good I initially thought! 8-) ) But the issue is that if you click 'Refer by username', then it inserts some HTML from the mention (Div etc around the avatar)

I hope that helps explain a little, but tbh, the 'Refer by username' in the quick reply extension could be turned off in ACP now as this extension works so well. :D
Is it wrong to notify a user everytime he is mentioned?
I don't think so, you don't need to mention somebody unless you want their attention. PS: Would be great to work in quick reply.

Re: [DEV] @Mention System

Posted: Tue Feb 03, 2015 11:38 pm
by Wolfsblvt
Ah, now I think I got what the problem is.
I have to test that when I can find the time. I would say the problem is that the popup is applied to every linked username on the page, wich also works for my usernames, and then it takes the oddd code cause my extension has modified the string.
Worst case would be that my extension cannot fix this. Then I have to talk to the extension author.

For working in quick reply, I'll do that tomorrow (:

Re: [DEV] @Mention System

Posted: Tue Feb 03, 2015 11:43 pm
by Volksdevil
Sounds perfect to me :D I'm currently playing with the settings to find best results and any possible errors.

I suppose your usernames could use a different class? If that's how the quick reply extension finds them? Not sure? But for now we can easily either:
A/ Turn off linking in this extension.
B/ Turn off refer by username in quick reply extension.

Great, great work mate.

Re: [DEV] @Mention System

Posted: Tue Feb 03, 2015 11:48 pm
by Volksdevil
Just found that Load Autocomplete remote: ENABLED. Seems to stop the extension working? I can't get any usernames to show when using @

EDIT: Suggestion! :) Insert a space after a username has been inserted?

Re: [DEV] @Mention System

Posted: Tue Feb 03, 2015 11:49 pm
by draky
Another suggestion : when clicking on username, when popup comes then it put it in quick reply with @username.
Juste after the insertion, your Mention ext opens a popup like normal @mentions.

Other idea : if your EXT detects Quick Reply, it does nothing when clicking/inserting username with quickreply option.

Re: [DEV] @Mention System

Posted: Tue Feb 03, 2015 11:51 pm
by Wolfsblvt
Volksdevil wrote:I suppose your usernames could use a different class? If that's how the quick reply extension finds them? Not sure?
The class is need for styling the username. Like bold and stuff, that's phpbb core. Don't wanna replace that. What I could try is not modifying the username string but adding a wrapper around it. I have to see.

Is the bug also occuring when usernames are parsed, but the avatars are not displayed inline?

Thanks (:
Hope you can find bugs. Or maybe hope that you don't :P
Volksdevil wrote:Just found that Load Autocomplete remote: ENABLED. Seems to stop the extension working? I can't get any usernames to show when using @
O fuck. Know that you say that...
Was working on that late last night, but now I remember I haven't got it working :shock:
If you have a GitHub account, can you create an issue? Otherwise I will do it tomorrow.

Ah, and don't forget to get some runtime data for me :P