Anything for private messaging?

Biplab Karki Posted in Technical Support 3 years ago

Do we have any plugins or ideas for making messaging private? Seems we have anyone to anyone messaging right now.

Replies
us Michieal ~ Coder ~ Replied 3 years ago

@Biplab
Here is where you would change the ability to message people. You will want to change it to check for 1) if it's an admin viewing the page (because system admins need to be able to message everyone, regardless); 2) if the $user->guid is in the logged in user's friend's list. If either of these are true, then the button code shown in the if statement should be shown. Otherwise, your modification should skip the code shown.

And, as always, since you are modifying a main sys component... put in a define at the top, and check for that first, so that you can turn it on and off in case you break something or simply want to disable it later. It also gives you something to search for in your code, when you go to migrate the code over to a newer version of OSSN.

-M.

components/OssnProfile/plugins/default/profile/pages/profile.php

if(com_is_active('OssnMessages')) { ?>
     <a href="<?php echo ossn_site_url("messages/message/{$user->username}"); ?>" id="profile-message" data-guid='<?php echo $user->guid; ?>' class='btn-action'>
     <?php echo ossn_print('message'); ?></a>
<?php } ?>
us Aaron Green Replied 3 years ago

Can you explain a little more on what you mean by private messaging? I'm not sure if it is on the free version, but on the premium there is the capability to block users. Once the user is blocked they are not capable of messaging the user that blocked them.