We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

remove delete comment functionaility | Forum

Shane
Shane Apr 10 '13
My business sponsor would like the ability to remove the Delete comment tooltip from posted comments.  


Anyone done this?


Where should I start looking. 



Michael I.
Michael I. Apr 11 '13
Are you speaking about the comments in Newsfeed?
Shane
Shane Apr 11 '13
Yes, regrettably. They want to ensure all posts/comments are retained
Shane
Shane Apr 14 '13
I have managed to talk my business sponsor into, changing the requirement from not being able to Delete a comment, to only Admin users can delete comments.
Shane
Shane Apr 14 '13
i have managed to block the users ability to delete comments, by updating the comments.php file by amending the line 236 :

$commentOwner = ( (int) OW::getUser()->getId() === (int) $comment->getUserId() ); 

to
$commentOwner = ( (int) OW::getUser()->isAdmin());

then i created a new customized error message "auth_ajax_error_delete_comment" in the lang_1.php file


 echo json_encode(array('error' => OW::getLanguage()->text('base', 'auth_ajax_error_delete_comment')));


Still need to block the ability to delete posts from the newsfeed.


Shane
Shane Apr 15 '13
I have now managed to to block users from deleting posts. 

In the event_handler.php file (ow_plugins/newsfeed/classes)

On line 1038 I changed 

$canRemove = OW::getUser()->isAuthenticated() && ( $params['action']['userId'] == OW::getUser()->getId() || OW::getUser()->isAuthorized('newsfeed') );


to


$canRemove = OW::getUser()->isAuthenticated() && OW::getUser()->isAdmin();