Hi,
I would like to ask you if it's possible to add one more token for comments on status, especially token for originator of the status. At this moment I can see this token:

'commenter-uid' => t('The User ID of the user who posted the status message.'),

But I need token for user id who posted a status not a user who made a comment on the status.

Can you please add the token?

Below you can find all your added tokens:

$tokens['fbss_comment'] = array(
'commenter-themed' => t('The themed name of the user who posted the status message.'),
'commenter-name' => t('The safe name of the user who posted the status message.'),
'commenter-name-raw' => t('The raw name of the user who posted the status message. WARNING: raw user input.'),
'commenter-uid' => t('The User ID of the user who posted the status message.'),
'message-unformatted' => t('The comment text, with HTML escaped but no filters run over it.'),
'message-formatted' => t('The formatted comment text.'),
'message-raw' => t('The completely unfiltered comment text. WARNING: raw user input.'),
'comment-themed' => t('The new status completely themed, including usernames and times.'),
'comment-id' => t('The Comment ID.'),
'comment-status-id' => t('The Status ID.'),
'comment-status-url' => t('The URL of the related status message.'),
'comment-edit' => t('Edit comment link.'),
'comment-delete' => t('Delete comment link.'),
'comment-created' => t('The themed time the comment was submitted.'),
);
If you know more info don't hesitate to contact me I will send you a more info.

Thanks a lot.

BR

Lukas P.

Comments

icecreamyou’s picture

Priority: Major » Normal
Status: Active » Postponed (maintainer needs more info)

If you are using Rules, the best way to do this is by using e.g. the "Load a Status" action, which will give you access to the tokens related to the status on which the comment was made. From there, you can additionally use the "Load a User" action if you need more tokens related to that user account.

(The actual name of the actions may be slightly different, this is off the top of my head.)

mathankumarc’s picture

I think we can add this token in 7.x, this token will be useful when sending the notifications on commenting.

For example, if we have statuses author token, then if someone comments on it, we can mention the statuses author name in the notifications like "zzz commented on yyy status".

Rather then performing two actions in rules, we can provide the ability for the users to directly use it.

icecreamyou’s picture

Well this is implicitly built in in D7 because we just specify the token type as "user" and it automatically does the loading for us if you use a token that requires a user to be loaded. We might be able to do the same thing for statuses (e.g. specify the token type as "status" and have the statuses tokens automatically loaded if necessary).

mathankumarc’s picture

Yeah I forgot about that. However we can add this in D6, cause this will reduce the loads in rules. Also this will be helpful for the users who are not using rules(Worst case)

icecreamyou’s picture

Status: Postponed (maintainer needs more info) » Fixed

No, there are two issues with that:

  • There's a performance burden because in D6 every time Token requests the set of tokens for a type of entity it has to load and process the values for every token. So the more tokens we support, the more overhead there is for every FBSS site. Normally this isn't a big deal because we already have the data loaded from the database so another token is typically just a little bit of string formatting. But supporting tokens for other entity types (e.g. for statuses when only a comment needs to be loaded) is a larger and unnecessary overhead when it's easy to just use a "load [entity]" action which is specifically what that action is designed for.
  • Supporting tokens for other entities is a slippery slope. For a status comment, if we support the parent status message, then people will want the status time, and other status properties, and eventually tokens for the sender and recipient... all of which are already implemented in other places and don't need to be duplicated. The line has to be drawn somewhere or it becomes an increasing maintenance burden.

It may be worth documenting how to do this in the FAQ however, because this is not the first time I've gotten this question.

Marking this issue "fixed" because I'm assuming the original request was for Rules and that question has been answered now. @darkslide, if that is incorrect feel free to reopen.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.