By unkommon on
I would like users to be able to modify whether or not people can comment on the posts they make. By default I want comments for all nodes to be Disabled, then the owner is able to set them to Read Only or Read/Write. This is for an online writing community where I would like the poster to be able to accept criticism, or not. I don't want to give authenticated users "moderate comments" to reach this end, because then (as I understand it) they can moderate/edit/delete othe people's posts/comments. That is not desirable. I just want the owner of a node to be able to modify the "User comments" section. Is this possible?
Comments
I believe it would entail
I believe it would entail hacking an additional permission into comment.module.
I haven't looked closely myself but I imagine this is easily a <20 line addition.
If you need further direction please ask.
I almost have it...
I have edited 4 lines of code so far, and it is displaying correctly but the selection doesn't stick!
I have changed content_perm to:
and inside comment_nodeapi()
then inside node.module I have edited node_form() to bring $extras out of the if(user_access['administer nodes')
So all is displaying well enough. But when i alter the value of the comments, it doesn't seem to stick. I have been looking everywhere to see where it is setting it back to the default, to no avail. Any ideas on where to go with this?
I think you might need to do
I think you might need to do something in node_validate in the node module as well...which checks against the default node workflow/publishing settings...I believe
Ian
Yep... actually comment_nodeapi
Okay, now it works
change the primary if statement in the 'validate' of comment_nodeapi to
In conjunction with my changes listed above. All is well :).
That's great. Now how about
That's great. Now how about the idea of letting users administer comments that are only on posts that they made? Like delete, unpublish, publish comments...
Hrmmm..
Yeah, that is ideal (especially with how I worded the additional permission). I believe that hack would take a bit more work, and I don't really need it for my site. But I will work on it anyway. It shouldn't be too time consuming now that comment.module and I are good friends. I'll post the edits once it is complete.
This could be really
This could be really convenient for sites where the are multiple bloggers, for example, but they're not trusted enough to have admin/comments privs to admin all comments, but they are trusted enough to admin comments that are on their own blogs. How do you imagine doing this? Just doing on-page publish/delete, so the comment shows up on the post only for those w/ administer comments privs and the post owner, and the command to publish, unpublish, or delete the comment is right there on the comment itself, or offer an overview screen much like the admin/comments overview, but like admin/comments/uid where uid is the userid for the post-owner who has comments on their posts and w/ privs to 'administer received comments' for example?
testing
testing
testing 2
testing 2
Great idea
This feature would be very nice to have, and seems so obvious now that you mention it.
(I'm really commenting just so it's easier for me to revisit this thread. Wish we could mark threads or subscribe or something.)
unkommon - please create a
unkommon - please create a feature issue and post a patch to comment.module when you're done.
read http://drupal.org/patch if you're not familiar with patches.
Fix
Hi guys,
I hack my drupal commnets module, so now, for a user it shows only the comments posted on content created by himself, and for the administrator show all the comments.
For me, it looks to work fine, but however, I Have no php experience at all (actually this were my first php code lines)
so maybe it can be done in a better way.
How I did (I am using drupal 4.6.5):
I did all the chnages in the previous posts in comments.module and node. module plus the following one:
I change in comments.module line 1028:
with the follwing lines of code
I repeat so far it looks to work fine, however any feedback from a php expert will be welcome!
Cheers