Messages with privacy option + more v1.3

Release Notes

New in this release:

  • Users can now send messages to all friends or friends collections
  • Users can forward messages (to friends)
  • You can see if your message has been read in "Sent Messages"
  • Better layout when reading messages (long names doesn't break the layout)
  • Based on the messages plugin from Elgg 1.7.1

The old improvements are still in there:

  • Privacy by blocking non-friends - must be enabled by admin and user.
  • Auto refresh of messages icon in the top bar (refresh rate controlled in plugin settings)

Disclaimer: Haven't tried this on versions older than 1.7!

  • Would it be possible to add the option to send a message to more than one recipient without defining a collection first? To send a message to more than one member is often quite useful. But it seems quite complicated to create a collection for each combination friends first. The Bookmarks plugin has the "Share this" option and I always wondered why this option isn't included in the messages plugin, too. I think the same friend picker feature for messages would be very, very helpful.

  • @lionly

    Could be interesting to use that.. Can't promise anything though :-)

    Thanks for the input 

  • slyhne, this plugin rocks. Looking forward to getting more features.

  • Man this sounds really cool. Just couldn't get it work on my site yet. Do you just overwrite the "message" in mod or you gotta do something else? Thanks.

  • @Ha Le

    The right way is to deactivate the messages plugin and delete it. Then copy this version to your mod folder and activate it - remember to adjust plugin settings.

  • I have removed the original message plugin and reinstalled this one.

    My message envelope has now dissapeared on the topbar.
    Is there anyway I can get this back, please, as it is the main way for my users to read and send messages.


  • @elggfan

    I think you have to run upgrade.php after you replaced the message folder in mods. Then it should work... you are using Elgg 1.7.1?

  • @iionly

    I'm using Elgg 1.7.1, this plugin needs 1.7.x - running upgrade should not be necessary.

    You could try disabling simplecache and the views cache - se if it works, the reenable the two caches again.

  • Thanks for the advice.

    I have however, tried upgrade and also disabling caches.
    Still no envelope :(

  • @elggfan

    Are you running any plugins that mess around with the topbar, a theme maybe. Could be that causing it.

    If any plugin is overriding the default topbar it would be in files like this:


    Also check if you get any javascript errors, could be another script conflicting with the one used to update the topbar.

    Take a look in the source code in your browser to see if the javascript is being loaded allright.

  • @ slyhne,
    I did originally modify the topbar myself, but have uploaded the original again.
    I have also tried with no theme, but in all instances, no message envelope appears.

    I have copied the below code from view -> source in the browser and it looks to me that the envelope is being called for (can you confirm, please?)
    - - -

    <script type="text/javascript">
    var refreshId = setInterval(function(){
    }, 30000);
    // initial load of messages


  • @slyhne
    I have put the original messages plugin back on, and the envelope has come back.
    I shall have a poke around at the codes for both plugins, if that is OK with you, to see if I can see anything.

    Strange that it's working for others, but not me.
    My site is not heavily modified, either.


  • @elggfan

    One thing, are you running Elgg in a subdirectory?

    If you look at the javascript it looks for /mod/messages/lib/refreshstart.php

    If it's in a subdirectory you could modify the lines in question to /yoursubdirectory/mod/messages/lib/refreshstart.php 



  • @ Slyhne,
    Many thanks for your suggestion. Elgg is indeed in a subdirectory, so I have amended the lines in question.
    However, I'm not sure if the plugin has conflicted with another, or if my server is under a bit of strain, as some of the items on the page appeared twice. eg the topbar appeared on top and once again below it's original position (after it refreshed, perhaps?) The envelope did not appear, either, I'm afraid.
    I will have another look in great details later, as it looks as though my cheap werver hosting has now given up again!!

  • I have now had another look and it would appear that this plugin is causing some of the page to load twice on my site - in IE8.
    I think it may have something to do with the refreshstart.php, as the page will load correctly and then a few moments later, double topbar etc will show.
    Do you have any suggestions, please?


  • @elggfan

    I can't reproduce that error. I have 1100 users using a site with this plugin, and never heard of that error.

    I have noticed an error with some themes that causes the topbar links to appear outside the topbar.

    The fix is to add this to mod/messages/views/default/css.php

    .messages_topbar_container {
    float: left;

  • Friend elggfan, the problem is the file "topbar" in mod/messages/views/default/messages. Change this file for other "topbar" in the messages mod that run ok for your elgg instalation.

  • Hi, thanks for the great plugin. There is only one problem if you want to forward the message the text is not in the middle of the code its afterward. An idea may solve the problem how? Thank you!

  • Hey again, I have solved the problem just now: messages\views\default\messages\forms\message.php in line 58 must be modified as follows:

    $msg_content = "<hr>" . $message_entity->description . "<hr>";

    Now the previous message will be included automatically.

  • @Haziz

    I'll include your fix in the next version


  • Slyhne,

    Very nice plugin. How do I disable messaging between non-friends by default? i.e. new user will need to activate "receive messages from anyone" to get messages from non-friends.


  • @Shu

    That would require you to hunt down all the IF statements where it defaults to "no" and change them to "yes".

    I have planned this to become an admin setting, so you simply can choose it in the plugin manager. I have no release date yet as I'm tied up in other projects.

  • @slyhne:

    Will you release a new version based on Elgg 1.7.2 after its release?

  • @iionly

    Yes, but 1.8 if that comes first :-)

  • Slyhne,

    I think I have found a bug. If user A ads user B as a connection/friend before sending a message, user A can click on "Compose a Message" when choose user B from the "To a friend" drop-down box. And the message goes through.

    Is there any way of stating the friendship must be reciprocal in the plugin code? Or is there another solution?

    Many Thanks


  • Category: Communication
  • License: GNU General Public License (GPL) version 2
  • Updated: 2014-11-17
  • Downloads: 5355
  • Recommendations: 16

Other Projects

View slyhne's plugins