I have 2 node types - questions as parents and answers as referencing nodes. I would like to display flags only for nodes created as an answer to a given question. This should be only selectable by the author, not everyone.(same as stackoverflow best answer) So far I found out that I can manually place in node-answer.tpl.php the link using:
<?php print flag_create_link('select_answer', $node->nid); ?>
This will print the flag on every answer node, but I would like it to be selectable only by the author of this particular question. (basically it is the same functionality as stackoverflow - author can select best answer) There is an API function
flag_create_link($flag_name, $content_id), so I need to set
$content_id to point to all referenced answers for a given question.
ANy idea how can I do it? Any advice appreciated.