Access Levels in The Wire


Is it possible to add access levels to the posts of the wire?
e.g. I publish a string I only want my friends to see ...



  • @Matias: It's interesting and nice what you're proposing, but I guess we should first start with the start here ... getting the friends to see the post instead of sitewide.

    Besides that, is there a addon that provides grouping of friends? Maybe that could become a function of elgg messenger? it's interesting... But we'd need some more developers working on this ...

    I'll start doing the tutorials soon, and start learning OO php ...

  • Dear Community,

    I feel like an idiot, a total screwup. Im sorry towards Dhrup and Untamed. It seems like it that the 2 accounts I was testing with ... Were in fact friends, Thus seeing each other's messages.

    My First solution worked. I'll write it again, step by step here. What's more: You can post wire messages for your group also. All groups you are in are listed in a drop down menu. (This is about user groups, not friends groups).

    How To:
    - Make Backup First!
    - open /mod/thewire/actions/add.php
    - Look for the following code:
    $access_id = (int)get_default_access();
    if ($access_id == ACCESS_PRIVATE) { $access_id = ACCESS_LOGGED_IN; // Private wire messages are pointless } 
    The IF statement contains the following: If somebody chooses not to share the post with anybody, the system will change the rights so everybody can see it. You can change this if you like.
    - Change the following code: $access_id = (int)get_default_access(); 
    to the following: $access_id = get_input('access');

    - Open the following file: /mod/thewire/views/default/thewire/forms/add.php 
    - Look for the FORM (the < form> < /form> tags.
    - Before the < /form> tag, add this code:
    <?php echo elgg_echo('access'); ?>

    echo elgg_view('input/access',array(
    'internalname' => 'access',
    'value' => $access_id,


    This will add the drop down menu to choose the access level.

    Have fun ;)

  • p.s. in the last file you might want to put the dropdown menu above the save button :)

  • Now I'd like to find a way to exclude "private" from the options in the dropdown menu ...

    Anybody an idea how to exclude the first item in an array?

  • That worked slick :-) Thanks fraksken

  • Sounds pretty cool... and can not believe it that it was such infront of my eyes, however, I haven't tryied it yet, but will do so in the next few hours and let you know.. I am crossing my fingers and holding my breath... sounds good @fraksken

  • If you do as it's written, there's no need to hold your breath ... Certainly not if you have a slow FTP server ... it works :)

    We're working on the exclusion of the 'private' option, thus far we have a solution, but it results in the groups not showing. So there's still a bit of work on this. We might use the help of who ever wrote the access system, because we need to know how to change his array. We'll keep you posted :)

  • I think I will leave the private option and in my help files I wrote

    "The wire is for sending a site wide broadcast of what you have to say or bring attention to. It has access levels and defaults to Private meaning you will be the only one who see the post should you select Private. This can be handy if you need to write a note to yourself. The other levels are self explanatory. "

  • Ladies and Gentlemen, here's the solution to remove the "private" option on the wire:

    1. Make BACKUP
    2. open file mod/thewire/views/default/thewire/forms/add.php
    3. add the following script to the javascript:
      function hideOption() {
      var dd1 = document.getElementsByName('access');
      var dropDown1 = dd1[0];
    4. go down in the page and search for the LABEL tags. Add the following code at the bottom of the LABEL tag: (just before </label>) 
      <script type="text/javascript" >
    5. you're done.


  • am I correct to think that dropDown1 is just for the wire?