When I wanted to create the flag called "aplauz" which I wanted to be defined to give points to author of a comment when I flag it as "aplauz".

The problem is, that you can't define the flag to give points to a comment author, you can only set that it gives points to a flagging user, in this case ME, so Is there a way to define,

if comment is flagged under "aplauz" (1+) then give points to a comment author

Same goes for nodes, there's just no option to assign "give points to comment/node author, there's just for Flagging user.

This is the code of my rule :

array (
  'rules' => 
  array (
    'rules_42' => 
    array (
      '#type' => 'rule',
      '#set' => 'event_flag_flagged_aplauz',
      '#label' => 'aplauz_FLAG',
      '#active' => 1,
      '#weight' => '0',
      '#categories' => 
      array (
      ),
      '#status' => 'custom',
      '#conditions' => 
      array (
        0 => 
        array (
          '#weight' => 0,
          '#info' => 
          array (
            'label' => 'Flagging count >= 1, for flagged comment, under "Aplauz"',
            'base' => 'flag_rules_condition_threshold',
            'label callback' => 'flag_rules_condition_threshold_label',
            'arguments' => 
            array (
              'flag' => 
              array (
                'type' => 'flag',
                'label' => 'Flag',
                'flag_type' => 'comment',
              ),
              'object' => 
              array (
                'type' => 'comment',
                'label' => 'Flagged comment',
              ),
              'number' => 
              array (
                'type' => 'number',
                'label' => 'Number',
                'description' => 'The number against which to test the number of times the object is flagged. For example, if you type "3" here, and choose "Greater than" for the operator, then this condition will return TRUE if the object is flagged more than three times.',
              ),
            ),
            'module' => 'Flag',
          ),
          '#name' => 'flag_rules_condition_threshold_comment',
          '#settings' => 
          array (
            'flag' => 'aplauz',
            'number' => '1',
            'operator' => '>=',
            '#argument map' => 
            array (
              'object' => 'comment',
            ),
          ),
          '#type' => 'condition',
        ),
      ),
      '#actions' => 
      array (
        0 => 
        array (
          '#weight' => 0,
          '#type' => 'action',
          '#settings' => 
          array (
            'points' => '10',
            '#argument map' => 
            array (
              'user' => 'flagging_user',
            ),
          ),
          '#name' => 'userpoints_action_grant_points',
          '#info' => 
          array (
            'label' => 'Grant points to a user',
            'arguments' => 
            array (
              'user' => 
              array (
                'type' => 'user',
                'label' => 'User',
              ),
            ),
            'module' => 'Userpoints',
            'eval input' => 
            array (
              0 => 'points',
            ),
          ),
        ),
      ),
    ),
  ),
  'rule_sets' => 
  array (
  ),
)

It would be greatly appreciated if someone can help me with this, cause im struggling with this issue for very long time, and I had no other choice than to post here and ask help from you guys.

Comments

quicksketch’s picture

Category: feature » support
Status: Active » Closed (fixed)

The Rules integration is not supported by the maintainers of Flag module, so you might be on your own here. Considering there have been no responses in several months, I'm closing this issue. Please only reopen if submitting a patch to correct/add functionality to the Rules integration, since I don't test or even use Rules.