Mention Users with @ Download 1.9.1

us bryce alvord 5 months 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
us Bryce alvord Replied 1 week ago

Hi AJ, this component works by a user typing the "@" character followed by the intended users name or if you have the user name it will use that. Remember to type it exactly as you see it online. An example would be @Aj andang

That's about it

ph Aj andang Replied 2 weeks ago

Hi can I know how this component works I try to install it to my website but nothing happens thank you.

se Johannes Genberg Replied 4 months ago

@Zman

Sorry, I havn't been online much the last week. Yes, I have done exactly that, but it doesn't matter anymore as I was able to install 1.9.1 just fine.

German ~Z~ Man Replied 4 months ago

@Johannes
It makes no sense to report an issue if you are not willing to co-operate.
So please answer my question or your posting will be removed.

German ~Z~ Man Replied 4 months ago

I agree the installer could be more foolproof, and this is already on the to-do list for a future release. Until then, the only thing I can do is keep repeating: Guys, read the documentation!

Because this IS in fact mentioned in
https://www.opensource-socialnetwork.org/wiki/view/2006/how-to-install-and-update-components

us Bryce alvord Replied 4 months ago

Good point Z-Man, you do have to delete the old component before installing the new one. This is true in general and doesnt delete data associated with the component, just deletes the files and entry in the db.

Distracted Thought: What if the cominstaller actually installed the component to a temp directory to make sure it would install successfully (aka, its a valid package), then deleted the original component directory by the same ID, and finally renamed the temp directory from tempComponentName to ComponentName completing the circle in one step making it an upgrade if installed process too.

us Bryce alvord Replied 4 months ago

new version uploaded!

German ~Z~ Man Replied 4 months ago

Did you remove the former release before trying to install 1.9?

"Upload error"? Please tell us the exact error message and/or provide your error log.

se Johannes Genberg Replied 4 months ago

I wasn't able to install 1.9. It gives me an upload error.

German ~Z~ Man Replied 4 months ago

Bryce, please note before providing the next release:

You should add 2 new hooks to your code like

// hooks for preventing wrong participants notification records
ossn_add_hook('notification:participants', 'mention:post:created', 'com_mention_suppress_participants_notifications');
ossn_add_hook('notification:participants', 'mention:comment:created', 'com_mention_suppress_participants_notifications');

with the corresponding function

function com_mention_suppress_participants_notifications($hook, $type, $return, $params) {
    $notifyParticipants = false;
    return $notifyParticipants;
}

Because, up to 5.1 we have a problem that wrong participant notification may be created (formerly with Likes only, but your component will be involved, too ) see issue #1530

I have provided a fix already with pull #1531 and #1532
and your own component will be prepared to make use of it by adding the code above

And yes: I would be a little happier to see all of your functions start with 'com_mention_.....' :)

Component

Developer: bryce
License GPL v2
Type: Communication
Minimum Requirement: 5.x
Latest Version: 1.9.1
Last Updated 4 months ago
Repository Url View Repository

Versions