|
Cookbook /
Rye VotingSummary: Voting with several option and graph bars
Version: 0.7 (2007-07-14)
Prerequisites: pmwiki-2b44
Last-tested-with: 2.1.27
Status: stable
Maintainer:
Votes:
GoalThis cookbook alows voting with:
You can test the script out here. For UsersInstallation
include_once("
Administrative Tasks/OptionsOut of the box the script only needs read privileges to vote. If you want to restrict this set in your Activate (1) / deactivate (0) the IP/Cookie Check, (default: 1): $RyeVoteRestrictions = 0; Hide vote after voting (works only with $RyeVoteRestrictions = 1; (default: 1) $RyeVoteHideAfterVote = 0; Standard DB Page (default: Site.RyeVoteDB): $RyeVoteDBPName = Page.Name; Message after vote (instead of vote form, default: "Thank you for your opinion! You have already voted."): $RyeVoteAfterVoteMsg = "Sorry, no second chance."; Color of bars customizable (default: "siver"): $RyeVoteBarColor = "#00ab00"; Bar width in output customizable (default: "4"): $RyeVoteSizeFactor, "1"); UsageThe Input FormThe script uses the PmWiki Forms features. A vote looks like this:
Show output(:ryevote db=Page.Name votename=thevotename:)
Notes and HintsOther elements in the formYour can use other elements in the input form. To show text for example:
See Forms for further examples. No edit after first votingAs soon as the first person voted you can't add one more question in the form or another item. If you want to do this, you have to edit the data page (default: Site.RyeVoteDB), too. or you have to delete all voting data collected so far. Be carefull, on the data page could bo the data from more than one voting! CommentsBugsBug, Division by zeroI got this error: Warning: Division by zero in /cdcv2/www/droenologie/html/floxwiki/cookbook/ryevote.php on line 137 Flo (29th Jan 2006) Right after the install, after the first vote, occasionaly?
I got it right after I wrote the poll, before the first vote.
Bug, Grey BarsI have this working in my wiki but I only seem to get two grey bars of the same size for the graphical output. I have tried this on your site and get the same thing too. Is this correct as I was expecting the bar length to represent the number of votes cast Dav Bacci, 23rd Jan 2006 It is a problem of IE, Firefox hasn't it. flox, Jan 2006 I changed the script a little bit and uploaded a new version 0.4.2. There also was a glitch with Opera and I hope it will fix the IE problem too (can not test it here). - Schlaefer January 23, 2006, at 03:18 PM
Tried the version, but same problem as before: Sometimes if someone vote, it is destroyed. I have to use the History.... Flo, January 26, 2006
I tested with IE6, but could not reproduce the problem. If the corruption occurs, please post the destroyed code here. - Schlaefer January 27, 2006, at 03:23 AM
(:input form "http://droenologie.cybton.com/drdoswiki/pmwiki.php/Main/ HomePage?action=ryevote (:table:) (:tableend:)
But only at my first Wiki. Other hasn't this problem. I will reinstall it, maybe it helps. Flo Feb 11, 2006
I think I have figure out the reason why it's not working in IE. The problem is the _wiki formatting_ in It works with
the HTML output is
>>> this works _not_ >>>\\
<p><br/><br/>\\
</p><h1>Sometext<span style='display: block; background-color: \\
silver; color: silver;'></span></h1>\\
<table ><tr> ...
I think there is no reason for <span style='display: block; background-color: silver; color: silver;'></span>. Does somebody know how to fix this in ryevote.php?
cg, 2006-08-05
More Bars IssuesI'm having the same issue where the bars are the same size. For some reason, it appears that the width request is not being translated by the PmWiki engine. The line: $out .= "(:cellnr:)".$names[$k]."\n(:cell:)%ryevotebox width=".$upbound."px% = \n"; Is interpreted as: <table ><tr><td valign='top'> Yes
</td><td valign='top'><span style='display: block; background-color: silver; color: silver;'>.</span>
</td><td style="color:gray;" valign='top'> (2/100%)
</td></tr><tr><td valign='top'> No
</td><td valign='top'><span style='display: block; background-color: silver; color: silver;'>.</span>
</td><td style="color:gray;" valign='top'> (0/0%)
</td></tr></table>
Kurt Devlin February 21, 2007, at 04:17 PM Squelch multiple votes from one userAs far as I tested the script I could not see suppression of multiple votes made by one user. A fool can easily manipulate the votes by clicking multiple times same button. It should be possible to suppress ist either by use of cookies and/or user-IP storage.
If I find some time, I'll try to add it. -Armin Autovoting possible?I am interested to learn about the possibility of including two different voting opptions in every page or section (splitsection) when they are created without the user to insert one of the kind. Is such an automation possible? New to PMwiki, so be explicit. Thanks! Sichendra Look if edit templates fit your needs. - Schlaefer January 23, 2006, at 03:38 PM
Local AnchorsWhen there are multiple votes on a page, each vote returns you back to the top of the page, which gets annoying. It can be solved by adding local anchors to the form as follows. Twiki PollPlugin+PeerPlugin Equivalent?Is there anything like the twiki.org's PollPlugin and PeerPlugin equivalent in PMwiki? Or could the existing voting scripts could be improvised to that (twiki.org's voting scripts) standards? Sichendra For DevelopersThere is a easy way to hook in your own output drawing code in the script. ReleasesSee inside the script file. : Saving to database?is there a possibility to have the return result be save to mysql database? |