Learn about DokuWiki
Learn about DokuWiki
Compatible with DokuWiki
Since Dogiemucs doodle2 plugin did not see any changes and fixes since 2011-01-20 I encountered various problems in using his plugin. There seems to be no activity on github at all so I decided to adopt this plugin. The code of this plugin is widely copied from Dogiemucs code but contains fixes and improvements.
With this plugin you can offer your visitors a poll, where each user can vote for one (or more) choices. This is a unification of the doodle, vote, and userpoll plugins. I tried to implement all their features into one plugin:
<doodle title="What do you like best?" auth="none|ip|user" adminUsers="user1|user2" adminGroups="group1|group2" voteType="single|multi" closed="true|false" > * Option 1 * Option 2 **some wikimarkup** \\ is __allowed__! * Option 3 </doodle>
titleis also used as “key” for the plugin's data file under
adminUsersand members of the
adminGroupscan always edit any entry
voteType=“single”shows round checkboxes where only one can be chosen
voteType=“multi”lets users check any number of square boxes
closed=“true”is set, then users cannot vote anymore. The result of the vote will still be shown.
Only the title and at least one option are required. Do not change the options and their order, after the first vote has been casted! You may move the whole doodle to another page, whenever you want.
By default anyone can vote, even multiple times under different name. In this mode users cannot change their vote, once they submitted it.
You can prevent multiple votes, by setting
auth="IP". Then users will be authenticated by their IP address1).
If you set
auth="user" then only registered and logged in users are allowed to vote. This has the advantage, that users later on can edit their vote, i.e. change their mind. In this mode, the users fullname and login name are automatically set for the vote.2)
The doodle's data is saved in
<dokuwiki>/data/meta/title_of_vote.doodle. The filename is the (masked) title. This has the advantage that you can move your doodle to another page, without losing the data.
Each of the green success icons has a popup title, that shows when this vote has been casted.
As both plugins were not maintained any more I copied wide parts of the code to improve the plugin and bring it back to life.
Could the doodle accept Replacement patterns such as @DATE@ or @ID@? This would vastly increase usability when created via a Namespace Template. Alternatively, an option to save doodle masked below the namespace it was created in would work as well.
auth="user". Now user “Peter” logs in. But someone (maybe anyone) may already have voted with the name “Peter”. In this case, this becomes Peters vote, and he might change it.