longjohn

Send private message

You must be logged in to send a private message.

Activity

  • So, I have a small company, and I want the 'send a message' dropdown list to include all members, not just the friends of whoever happens to be sending the message.  I'm pretty sure I'm going to have to change...
    • Hi Long John,

      As you can see, the $friend is populated by iterating over an array that's passed in as $vars['friends']. The elgg framework usually populates the $vars associative array, so you would need to find out what is being passed in $vars['friends']. 

      Trace the code upwards and figure it out.

      If it's a view, you will have to override the view.

    • FINALLY figured it out.  Here's the solution (edit /mod/messages/views/default/messages/forms/message.php):

       

                      //make the first option blank
                      echo "<option value=''></option>";

      //The following returns the 25 newest members; the number can be changed

              $users = get_entities('user', '', 0, '', 25, 0, false, 0, null);
                      foreach($users as $user){
                            
                          //populate the send to box with a user's friends the members of the site :)
                          echo "<option value='{$user->guid}'>" . $user->name . "</option>";
                             
                      }

       

    • In case anyone stumples upon this like I did: I just made a simple Elgg 1.8 plugin out of these ideas. (the code above seems like for Elgg 1.7 (?)

       

  • So, I have a small company, and I want the 'send a message' dropdown list to include all members, not just the friends of whoever happens to be sending the message.  I'm pretty sure I'm going to have to change...
    • Hi Long John,

      As you can see, the $friend is populated by iterating over an array that's passed in as $vars['friends']. The elgg framework usually populates the $vars associative array, so you would need to find out what is being passed in $vars['friends']. 

      Trace the code upwards and figure it out.

      If it's a view, you will have to override the view.

    • FINALLY figured it out.  Here's the solution (edit /mod/messages/views/default/messages/forms/message.php):

       

                      //make the first option blank
                      echo "<option value=''></option>";

      //The following returns the 25 newest members; the number can be changed

              $users = get_entities('user', '', 0, '', 25, 0, false, 0, null);
                      foreach($users as $user){
                            
                          //populate the send to box with a user's friends the members of the site :)
                          echo "<option value='{$user->guid}'>" . $user->name . "</option>";
                             
                      }

       

    • In case anyone stumples upon this like I did: I just made a simple Elgg 1.8 plugin out of these ideas. (the code above seems like for Elgg 1.7 (?)

       

  • So, I have a small company, and I want the 'send a message' dropdown list to include all members, not just the friends of whoever happens to be sending the message.  I'm pretty sure I'm going to have to change...
    • Hi Long John,

      As you can see, the $friend is populated by iterating over an array that's passed in as $vars['friends']. The elgg framework usually populates the $vars associative array, so you would need to find out what is being passed in $vars['friends']. 

      Trace the code upwards and figure it out.

      If it's a view, you will have to override the view.

    • FINALLY figured it out.  Here's the solution (edit /mod/messages/views/default/messages/forms/message.php):

       

                      //make the first option blank
                      echo "<option value=''></option>";

      //The following returns the 25 newest members; the number can be changed

              $users = get_entities('user', '', 0, '', 25, 0, false, 0, null);
                      foreach($users as $user){
                            
                          //populate the send to box with a user's friends the members of the site :)
                          echo "<option value='{$user->guid}'>" . $user->name . "</option>";
                             
                      }

       

    • In case anyone stumples upon this like I did: I just made a simple Elgg 1.8 plugin out of these ideas. (the code above seems like for Elgg 1.7 (?)

       

  • longjohn replied on the discussion topic So, I want to remove friend functionality... in the group Elgg Technical Support
    Hi all, I'm trying to set elgg 1.5 up in a sort of corporate intranet environment as a directory of personnel.  It's a small company, and everyone is everyone's friend, so I'd rather not have the friend functionality even be there.  Is it...
    • That is not a good solution.  All you are doing there is hiding the link not the functionality, and you're hacking the core to do it.  Search around, there was a newer thread about this not long ago.

    • This is much more easier in 1.8 than the 1.7 days. You need to override multiples views and unregister multiple links in Elgg. Though we said its easier, it still requires a lot of work.

      Also : please dont modify the core files. This will break the upgarade functionality of Elgg unless you have a documentation on your changes.

    • I don't mind modifying the core, because I keep a list of my changes. Also, I disabled the unfriend functionality separately.

  • longjohn replied on the discussion topic So, I want to remove friend functionality... in the group Elgg Technical Support
    Hi all, I'm trying to set elgg 1.5 up in a sort of corporate intranet environment as a directory of personnel.  It's a small company, and everyone is everyone's friend, so I'd rather not have the friend functionality even be there.  Is it...
    • That is not a good solution.  All you are doing there is hiding the link not the functionality, and you're hacking the core to do it.  Search around, there was a newer thread about this not long ago.

    • This is much more easier in 1.8 than the 1.7 days. You need to override multiples views and unregister multiple links in Elgg. Though we said its easier, it still requires a lot of work.

      Also : please dont modify the core files. This will break the upgarade functionality of Elgg unless you have a documentation on your changes.

    • I don't mind modifying the core, because I keep a list of my changes. Also, I disabled the unfriend functionality separately.

  • longjohn has a new avatar
    longjohn
  • longjohn replied on the discussion topic So, I want to remove friend functionality... in the group Elgg Technical Support
    Hi all, I'm trying to set elgg 1.5 up in a sort of corporate intranet environment as a directory of personnel.  It's a small company, and everyone is everyone's friend, so I'd rather not have the friend functionality even be there.  Is it...
    • That is not a good solution.  All you are doing there is hiding the link not the functionality, and you're hacking the core to do it.  Search around, there was a newer thread about this not long ago.

    • This is much more easier in 1.8 than the 1.7 days. You need to override multiples views and unregister multiple links in Elgg. Though we said its easier, it still requires a lot of work.

      Also : please dont modify the core files. This will break the upgarade functionality of Elgg unless you have a documentation on your changes.

    • I don't mind modifying the core, because I keep a list of my changes. Also, I disabled the unfriend functionality separately.