I would like to make a rule,

so when a user views a node ie. node 2

the user is granted a new role.

Can someone tell me how to do this step by step

Comments

If you know how to create a

If you know how to create a custom code, this is fairly easy. just implement hook_nodeapi() filter $op to 'view', check if the node is the one your concerned of and then assign the roles to user.

If you prefer using the rules module.. you can watch a video here: http://gotdrupal.com/videos/drupal-workflow-automation

I dont know how to use hooks

I dont know how to use hooks and the such, if you tell me that would be awasom, if not could just please tell how to set the condition for the rule up. I am actually fairly good at drupal but i cant get this darn thing to work.

Please any advice to guide me would be awasom, if you can tell how to set up a hook, this would open many door for me.

Using the rules module the

Using the rules module the following should work.

Create a new rule for "Content is going to be viewed"

Add a "Numeric comparison" (under "Rules"), set value 1 to <?php print  $node->nid?>, operation to "Equal to" and value 2 to 2.

Add an action for "Add user role (under "User"), set "User whos roles should be changed" to "Acting User" and "Select role(s)" as appropriate.

THANK YOU THANK YOU THANK YOU

It worked like a charm, you are the man thanks so so so so so much. I am now able to continue with my work..
You take good care. and keep truckin :).

Thanks

nobody click here