array( 'label' => t('Send an email to all other comment posters and the author of a node'), 'arguments' => array( 'node' => array('type' => 'node', 'label' => t('The node to which the published comment has been added')), 'comment' => array('type' => 'comment', 'label' => t('The comment that has just been published')), 'author' => array('type' => 'user', 'label' => t('The author of the published comment')), ), 'module' => 'Comment', ), ); } function user_conditions_action_send_mail($node, $comment, $author, $settings) { $sql = 'SELECT uid FROM {comments} WHERE nid = ' . $comment->nid . ' AND uid != ' . $comment->uid . ' GROUP BY (uid)'; $query = db_query($sql); $uids = array(); if ( $query !== FALSE && db_affected_rows() ) { while( ($obj = db_fetch_object($query)) !== FALSE) { $uids[] = $obj->uid; } } if ( $node->uid != $author->uid ) { $uids[] = $node->uid; } $uids = array_unique($uids); if ( !empty($uids)) { foreach($uids as $uid) { $account = user_load($uid); if ( $account !== FALSE ) { $from = isset($settings['from']) ? $settings['from'] : NULL; $params['account'] = $account; $params['comment'] = $comment; $params['node'] = $node; $params['settings'] = $settings; drupal_mail('user_conditions', 'comment_published', $account->mail, user_preferred_language($account), $params, $from); } } } } ?>