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 ...



  • Possible? Yes! Easy? Probably not.

    NOTE: Beware - as a programmer, I think pretty much anything is possible.

  • yeah .. Of course everything is possible :) But would "it not be very nice" should the designers of ELGG come up with this feature? It is, imho important for privacy ...

    Should I want to try to mess with the code. Can anybody give me a pointer as to where to poke in the code?

    Thanks :)

  • elgg174/mod/thewire/actions/add.php
    All you need to know to poke around very precisely is in there...;)
    One line of code to change ;-P

  • Great, Thanks Dhrup :) I found the code you were refering to (in 1.7.5) However, there's nothing commented out, so I'd take it I'll have to add lines to the page.

    Does anybody has an idea what line that could be? ^^

  • Do you really want to be handed the code on a diamond studded golden plate ? ;-) LOLZ - somewhere towards the bottom of that script is one line of code that can be changed for what yew wanna achieve ! You want to use this access level ->


  • I wold like a silver plater topped with chocolate molten please ;-)

  • before or after "Make Coach/ Recruiter/ etc" lolz ?;-P

  • Ah, there we go. I'm sorry Dhrup. My browser code editor stopped viewing the code after if (!isloggedin()) forward();

    I guess I'll have to do something with this:
    $access_id = (int)get_default_access(); if ($access_id == ACCESS_PRIVATE) { $access_id = ACCESS_LOGGED_IN; // Private wire messages are pointless }

    The idea is to let the users choose who can see this and who can't. So I guess I'll have to go to the "views" page of the add form and add a dropdown menu? I guess I could go look at another post field where the option arrises and implement?

    by the way ... Diamond studded golden plate is nice, but the chocolate should Belgian made... some whipped cream on top and put a nice cherry in there to make it complete ;)

  • @Dhrup I added the following code to the "add" view of the wire:

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

    That added the possibility to choose the access level.
    In the "add" actions page I altered the original code:

    $access_id = (int)get_default_access(); if ($access_id == ACCESS_PRIVATE) { $access_id = ACCESS_LOGGED_IN; // Private wire messages are pointless }

    to the following (to match the code I put in the view part)
    $access_id = get_input('access'); if ($access_id == ACCESS_PRIVATE) { $access_id = ACCESS_LOGGED_IN; // Private wire messages are pointless }

    I like to search, but this is still a bit above my league ... pointing out where I'm wrong might help me a lot in understanding the code though :)



  • @fraksken

    Ah! I see your frustration, you want it like facebook where status lets you broadcast a message on your wall. If the wall is set to friends then only friends see status and so on

    Just testing how it works in elgg

    Help: This was sent using the "Wire" Reply (just now)

    Site admin, Help, posted a new site wide message

    This was sent using "Add a site-wide message to the river page"

    (a minute ago)

    Seems the only difference between the wire and the river is you can comment on a wire post. So I agree that levels for the wire would be appropriate such as your friends, your groups, site-wide. I suppose you could make your friends join your group then have them subscribe to your group and at that point your friends would get your spontaneous message, If you have to invite your friends to join your group then what is the point of friends?  hmmmm