Messageboard to River

with the Messageboard mod enabled, is there a way to have the actual messageboard post appear in the river, rather than 'A' posted on 'B's' messageboard?

I think this would be extremely valuable for users to create more content with less jumping around, especially with mods like rivercomments.

I've looked into the create and add files but haven't found a way to display the actual comment in the river.

Any ideas?

Thanks,

Tri

  • +1 

    i'm also interested by this possibility

  • I've tried adding $message_content to the string in the messageboard create file...no results. Anybody??

  • You'll want to use the annotation ID passed to the river/object/messageboard/create view to grab the annotation object and display its value. Annotation id is passed to river views via $vars['item']->annotation_id

  • Sweet, I will look into this shortly...thanks Brett!

  • Hey Brett, going back and forth with you and Kevin Jardine on this...at this point I am understanding what you're saying but am unsure what lines of code to be adding to the add.php and create.php files of the messageboard mod??

    Can you help??

     

  • I didn't realize this thread was split.  Please let's keep from cross posting topics.

    I'll not write the code for you (how will you learn!) but will always give some tips:

    1. The annotation_id is in $vars['item']->annotation_id
    2. get_annotation() returns annotation objects
    3. The messageboard text is in $annotation_object->value
    Feel free to post up any code you have and someone will comment on it :)
  • I appreciate the tips Brett, but i'm a little lost. Been trying to use the Groups topics add and create files as a template, but no results so far...here's is what i've got and it isn't working, any help would be appreciated:

    in the actions/add file, i've added:

            $annotation_id = get_annotation($vars['item']->annotation_id);
     // add to river
         add_to_river('river/object/messageboard/ create','messageboard',$_SESSION['user']->guid,$user->guid, $annotation_id);

     To the river/object/messageboard/create file, I've added:

        $annotation_object = get_annotation($vars['item']->annotation_id);
       echo $annotation_object->value;

    This obviously isn't working, so any help you can provide is appreciated.

  • What version of Elgg are you using?  This would require 1.7+, and in the later versions the actions/add already has the annotation_id added.  Try to debug your code in the create view by saying after your modifications:

    var_dump($vars['item'], $annotation_object);

  • Using 1.7.1 so there should be no problems.

    So you're saying I don't need to call anything extra in the add file, just display it in the create file??

    I will try the debug you suggested, and if you would write out the code I should be adding to the files, I'd greatly appreciate it...obviously I've got the coding wrong an I really need to get this feature up and running.
    Thanks Brett.

  • Ok, so after adding: var_dump($vars['item'], $annotation_object);  after my modifications, this gets returned in my messageboard:

    object(stdClass)#243 (10) { ["id"]=> string(3) "944" ["type"]=> string(4) "user" ["subtype"]=> string(0) "" ["action_type"]=> string(12) "messageboard" ["access_id"]=> string(1) "2" ["view"]=> string(32) "river/object/messageboard/create" ["subject_guid"]=> string(1) "2" ["object_guid"]=> string(1) "2" ["annotation_id"]=> string(1) "0" ["posted"]=> string(10) "1282277355" } NULL

     

    not sure where to go with this? suggestions, ideas?