Flag 6.x-1.3 and Views 6.x-2.11

I created a view that shows a type of content (node) and users who have voted this node. I want (as the administrator) to add in that view a link to remove other users' flags. More specifically, in Flags tables (DB):

# flag_content: remove the lines of that user for that node
# flag_counts: subtract one unit to "count" field for that node

I don't want to reset all the flags for a node, but I want to remove a user's flag on a particular node.

<?php
print var_export($data, TRUE);
?>

stdClass::__set_state(array( 'nid' => '4', 'node_title' => 'node 1', 'users_flag_content_uid' => '3', 'users_flag_content_name' => 'user', 'flag_counts_node_count' => '2', ))

I don't know php, can you help me, please?

Comments

Alcaparra’s picture

The Flag API (PHP): http://drupal.org/node/305086#flag-links and http://api.lullabot.com/flag

I tried:

<?php
echo '<a href="' . flag('unflag', 'nid', $account = 'users_flag_content_uid', $skip_permission_check = TRUE) . '">Unflag</a>';
?>

but nothing happens. Do you know what is the problem?