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 (?)
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 (?)
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 (?)
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.
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.
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.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.