Maybe it would be better to not modify the action (or hook into the action) to prevent the profile page owner from making a posting (as it would be slightly annoying to write a posting and only after sending to realize that it won't get added) but to modify the widget content code to not display the add posting from in the first place to profile page owners:
if (elgg_is_logged_in() && (elgg_get_page_owner_guid() != elgg_get_logged_in_user_guid())) {
echo elgg_view_form('messageboard/add', array('name' => 'elgg-messageboard'));
}
Simply adding the modified content.php to your own custom plugin at mod/<your_plugin>/views/default/widgets/messageboard/content.php should override the core view (i.e. you would not need to modify a core file).
Yes thanks iionly, i took the code you sent me via pm and it worked.
Thanks.
or a better idea would be able to comment directly on the message board below the original comment.
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.