Hi all,
This is the first module/snippets I've written so thought I'd start off simple!

(I can't take credit for all the code, I picked up a thread on the Etomite forum and decided to finish it off)
Version 3 of the Poll Module/Snippets is now available.For those who are upgrading from version 2 and didn't experience any problems with the install, please just update your voting snippet.Demo URL: http://www.immerse.me.uk/index.php?id=4Installation and Setup guide:1) Download and extract the PollModule.zip file.
2) Create a new module and insert the text from pollmanager_module.txt.
3)
Important: Run the module now. This will install/update the database tables.
5) Create two new snippets and insert the text from the pollresults_snippet and pollvote_snippet text file into them.
6) Add the poll.css to your existing stylesheet (or any other way you choose to include it on your page) - you can edit the CSS to suit your needs.
Usage:The Poll Manager Module allows for polls to be created/updated/deleted. The two snippets allow for the results and voting to be added to your site.
Example Snippet Usage:Please ensure that if you set a redirect page that the page is published. Thanks jwtyler for catching thisThe following would display the results of the poll with id=1 and rounded percentages:
[!pollresults? &pollid=`1` &decimal=`0`!]
To display the voting options for the same poll and redirecting to the document with id=1 (eg. use this option to redirect to a results page) with cookie logging enabled:
[!pollvote? &pollid=`1` &redirect=`1` &onevote=true &ovmessage=`You can only vote once` &resultsbutton=true!]
ChangesVersion 3:1. Results Button now shows when the parameter is set.
2. Corrected a minor problem in the $onevote code.
3. $ovmessage will now work when parameter is set - before, it would always use the default message.
4. Adjusted the SQL in the module so should work on 3.23* MySQL installs.
5. Some implementations may not have parsed the 'action' of the voting form correctly - this now uses a placeholder so shouldn't cause any issues from now on.
Have fun, Garry
MOD NOTE: Zip removed. Now in Repository:
http://modxcms.com/Polls-Module-526.htmlStats for posterity:
PollModule_v3.zip (7.59 KB - downloaded 295 times.)