Closed (fixed)
Project:
Real Name
Version:
6.x-1.3
Component:
Tokens
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
11 Nov 2009 at 15:03 UTC
Updated:
9 Jun 2010 at 20:40 UTC
When using the RealName module, I ended up needing to create a token for the author of a comment. I ran into this when using the Notifications module.
When using Notifications, the ['realname'] token substitutes in the real name of the person receiving the message. However, I wanted to have the creator of the comment substituted in instead. To do this, I created a new token called ['realname-comment-author']. I'm attaching a patch with my changes. Please let me know if you have any questions.
| Comment | File | Size | Author |
|---|---|---|---|
| realname-comment-token.patch | 823 bytes | JuliaKM |
Comments
Comment #1
SamRose commentedTested, it works!
Comment #2
Vasu commentedRealname is working for users with permission. But when sending email updates about new content there is no token available to include author's real name. it looks odd where you can see the realname in the nodes but only author's usernames in the emails.
Comment #3
xjmIt would be nice to have a similar token for the author of a node, as well; something like
[author-realname].Comment #4
SamSound commentedI couldnt get it to work :S. is it in the latest release.
Can somebody upload me a working version?
Comment #5
Balbo commentedNot sure what is this about. It just provide a new token, isn't it?
Is it somehow related to the "Author by" field of a node (where I can't use the realname)?
Comment #6
nancydru@JuliaKM: There really should be a matching hook_token_list value as well. Also, I don't see the value in a heavy
user_loadhere; I changed it to$tokens['realname-comment-author'] = db_result(db_query("SELECT realname FROM {realname} WHERE uid = %d", $object->uid));@xjm: You got it.
Comment #7
nancydruCommitted to 6.x-1.x-dev.