access_id -> access_id private?

I'm trying to make a form's access_id = friends so that a 'friend' may 'post' but! make the actual post's acess_id = private.  ie   a friend can post a message on the messageboard, but only the recipient can view the post regardless...

better still,  only the poster and recipient can view the messages.

any ideas would be appreciated.



  • hmm ;-X interesting idea! wish i'd thought of before.. wonder how those kids gonna react - always whining abt non-friends and whole world reading their stuff - when all can post but no strangers can read !?!.. i bet 1/2 $ they might just like...

  • @DDS

    I tried to implement this but with mi limited knowlege of php (or coding in general) I'm meerly clutching at straws.

    What I tried to do was:

    default the access_id in the form to friends, and then defaut the access_id in 'add' to private but then that doesn't allow even then the poster/recipient to both read...

    I think iionly is having the same problem with gifts 1.8?

    again I have very limited knowledge, but I suspect a combination of the core mesages and some custom views may be the answer?

    I mean, rename/clone the core messages plugin, and create a costome view so that it displays in a widget? Or maybe combining messages and messageboard?

    I don't know how to do it but I suspect that all the functions/vars are all available in the core as the messages plugin achives this already no?

    maybe if you figure it you'll let me know??


  • PS

    I have a few other ideas ;)

  • I think you are confusing something here. What you really need to do:

    1. Force the messageboard widget to ACCESS_FRIENDS. You can do it in edit.php $vars['entity']->access_id = ACCESS_FRIENDS;

    2. Messageboard posts are saved as annotations. So what you need to do is to set access to private, and make owner_guid the posting user. So, both the person receiving (annotated entity) and person sending (owner of the annotation) will have access to the post.

  • hi,

    can you tell me exact which .php have to be change and what.

    we change the code in messageboard/views/default/widgets/messageboard -> edit.php

    after this the profile site crashed.

    here the code from edit.php:

    <!--?php <br-->/**
     * Messageboard widget edit view

    // set default value
    if (!isset($vars['entity']->num_display;)) {
        $vars['entity']->num_display = 5;

    $params = array(
        'name' => 'params[num_display]',
        'value' => $vars['entity']->access_id = ACCESS_FRIENDS,
        'options' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
    $dropdown = elgg_view('input/dropdown', $params);


        <!--?php echo elgg_echo('messageboard:num_display'); ?-->:
        <!--?php echo $dropdown; ?-->

    thx, nicyta


  • @nicyta - Never modify core Elgg files.

    It's not working because what you posted isn't valid PHP code. You will need to learn PHP to develop for Elgg.

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking