Closed (fixed)
Project:
Show unpublished comments
Version:
7.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
27 Apr 2011 at 14:52 UTC
Updated:
10 Mar 2013 at 20:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
siliconmind commentedUnfortunately not, as I currently don't run any D7 site.
But I can help if anyone is willing to do the port.
Comment #2
berdirNeeded something like this for a client project, so here is a patch.
While the result is the same, the implementation differs quite a bit. There two major differences:
1. cid's are stored directly in $_SESSION instead of a db table. This has a number of advantages:
- Just like the table, when the session expires or you get a new one, this stops working. However, in this case, the session data is removed and nothing remains of it in the database.
- Drupal 7 automatically keeps session data when a user logs in, removing the need for the hook_user() implementation.
- No additional queries are necessary, Drupal 7 automatically creates a session if something is stored in $_SESSION.
There is one disadvantage though and that is that the information in $_SESSION can not be removed when the comment is published/deleted. I however doubt that a single anon user is going to write so many comments that this could result in a problem before his session drops. And for registered users, we could actually stop using $_SESSION completely and simply rely on the user id?
2. Thanks to the new database API, this module can now directly inject the query that fetches the comments from the database. This means that all it needs to do is change the query and implement hook_comment_view_alter() to remove the reply link and print a message.
These changes combined with the usual D6/7 API changes result in a pretty much complete rewrite of the code.
Please test.
Comment #3
berdirComment #4
siliconmind commentedBerdir, could you please provide a full patched source? I won't have access to appropriate tools for some time, but if module works then others could use it already.
Or maybe you would like to become co-maintainer?
Comment #5
pdpravindeshmukh commentedHi Berdir,
Thanks for the D7 patch.It works gr8 for me. :)
Comment #6
berdirComment #7
ezheidtmann commentedI've tested Berdir's patch and made some adjustments. I put code adding a condition into the innermost "if" statement (otherwise it would conflict with another comment filter module I have) and converted to UNIX line endings.
Needs review & testing
Comment #8
ezheidtmann commentedFixed PHP notice in previous when other users view page.
Comment #9
walker2238 commentedI tried this port out and all worked as expected with the exception of posting a comment when no other comments were posted for a particular node the comment doesn't show.
Did anyone else experience this?
Comment #10
ezheidtmann commentedI didn't see that cause I didn't test it! Thanks for finding that bug!
Try this and let me know how it works.
Comment #11
walker2238 commentedI gave it a quick run though and seems good with one exception.
in su_comments_node_view there isn't any check for node teaser so the comment will appear in the teaser view of a node. But that's the only issue I noticed this time around.
Comment #12
ezheidtmann commentedThanks for the additional review, walker2238. This patch adds to su_comments_node_view() the same check that is used in comment_node_view().
Comment #13
walker2238 commentedLooks good.
Comment #14
ezheidtmann commented7.x version is available on project page. Testers and feedback welcome!