By bowenzbiz on
I added a cck field to content profile named field_scores, and want to use rule module to do sth. to update this field +1.
I tried to use 'populate a field', but I don't know how to write the php code to specify the field value.
return array ( 0 => array ('value' => '???') );
any help??
thanks.
Comments
Not sure about the Rules
Not sure about the Rules module, but try http://drupal.org/project/computed_field
Thanks, Mark. I had
Thanks, Mark.
I had considered about the computed_field module, but it cann't fulfill my requirement.
Because I did not store all the history in the database, and they will be purged sometimes.
I just need a trigger to add 1 to original value.
_
Try:
Thanks. WorldFallz But it
Thanks. WorldFallz
But it still doesn't work.
_
"it doesn't work" doesn't tell me anything. I tested it, and it works on my dev system with a cck integer field named "field_scores".
Thank you for your help.
Thank you for your help.
Solved.
I use token code below.
Unfortunately. $node->field_scores[0]['value'] still doesn't work.
It seems that $node->field_scores[0]['value'] === 0. $node is not recognized.
Anyway, thank you very much.
_
odd-- I have full access to $node in my rule. Oh well, as long as it works.
happy to help ;-)