Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If we wanted to every display the IP address for a comment, we will need to add the {comment}.hostname to the comment_render() query. It would be great to have this backported to D6 because it will be useful for the Gravatar module to show Gravatars for anonymous comments that do not have an e-mail provided.
Comment | File | Size | Author |
---|---|---|---|
#4 | 514928-comment-hostname-D7.patch | 2.81 KB | Dave Reid |
#4 | 514928-comment-hostname-D6.patch | 3.82 KB | Dave Reid |
#2 | 514928-comment-hostname-D7.patch | 2.37 KB | Dave Reid |
#2 | 514928-comment-hostname-D6.patch | 3.38 KB | Dave Reid |
#1 | 514928-comment-hostname-D7.patch | 1.53 KB | Dave Reid |
Comments
Comment #1
Dave ReidPatches for D7 and D6 for review.
Comment #2
Dave ReidThe original issue from Gravatar is #512978: Update logic if anonymous comments' e-mail is not available. This can also be used in conjunction with #381802: Have theme_username() show hostname for anonymous users if available if we want to display the hostname for anonymous comments on the comment admin interface.
Revised patches for D7 and D6 with the hostname addition to comment.admin.inc.
Comment #3
akahn CreditAttribution: akahn commentedPatch looks clean. Tested on D7 and comments work as expected. Perhaps you should also add hostname as a variable to be available in comment.tpl.php by modifying template_preprocess_comment: http://api.drupal.org/api/function/template_preprocess_comment/7.
Comment #4
Dave ReidRevised patches for D7 and D6 with akahn's suggestion.
Comment #5
akahn CreditAttribution: akahn commentedThanks for adding that. This looks good and works as expected on D7.
My only concern is that your modifications to comment.admin.inc don't belong here, but rather in #381802: Have theme_username() show hostname for anonymous users if available. This would be a better approach to what are working to solve in that issue.
Comment #7
Dave ReidComment #9
Dave ReidThis has actually been fixed with the comment API revamp in D7. Still needs to be fixed for D6.
Comment #10
TheoRichel CreditAttribution: TheoRichel commentedWell. I have just recently upgraded to D6 and really really hope that this patch will be fixed for D6.
Many thanks
Comment #11
mcurry CreditAttribution: mcurry commentedWhat work needs to be done to get this in D6?