Get entries from profile to language

Hi,

does anybody know how to get entries in the profile and add it to the language file? One example:

When user A has written into his profile: school:Harvard, user B: school: Cambridge and user C has nothing, then I want to get these informations and place it into the river, for example, when someone updates the profile:

User A, a Harvard student, has updated...

User B, a Cambridge student, has...

User C has updated...

 

I use elgg 1.7.7, but this should be similar to 1.8

Oh: I also use the profilemanager Plugin, so adding the field "school" is no problem :-)

It was told me, that this would be possible with get user entity. But how? I thought of something like:

'Languagetag' => "%s <?php get(user_entity); if(now here I need the profile field, no idea, how to get it=Harvard){,a Harvard student, } if(...=Cambridge){,a Cambridge student,} else {} ?>

Is there any way to get it working?

  • something like ==>

    <?php
    //
        /**        e1715\mod\profile\views\default\river\user\default\profileupdate.php    **/
        $performed_by = get_entity($vars['item']->subject_guid); // $statement->getSubject();
        /**    'profile:river:update' => "
                %s                                updated their profile    ",
                User A, a <Harvard student>        updated their profile
                    $School=$performed_by->name
                    $School = $performed_by->SchoolMetaDataName        **/
        $School=    $performed_by->SchoolMetaDataName;
        $School=    "?Student`NoWhere?";
        if    ($School==Harvard)
            $School=    ", a Harvard student";
        if    ($School==Cambridge)
            $School=    ", a Cambridge student"
        $School=$performed_by->name.$School;
    //
        $url = "<a href=\"{$performed_by->getURL()}\">{$School}</a>";
        $string = sprintf(elgg_echo("profile:river:update"),$url);
    ?>
    <?php
    echo $string;
    ?>

  • So, I add                
        $School=    $performed_by->SchoolMetaDataName;
        $School=    "?Student`NoWhere?";
        if    ($School==Harvard)
            $School=    ", a Harvard student";
        if    ($School==Cambridge)
            $School=    ", a Cambridge student"
        $School=$performed_by->name.$School;

    to the en.php? Or the commented part? What I want to make is that I only have to modify the en.php. Is there any way to do it? With a code that is possible to do this, you are able to make many plugins to make your site better for the users...