Mention Users with @ Download 1.9.1

This component/theme doesn't work with the latest OSSN version.
5.0
us bryce alvord 5 years ago

OSSN MENTION USERS COMPONENT

This component enables a user to mention other users in posts and comments by using the syntax @Full Name or conditionally @username and that will send the mentioned user a notification telling them that they were mentioned in a post or comment with a link to that item.

This can be used in conjunction with the Display Username component as of v1.2 if you want to display usernames and mention @username instead of display Full Name and mention @Full Name. It will dynamically switch based whether or not the Display Username component is installed and turned on. You can find more info on it here: https://www.opensource-socialnetwork.org/component/view/3065/display-username

  • When mentioning usernames using the Display Username component the exact casing must be used to match the user.

  • When mentioning user full names the casing DOES matter as that can help find uniqueness.

  • Mentions are not limited to the friends of the user, the entire user base can be mentioned

  • Multiple mentions can be done in a post or comment.

CHANGE LOG
-------------------1.9.1------------------

  • Added ability to parse off trailing '(apostrophe) and 's for use in plurals and ownership

  • Added recommended method and hooks from Z-Man

-------------------1.9--------------------

  • Added 'ossn:notifications:mention:post:created' to en locale

  • Added 'ossn:notifications:mention:comment:created' to en locale

  • Renamed init method from basic name to prevent potential collision with other components

POSSIBLE ENHANCEMENTS

  • No UI based on prototype having significant cons

  • ?

Comments
German Michael Zülsdorff Replied 4 years ago

As for the technical part (just looked into your code)
The stripping in general is done via input() before saving records
When your com_wall_created is called the record already has been saved, though,
that is: no further stripping will be done.

So, theoretically (since you know the object id at that stage) your parser could add a blue span around mentions and you could rewrite the now colored object record with your own low level db query :)
But to make things really complete you would need to handle edits, too - otherwise your extra html would be removed again on saving. Yeah ... a rather tricky job that I doubt it's worth it.

German Michael Zülsdorff Replied 4 years ago

Honestly, I have no idea what all this 'blueish' stuff could be good for?

If it's my intention to leave Bryce Alvord a notification because my posting may be of interest for him, the name "Bryce Alvord" just passed my brain, I would add a "@" in front of his name, maybe do a spell check, and that's it. I don't need no blue reminder again that I just mentioned Bryce.

Bryce would receive a notification then - leading him directly to my posting, and once more a blue emphasis of his name wouldn't make much sense, because Bryce knows best that he IS Bryce.

3rd parties? Okay, may be focused that I mentioned Bryce. So what?

Breton Caroline Milk Replied 4 years ago

Hello, Bryce!

Exactly this , makes it easier to read.

us Bryce alvord Replied 4 years ago

Hey Caroline, are you asking for the original post to have that blue hyperlink look on the '@Profile Name'? Hopefully someone who knows might be able to look/confirm because I won't be near my computer for a couple days. In the post body I believe I have seen that all HTML is stripped down to plain text which means we aren't able to perform any changes to the text when it is displayed after. I will confirm if no one else has a chance.

Breton Caroline Milk Replied 4 years ago

Hello, Bryce Alvord!
Congratulations on your component.
Is it possible to have the @ and profile name in blue?

us Bryce alvord Replied 5 years ago

Hey William, please see my response to Mike that is two posts below this one. To sum it up, it's not a feature that is compatible with OSSN. Not at the fault of OSSN at all.

Breton William Silva Replied 5 years ago

Hello, Bryce Albert!

Is it possible in the component when I put @ and the first letter appears all the friends and I can choose to mention it?

Catalan Mike Stoddart Replied 5 years ago

Good point about the size of the user base. It's a shame you can't use mention on a username or full name. I think you can only use either, depending on whether you have the above mentioned component "Display Username" installed.

I haven't managed to get a mention to work so I can't make any more suggestions.

us Bryce alvord Replied 5 years ago

Hey there Mike. I had toyed with some prototypes that did work well however, they were on a tiny user base test environment. When implemented on a larger scale it would be clunky and slow because you would have to include a profile pic thumbnail along with the name so that duplicate names could have something that helps differentiate between the two. Using the Display Username component would easily help this problem because duplicate usernames are not allowed in OSSN. The technologies I prototyped along with Z Man and Arsalans help were just not compatible enough for the architecture of OSSN, not at the fault of OSSN, they just weren't a good fit. So long story short, I gave it a good try and desired to do it this way but for several reasons it ultimately is not a possibility.

Catalan Mike Stoddart Replied 5 years ago

Is there anyway to make the UI show that the name you are typing after @ is a valid user? Like Facebook and Twitter etc?

Component

Developer: bryce
License GPL v2
Type: Communication
Requires Ossn Version : 5.x
Latest Version: 1.9.1
Last Updated 5 years ago
Repository Url View Repository

Versions