Closed (fixed)
Project:
Flag
Version:
5.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
6 Sep 2008 at 13:54 UTC
Updated:
21 Sep 2008 at 14:22 UTC
Case scenario: The node author can set a global flag, like "Help wanted", to signal others that he welcomes input on the node content. The flag itself is shown only to the node author. And if the node has been flagged, it's supposed to output something like "The author welcomes your help." -- if it's unflagged, nothing is shown.
I did dig through the available documentation but was unable to find any hint on how to accomplish this. So I was wondering, if there's a way to use the Flag module for this purpose.
Kind regards,
-- jan
Comments
Comment #1
mooffie commentedUntil #285237: Ability to disallow a flag/unflag operation is settled, you have two options:
1. Tick only "show checkbox on node form" (in the flag settings page). Only the author will see it because only he can edit the node. Don't tick "show link on page" or "show link on teaser".
2. You can place the link on the page yourself. Wrap the call to flag_create_link() in a PHP condition that checks whether the current user is the author of the node.
Do the following in 'node.tpl.php':
This is explained in a new handbook page:
The Flag API
Comment #2
neurer commentedWorks like a charm, cheers!
PS. Wasn't aware that the handbook had undergone such huge changes since I last checked a week ago or so -- thanks for the hint.
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.