I want that in one of my groups users can post anonymous, for example in a group with guid=61. Is it possible???
I try this in topicposts.php, but it does not work like I want:
if ($group_guid = 61) {
echo "<div class=\"post_icon\"><img src=\"" . elgg_view('icon/user/default/small') . "\" /></div>";
echo "<p><b>" . elgg_echo('Anonymous) . "</b><br />";
} else {
//get infomation about the owner of the comment
if ($post_owner = get_user($vars['entity']->owner_guid)) {
//display the user icon
echo "<div class=\"post_icon\">" . elgg_view("profile/icon",array('entity' => $post_owner, 'size' => 'small')) . "</div>";
//display the user name
echo "<p><b>" . $post_owner->name . "</b><br />";
} else {
echo "<div class=\"post_icon\"><img src=\"" . elgg_view('icon/user/default/small') . "\" /></div>";
echo "<p><b>" . elgg_echo('profile:deleteduser') . "</b><br />";
}
}
With this code it shows me in all groups anonymous instead of the username. But it should be only in the group with guid=61.
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.
- Brett@brett.profitt

Brett - 0 likes
- adrian@adriann

adrian - 0 likes
You must log in to post replies.This would require changes to the group plugin by someone with at least intermediate PHP skills. The places to look are in the group forum's actions and in the forums views that try to load and display user icons.
Hi Brett,
Do you have a solution for this? Or how the code should be? It doesn't work with the group_guid