solved ProJam Comment Delete

Dazed
Dazed
@dazed
9 years ago
1,022 posts
I set the comments module to allow profile owners to delete comments. When testing this out I noticed that the user has the ability to not only delete but also edit. Editing seems like a an issue waiting to happen. Is there a way to disable that?
updated by @dazed: 10/21/16 03:15:08AM
michael
@michael
9 years ago
7,768 posts
Understand your issue, but I think its done that way on purpose. Imagine this scenario:

A user posts a really relevant and useful comment to your profile, its long and the only issue you have with it is that it contains an affiliate link. You as the owner of the profile have the option to: IGNORE IT/ DELETE IT, which do you choose......?

What you really want to do is update it to remove the affiliate link. Thats the reason the option is given.

If you want to disable that option for your site you can change the template at:
/modules/jrComment/templates/item_list.tpl around line 74 that looks like this:
                    {if jrUser_is_admin() || !isset($item.comment_locked)}
                        {if $_params.profile_owner_id > 0}
                            {* profile owners can delete comments *}
                            {jrCore_item_update_button module="jrComment" profile_id=$_params.profile_owner_id item_id=$item._item_id}
                            {jrCore_item_delete_button module="jrComment" profile_id=$_params.profile_owner_id item_id=$item._item_id}
                        {else}
                            {* site admins and comment owners see this button *}
                            {jrCore_item_update_button module="jrComment" profile_id=$item._profile_id item_id=$item._item_id}
                            {jrCore_item_delete_button module="jrComment" profile_id=$item._profile_id item_id=$item._item_id}
                        {/if}
                    {/if}

and comment out the update button so it looks like this:
                    {if jrUser_is_admin() || !isset($item.comment_locked)}
                        {if $_params.profile_owner_id > 0}
                            {* profile owners can delete comments *}
                            {*{jrCore_item_update_button module="jrComment" profile_id=$_params.profile_owner_id item_id=$item._item_id}*}
                            {jrCore_item_delete_button module="jrComment" profile_id=$_params.profile_owner_id item_id=$item._item_id}
                        {else}
                            {* site admins and comment owners see this button *}
                            {jrCore_item_update_button module="jrComment" profile_id=$item._profile_id item_id=$item._item_id}
                            {jrCore_item_delete_button module="jrComment" profile_id=$item._profile_id item_id=$item._item_id}
                        {/if}
                    {/if}

and that will remove that button.

--edit--
Alter it by any of the means outlined here:

Docs: "Altering a Modules Template"
https://www.jamroom.net/the-jamroom-network/documentation/development/1051/altering-a-modules-template
updated by @michael: 07/15/16 10:05:37PM
Dazed
Dazed
@dazed
9 years ago
1,022 posts
Hey Michael - I was more worried about having the ability to "put words into people mouths". It leaves the profile owner with the ability to edit the post and add derogatory comments and then say "I can't believe they said that about me." Meanwhile the original author is claiming "I never wrote that." This is why I have the thought that you either want the comment or you do not.

As an admin, I want edit capability. For a profile owner, no. I can't think of a site out there that allows a profile owner to edit a post that they did not write.
Dazed
Dazed
@dazed
9 years ago
1,022 posts
ok weirdness - as an admin I am not longer able to see the edit button which is odd because the conditional statement looks correct.

if jrUser_is_admin() || !isset($item.comment_locked)}
                            {if $_params.profile_owner_id > 0}
                            {* profile owners can delete comments *}
                            {*{jrCore_item_update_button module="jrComment" profile_id=$_params.profile_owner_id item_id=$item._item_id}*}
                            {jrCore_item_delete_button module="jrComment" profile_id=$_params.profile_owner_id item_id=$item._item_id}
                        {else}
                         {* site admins and comment owners see this button *}
                            {jrCore_item_update_button module="jrComment" profile_id=$item._profile_id item_id=$item._item_id}
                            {jrCore_item_delete_button module="jrComment" profile_id=$item._profile_id item_id=$item._item_id} 
                        {/if}

updated by @dazed: 07/16/16 07:46:01AM
michael
@michael
9 years ago
7,768 posts
ok, instead of commenting it out, wrap it in an if user is admin for the update button
{*{jrCore_item_update_button module="jrComment" profile_id=$_params.profile_owner_id item_id=$item._item_id}*}
to
{if jrUser_is_admin()}
{jrCore_item_update_button module="jrComment" profile_id=$_params.profile_owner_id item_id=$item._item_id}
{/if}
to just show it for the admin

--edit---
Yeah I got your meaning from your first post. If you're having that kind of issue, then the profile owner is just out to cause trouble, and remove their privileges to delete.
updated by @michael: 07/17/16 01:37:53AM
Dazed
Dazed
@dazed
9 years ago
1,022 posts
Thanks Michael.