Text Area of Post is not displaying users/friends when using @

Nik Fury Posted in Technical Support 3 years ago

enter image description hereWhen using @ in text area its not displaying my friends. Is there any solution ?
Attached photo for reference

Replies
in Nik Fury Replied 3 years ago

Ok Arsalan I will open new topic. Tagging is working in wall post but tagged friend should get notifcation right?

Indonesian Arsalan Shah Replied 3 years ago

If that is resolved your topic should be closed. Let me know if it resolved?
Notification is different topic.

in Nik Fury Replied 3 years ago

Hello Arsalan. Iam trying to make notifications work for tagged friend in wall post . Heres the link . https://github.com/nikhilvinnakoti/MyTruckerPro/blob/main/MentionNotifications/ossn_com.php. So iam trying to make changes in mentionnotifications for wall post. Please have a look at the functions at lines 25,88,107,115,136,155. Please tell me whats wrong here. I implemented the same logic u suggested earlier for wall mentions.

in Nik Fury Replied 3 years ago

Thank you so much Arsalan. Iam literally crying (happy tears). So basically first function is adding hook (but how to write parameters inside that hook (first parameter is wall , second parameter I didnt get what that means, third parameter is function mentioned below , fourth parameter 150?). In second function replacing usernames and returning fullname right?

us Allon Prooit Replied 3 years ago

Ok, so the code works well. Thank you very much Arsalan. I have created a small component that should give you this function. Go team! Mentions Wall Component is HERE

Indonesian Arsalan Shah Replied 3 years ago

The problem is not with OSSN but your thinking you taking it too hard and not reading all stuff I mentioned..... While its a simple code to write

function mentions_wall_init(){
        if(ossn_isLoggedin()) {             
                ossn_add_hook('wall', 'templates:item', 'mentions_tag_user_wall', 150);
        }
}
function mentions_tag_user_wall($hook, $type, $return, $params) {
        if(isset($return['text'])) {
                $return['text'] = mentions_replace_usernames($return['text']);
        }
        return $return;
}
ossn_register_callback('ossn', 'init', 'mentions_wall_init');

Now please write me a some lines about what exactly you learned here and what exactly you were doing wrong please explain me?

in Nik Fury Replied 3 years ago

So according to you , theres only 1 function to write. I have gone through that function and I didnt understand it. Can u keep solution for that? Iam new to development and Ossn . Please understand and help us. Iam literally depressed on this one.

Indonesian Arsalan Shah Replied 3 years ago

There is no such a thing for wall template view $return['wall']['wall:entity'] that is why i told you to look OssnEmbed again https://github.com/opensource-socialnetwork/opensource-socialnetwork/blob/v5.x/components/OssnEmbed/ossn_com.php#L25

And read https://github.com/opensource-socialnetwork/opensource-socialnetwork/blob/v5.x/components/OssnEmbed/ossn_com.php#L25

See what is included in $return argument.

I am sorry but I can not write you a component a live working example i told you is about OssnEmbed you taking this component is just fun :) please read what exactly this function is doing. It is doing exactly what wanted.

in Nik Fury Replied 3 years ago

Hello Arsalan . Sorry about that . Yes we need to modify OssnEmbed(ossncom.php)of Mentions and add hook for OssnWall. Please go through the lines 24,28,31(added hook here for wall dont know whether its correct or not),56,74,115,163. I cant go any further and I think Iam making some mistakes here . Please help us Arsalan -- . https://github.com/nikhilvinnakoti/MyTruckerPro/blob/main/Mentions/plugins/default/ossn_com.php

Indonesian Arsalan Shah Replied 3 years ago

@Allon, I am not going to repeat it again read my replies to Nikhil and read OssnEmbed component hook, you are complete doing and using opposite of what I told him.