River notifications on profile update

Hi all!

I need to show on the river the events on profile update. I have installed the plugin "Profile Manager", and I've created some customs fields. Lets use as an example "Current project", which is a free text field. After an update of the field -when the user changes the current project-, I want to show on the river something like "John Doe has a new project: $projectname".

I've also installed the plugin Profile River Update https://elgg.org/plugins/2389011, but it only reports that an update has happened in the profile, but I have not been able to show which field has been updated.
 

Any help will be appreciated.

 

Thanks in advance!

  • Thanks RvR!

    Maybe I wasn't very clear. In /mod/profile_river_updates/start.php, is written:

    $view = "river/user/default/profileupdate";

            // First delete any existing river entry about profile updates of this user
            $access = elgg_set_ignore_access(true);
            $access_status = access_get_show_hidden_status();
            access_show_hidden_entities(true);

            $river_items = new ElggBatch('elgg_get_river', array(
                'action_type' => 'update',
                'subject_guid' => $user->guid,
                'limit' => false,
                'wheres' => array("rv.view = \"$view\""),
            ));

            $river_items->setIncrementOffset(false);
            foreach ($river_items as $river_item) {
                 $river_item->delete();
            }

            access_show_hidden_entities($access_status);
            elgg_set_ignore_access($access);

            // Then create new river entry informing about profile update of this user
            elgg_create_river_item(array(
                'view' => $view,
                'action_type' => 'update',
                'subject_guid' => $user->guid,
                'object_guid' => $user->guid,
                'access_id' => get_default_access($user),
            ));

    My actual problem is that I don't know where to get the information that changes in the profile, in order to be able to show it with the function elgg_create_river_item

    Thanks again!

  • Set your profile's name with:

    elgg_set_config('profile_fields', [
        'description' => 'longtext',
        'location' => 'location',
        'contactemail' => 'email',
        'mobile' => 'phone',
        'skills' => 'tags',
        'website' => 'url',
        'projectname' => 'text',
    ]);

    in start.php

     

    Or override this view:

    views\default\forms\profile\edit.php

    See at

    $profile_fields = elgg_get_config('profile_fields');