This module aims to bring originality to drupal comments. More often than not the majority of comments on a website will be things like 'lol' or perhaps just some copypasta.
With this module enabled each comment is checked against other comments to see if what is commented has been said before.
The module has two modes:
- Unique Comments per Node - Will ensure that each comment is unique on a per node basis. No two comments will be the same per individual node.
- Unique Comments Sitewide - Will ensure no two comments are the same on the entire site. Think r9k for comments!
The future of this module sees bypass rights for users of certain roles and named users. Also it will be able to be selectively added to content types and have specific nodes bypass it!
Link to the project page.
Git Repo: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/typhonius/1459784.git
Drupal 7 Module (Although I plan to support both drupal 6 and 8)
Reviews:
http://drupal.org/node/1478290#comment-5729030
http://drupal.org/node/1468662#comment-5690220
http://drupal.org/node/1466090#comment-5682948
Comments
Comment #1
targoo commentedHi
Good coding practice and good work. I only have a few questions :
Manuel Review :
1)
if ($comments = db_select('field_data_comment_body', 'cb')
->fields('cb', array('entity_type', 'comment_body_value'))
->condition('entity_type', array('comment'))
->condition('comment_body_value', array($v[0]['value']))
->execute()
->fetchAll())
it is = or == ?
2)
$field = 'UPPER(cb.comment_body_value)';
this variable is not used / delete it
3)
->fields('c', array('cid', 'nid'))
do you need these fields ? You don't do anything with them.
Comment #2
targoo commentedComment #3
adammaloneHi targoo,
Thanks for your review.
1. It actually shouldn't be either. I'm glad you noted that though, since I'm just checking for whether there is a record in the db I've removed the '$comments =' bit entirely so now the if statement is:
2. Removed.
3. I initially assumed I had to output the fields I was joining on, today I learned I didn't.
Comment #4
patrickd commentedSorry for the delay, too many applications too few reviewers,
you can get a review bonus and we will come back to your application sooner.
Comment #4.0
patrickd commentedadding in info for drupal versions
Comment #5
anilbhatt commentedManual Review:
Comment #6
anilbhatt commentedComment #7
adammaloneThanks for you constructive comments anilbhatt.
1. hook_help now has actual helpful content
2. Module is now longer due to added functionality!
3. Works for all content types now - thanks for pointing that one out!
4. Changed that to:
5. Module is now extended to include:
a. permissions for users who are able to bypass the restraints of the module
b. permissions for users when they create a node, whether to exempt that node from the module
c. Per node type exemptions so users with administer unique comments permissions can specify which content type is allowed to have unique comments
d. Extended admin interface
e. per node exemption that overrides all other exemptions so unique comments does not apply to specific nodes.
f. Granular control over where Unique Comments takes effect.
g. Added a fieldset to node edit pages of content types that have unique comments enabled so the node creator/editor can (provided sufficient privileges) make the node exempt via a tickbox.
Thanks for everyones continued assistance with this module!
Comment #7.0
adammaloneadded in bullets
Comment #8
adammaloneReviews:
http://drupal.org/node/1478290#comment-5729030
http://drupal.org/node/1468662#comment-5690220
http://drupal.org/node/1466090#comment-5682948
Comment #9
chhavik commentedI found couple of issues in your module :-
Comment #10
adammaloneI honestly had no idea that system_settings_form did that. Took a look at the submit handler for it and sure enough you're right! How cool is that!
Anyway, changes committed, thanks again for finding them.
Comment #11
klausimanual review:
Otherwise looks nearly ready to me. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #12
adammaloneComment #13
adammaloneComment #14
patrickd commentedPlease leave the security tag, it's for statistical purposes.
Comment #15
adammaloneAh ok sorry, I thought after solving the issue I could remove it.
Comment #16
adammalonehttp://drupal.org/node/1503734#comment-5787536
http://drupal.org/node/1503176#comment-5787558
http://drupal.org/node/1453964#comment-5687774
http://drupal.org/node/1510956#comment-5816708
Comment #17
seyv commentedUse l() instead of hard coding in hook_help() see l().
How are you to know a node nid ? this must be searched in the db.. try to combine this functionality with your table 'Exempt (weird choice of the word btw, needed to google it to understand what it meant) nodes'. Take a look at A K Chauhan’s Blog for an example.
Good module though
EDIT: this is not something I would define as 'need work' cause imo it can be implemented in a later stage.
Comment #18
adammaloneThanks for your input SeyVaneerdewegh,
I have actually changed url() to l() although it's not commited yet so changes won't be seen. With regard to your other query, if the user knows the NID they can enter it in the admin interface, if they don't, they can always exempt it on the node edit page.
I am also adding in the option to use hook_node_operations and batch operations to alter multiple nodes from the admin/content page.
Comment #19
klausimanual review:
But that are just minor issues, otherwise I think this is RTBC. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects. Assigning to tim.plunkett as he might have time to finally approve this.
Comment #20
patrickd commentedComment #21
patrickd commented->
but anyway, this module looks good enough to get promoted,
thanks for your contribution and welcome to the community of project contributors on drupal.org! :)
I've granted you the git vetted user role which will let you promote this to a full project and also create new projects as either sandbox or "full" projects depending on which you feel is best.
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
As you continue to work on your module, keep in mind: Commit messages - providing history and credit and Release naming conventions.
Thanks to the dedicated reviewer(s) as well.
Comment #22
adammaloneWow, thanks a lot!
I'll make a few of those changes (tidying up the README and project pages) prior to promoting it to a full project.
Thanks to everyone who reviewed the module, your time and attention to detail has been much appreciated!
Comment #23.0
(not verified) commentedadded in other module reviews