![]() Unfortunately I would not be able to answer how you get this flag via the rules UI. ![]() Every time a user visits a profile, grab the flag and +1 to the count field. ![]() You could add a count field to the flag entity (a numeric field). When a user visits the profile of a user for the second time, I want to update this flag by updating the timestamp of the flagging and adding the new referer information to the flag. This flag has a computed field, Referer, which stores the value of $_SERVER upon flagging. There seems to be no way to fetch the flag by its endpoints. Since I'm using Flag 3.x in which flags are entities, I tried using the Fetch entity by property action in Rules to fetch the flagging, but in this case the only property I can choose to select is the value of the Referer field, which is not helpful. I can add the Unflag a node action and then the Flag a node action, but this will destroy my previous flag and replace it with a new one since I want to track referer information over time, this is not a good solution. My question: how can I fetch the previously applied flag in rules so that I can update the timestamp and re-save it?įlag provides a rules action Fetch user flagged by user, but this does not help because this returns an array of users, not the flagging, which is what I want to update. This rule is triggered correctly however, I don't know how to get the previous flag (the flag applied when the user visited the profile for the first time) in order to update it. Actions-> How do I fetch and update the flag?.Condition 2: User is flagged ( on behalf of ).But on the second visit and thereafter, I want to update the flag that was flagged on the first visit. When a user visits another user's profile, a rule is triggered that automatically flags the visited user on behalf of the visiting user.įlagging the user on the first visit is no problem. I am using a user flag, Visits, to track each user's visits to other user's profiles.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |