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

  • @gillie,

    As you can see from the list of 70+ posts on this topic, every bit of info you need is right here.

    On a side note: I'll be starting a new post on making the river_comments mod functional with messageboard posts in river activity.

  • @triout

    Good that it finally worked out for you.

    As for river_comments not working right with the messageboard, its because the messageboard uses annotations for each post. The way elgg is designed you can't have annotations on annotations. Basically the messageboard needs a rewrite to use elgg_objects so that each post is its own entity that you can then annotate with comments. I plan to undertake the project but I need to learn more myself first.

  • @chad

    hey, thanks for all your help on this one, so glad it turned out...funny thing is I was really working on this to be able to use river_comments on messageboard posts in the river and now i'm seeing this major bug where the user's comment gets repeated on every one if they comment on their own...any short term ideas on how to get around this using the current version of the messageboard??

  • $message = get_input('messageboard_content');

    $message_content = get_input('message_content'); // the actual message

     

    no funciona

     

  • Been trying to follow each post but could not find the solution triout did.

    I followed his code,

    in add.php and load.php

    $result = $user->annotate('messageboard',$message_content,$user->access_id, $_SESSION['user']->getGUID());
                    if (!$result) {
                        return FALSE;
                    }

    add_to_river('river/object/messageboard/create','messageboard',$_SESSION['user']->guid,$user->guid,"",0,$result);

    In create.php

    //grab the annotation, if one exists
        if($vars['item']->annotation_id != 0)
        $result = get_annotation($vars['item']->annotation_id); 


        $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
        $string = sprintf(elgg_echo("messageboard:river:added"),$url)  . " <a href=\"{$performed_on->getURL()}\">" . $performed_on->name . "'s</a> " . elgg_echo("messageboard:river:messageboard");

    echo $string . $result->value;

     

    Please let me know what I'm doing wrong.

     

  • @zeroflares

    we not read your mind ! post *all your code, pref as a plugin and maybe the elgg heavyweights will spend some unpaid time to investigate lolz ;-)

  • Please do not upload unfinished code as a plugin to the community plugin repository just so others can take a look at it. There are a lot of great ways to share code for help and that is not one of them. Consider using one of the code snippet sites such as paste bin or using a site like github for something like that.

  • @DhrupDeScoop

    lol, I took a fresh copy of the messageboard and just followed the last inserts from triout . =) Did not do anything else.

       in add.php and load.php

    $result = $user->annotate('messageboard',$message_content,$user->access_id, $_SESSION['user']->getGUID());
                    if (!$result) {
                        return FALSE;
                    }

    add_to_river('river/object/messageboard/create','messageboard',$_SESSION['user']->guid,$user->guid,"",0,$result);

     

    Full in add.php

    <?php

    /**

     * Elgg Message board: add message action

     *

     * @package ElggMessageBoard

     */

    // Get input

    $message_content = get_input('message_content'); // the actual message

    $page_owner = get_input("pageOwner"); // the message board owner

    $user = get_entity($page_owner); // the message board owner's details

    $result = $user->annotate('messageboard',$message_content,$user->access_id, $_SESSION['user']->getGUID());

      if (!$result) {

                        return FALSE;

                    }

    // Let's see if we can get a user entity from the specified page_owner

    if ($user && !empty($message_content)) {

    if (messageboard_add(get_loggedin_user(), $user, $message_content, $user->access_id)) {

    system_message(elgg_echo("messageboard:posted"));

    add_to_river('river/object/messageboard/create','messageboard',$_SESSION['user']->guid,$user->guid,"",0,$result);

    } else {

    register_error(elgg_echo("messageboard:failure"));

    }

    //set the url to return the user to the correct message board

    $url = "pg/messageboard/" . $user->username;

    } else {

    register_error(elgg_echo("messageboard:blank"));

    //set the url to return the user to the correct message board

    $url = "pg/messageboard/" . $user->username;

    }

    // Forward back to the messageboard

    forward($url);

     

    In load.php I did the same thing but just replaced the add_to_river that's already there.

    In create.php

    <?php

    $performed_by = get_entity($vars['item']->subject_guid);

    $performed_on = get_entity($vars['item']->object_guid);

    //grab the annotation, if one exists

        if($vars['item']->annotation_id != 0)

    $result = get_annotation($vars['item']->annotation_id);

        $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";

        $string = sprintf(elgg_echo("messageboard:river:added"),$url)  . " <a href=\"{$performed_on->getURL()}\">" . $performed_on->name . "'s</a> " . elgg_echo("messageboard:river:messageboard");

    echo $string . $result->value;