Closed (fixed)
Project:
Node Comments
Version:
6.x-1.2-rc2
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
17 Oct 2008 at 20:28 UTC
Updated:
9 May 2010 at 19:04 UTC
What would it take ($?) to expose tokens for this module so that, for example, the actions or rules module could send a tokenized email to the author of the node target ie. Your page received a comment. I tried it myself, but I'm sure I'm missing something. Maybe it'd be easier for someone who knows how this module works. Basically I tried this in various incarnations:
/**
* Implementation of hook_token_values.
*/
function node_token_values($type, $object = NULL, $options = array()) {
if ($type == 'node') {
$node = $object;
$tempuid = db_result(db_query("SELECT uid FROM {node} WHERE nid = %d", $node->comment_target_nid));
$target_email = db_result(db_query("SELECT mail FROM {users} WHERE uid = %d", $tempuid));
$values['target-email'] = $target_email;
return $values;
}
}
/**
* Implementation of hook_token_list.
* Seems to work fine.
*/
function node_token_list($type = 'all') {
if ($type == 'node' || $type == 'all') {
$tokens['node']['target-email'] = t("Comment target-node user's email.");
return $tokens;
}
}
Comments
Comment #1
crea commented1.2 branch is not supported anymore. Closing.