=== Democracy === Tags: poll,democracy,survey Contributors: jalenack Andrew Sutherland http://blog.jalenack.com Original Release: June 28, 2005 This release: September 26, 2005 Version: 1.2 Released under the CC GPL 2.0 http://creativecommons.org/licenses/GPL/2.0/ == Features == * Uses AJAX for sending and loading the results, but is fully accessible in non-js environments * Complete admin panel * When someone votes, they receive a cookie with what poll they voted in and what their vote was. It also logs their IP, so the same person can't vote twice even if they delete the cookie * Allows users to see current results without voting. Also, detects if there are no votes and announces it... * After voting, the choice you made is highlighted. * Automatic database table installation. * Displays winners of each poll in the admin panel. * Delete old polls in the admin panel. * Edit existing polls. * AJAX is compatible with IE 6, Safari, Firefox, and Opera. All the other browsers, and those with javascript turned off, are supported as well. * Select an active poll. * jal_democracy() takes poll ID arguments. Use to display poll 10. However, I recommend you use the 'activate' feature instead. * Allow your users to add their own choices. * Uses the date format you set in the Options panel for the Date Added column. * Marks which answers have been added by users, if applicable. * Has an archiving function for displaying past polls == Installation == 1. Put the ENTIRE folder labeled "democracy" into your plugins folder (/wp-content/plugins/). There should be 4 files within the democracy folder: democracy.css, admin.js, democracy.php, and js.php 2. Go to your plugins panel of WordPress in your browser, and activate Democracy. This will automatically create a table in your Wordpress database for the plugin. 3. Add where you want the poll to appear, typically in your sidebar. 4. Go to Admin Panel > Manage > Democracy to add and edit polls. You'll need to activate the default poll if you want it. OPTIONAL: 5. Open the democracy.php file and twiddle with the settings at the top. 6. Use the poll archiving function: jal_democracy_archives($show_active = FALSE, $before_title = '

',$after_title = '

') Arguments: * $show_active -> set to TRUE to show archives of ALL polls, including the current one. * $before_title -> use any html that will appear before the poll question title * $after_title -> use any html that will appear after the poll question title How to use it: Either get a plugin that will allow you to use PHP within a post/page OR (more secure) make a custom template page that will use the jal_democracy_archives function. For a tutorial, head over to http://www.chrisjdavis.org/2005/05/26/secrets-of-wp-theming-part-1/ All the code you need is . If you want to show the current poll on the same page, have a call to as well. NOTE: you can never have more than one instance of an active democracy poll in one page. == Upgrading == All versions previous to Democracy RC 1 MUST follow the instructions below. If you have a more recent version than RC 1, you can just overwrite the old Democracy files with the new ones. Delete the democracy folder in your plugins folder. Then upload the new one provided with this installation. Next, you must deactivate and reactivate the plugin. This will update the database structure to be compatible with this version. All your previous poll data will be preserved. Reload your site. Make you are not using cached files from previous versions. To make sure, visit the js.php and democracy.css file and reload them. A common error is when a person upgrades and they fail to empty their cache. This is bad because an old version of the javascript file will be communicating with a new version of the php file, and their communication could be boggled. == FAQS == 1. Can you explain step 3 in greater detail? My pleasure. Most people will want the poll to show up in their sidebar. Most sidebars for WordPress are unordered lists (