开发者

Drupal - Flagging nodes on behalf of another user(programmatically)

开发者 https://www.devze.com 2023-01-24 07:56 出处:网络
I have a custom module which allows a user to invite friends to see his/her favourite(flagged) nodes.

I have a custom module which allows a user to invite friends to see his/her favourite(flagged) nodes.

Upon the invitation/registration.. I want to be able to duplicate the (inviter)users flags for the new(invited) user.

i read http://drupal.org/node/305086 and it says to use:

开发者_如何转开发function flag($action, $content_id, $account = NULL, $skip_permission_check = FALSE)

however regardless what value i put in for $account the new flag is not created for the new user.

can anybody assist please!


$account must be a user object, implemented with $account = user_load(array('uid' => 123));. Are you doing this?

0

精彩评论

暂无评论...
验证码 换一张
取 消