What you should be doing is hooking into the check for 'permissions_check:comment'
http://reference.elgg.org/ElggEntity_8php_source.html#l00972
eg.
function myplugin_can_comment_hook($hook, $type, $return, $params) {
$entity = $params['entity'];
$user = $params['user'];
// check if the user is the owner, or a friend of the owner, return true if the can comment, return false if they can't, return $return to stick with the default
}
Ahhhh thank you so much. I didn't really know what a hook was for. Been messing around with elgg for a little bit, but never got too deep into it. Thank you. So I'll change the forms.php file back to how it was originally, and then try modifying the hook. Thanks so much!
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.