In an attempt to fight comment spam on a couple of my Drupal sites I need access to the spammer's IP address. This is easy to retrieve from the comments table.

Unfortunately the Token module does not yet provide this token for comment tokens.

Attached patch to token_comment.inc version 1.3.4.10 provides the missing token.

Feedback is welcome. I hope it will make it eventually in the Token module.

Cheers,

Olivier

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch, token_comment-1.3.4.10.inc_.diff, failed testing.

ShutterFreak’s picture

Re-submitting as "diff -up" instead of "diff -u"...

ShutterFreak’s picture

Status: Needs work » Needs review

token_comment-1.3.4.10.inc_.diff queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, token_comment-1.3.4.10.inc_.diff, failed testing.

ShutterFreak’s picture

Status: Needs work » Needs review
FileSize
1.23 KB

Doah. Use UNIX line ends (\n) instead of MS Windows (\r\n).

Hope this time it will pass.

ShutterFreak’s picture

Any chance this will make it into Token?

ShutterFreak’s picture

Is there a reason why this does not make it in the token module?

adellefrank’s picture

Status: Needs review » Reviewed & tested by the community

I tested out the patch in #5 and it works great...thanks!

adellefrank’s picture

Status: Reviewed & tested by the community » Patch (to be ported)

Might I suggest this be added? It works and is very simple. Hopefully, a random drupalista. :)

colan’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Patch (to be ported) » Needs work

New features need to go into the latest dev branch first.