I want to check if user has downloaded the file so afterwards I will allow him to post a review. To do that I want to flag the node after user download file, flag the node and allow flagged node to be commented. I have a script:
global $user; $flag = flag_get_flag('downloaded'); $node = node_load(arg(1)); $flag->flag('downloaded', $node->nid, user_load($user->uid), TRUE);
but I don't know how to make that event to occure when clicked on link. Link is in
Does anybody have an idea how to achieve my goal? I will be so grateful for any answer.