Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Profile Addon - Deleting Avatar Comments Help
DaPerson
New
Hey,
I'm developing an addon which allows users to delete avatar comments on their wall only.
The controller I found which renders the comments is ProfileController_BeforeActivity_Handler
. Though I don't think there's a way to render the delete button without overriding some methods. I'm wondering if there's a better way to do this.
0
Comments
The ActivityComments list is rendered here:
Each single comment is written with the writeActivityComment function:
A delete button should look like that:
<div class="Options"><a href="/dashboard/activity/delete/XYZ/transientKey?Target=profile%2Fusername" class="Delete">×</a></div>
You would have to add it right after the
li.ActivityComment
element. Sadly, there is no event fired which could help you.I see only one obvious option, but there might be a second way to do so:
.Activity-PictureChange > .ActivityComments > .ActivityComment
. The transientKey is available in your JavaScript with thisvar transientKey = gdn.definition('TransientKey');
Although normally I'd prefer PHP solutions, the JavaScript way would be less invasive here and I would use it in this case.
Thank you so much! I'll probably go with the JS solution.