Provide {comment}.hostname in comment_render()
Dave Reid - July 9, 2009 - 17:51
| Project: | Drupal |
| Version: | 7.x-dev |
| Component: | comment.module |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Dave Reid |
| Status: | needs work |
| Issue tags: | needs backport to D6 |
Description
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.

#1
Patches for D7 and D6 for review.
#2
The original issue from Gravatar is #512978: All my gravatars look the same. This can also be used in conjunction with #381802: Show hostname rather than "Anonymous" for comments on admin/content/comments 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.
#3
Patch 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.
#4
Revised patches for D7 and D6 with akahn's suggestion.
#5
Thanks 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: Show hostname rather than "Anonymous" for comments on admin/content/comments. This would be a better approach to what are working to solve in that issue.
#6
The last submitted patch failed testing.
#7
#8
The last submitted patch failed testing.