Democracy Read Me File
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 <?php jal_democracy(10); ?> 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.
Installation
- Put the ENTIRE folder labeled "democracy" into your plugins folder (/wp-content/plugins/). There should be 4 files: democracy.css, admin.js, democracy.php, and js.php
- 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.
- Add <?php jal_democracy(); ?> where you want the poll to appear, typically in your sidebar.
- Go to Admin Panel > Manage > Democracy to add and edit polls. You'll need to activate the default poll if you want it.
OPTIONAL:
- Open the democracy.php file and twiddle with the settings at the top.
Upgrading
All versions previous to Democracy RC 1 MUST follow these simple upgrade instructions:
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
- Question:
- Can you explain step 3 in greater detail?
- Answer:
- My pleasure. Most people will want the poll to show up in their sidebar. Most sidebars for WordPress are unordered lists (<ul>s) and every section of the sidebar has its own <li>. Usually, the code you'll want will look like:
<li><h2>Democracy</h2>
<?php jal_democracy(); ?>
</li>
Alternatively, you can set the poll question to use <h2> (or anything else). Like this:
<li>
<?php jal_democracy(); ?>
</li>
And then change the options at the top of the democracy.php file. Change $jal_before_question to '<h2 id="poll-question>'; and $jal_after_question to '</h2>';
Note: **NEVER** put <ul> tags directly around <?php jal_democracy(); ?>. Your code will be invalid, and it could cause problems with display. - Question:
- The Democracy admin panel clashes with another one of my plugins
- Answer:
- This is a bug in WordPress that has been fixed by 1.5.1.3 . I highly recommend you upgrade to the latest version of WordPress.
- Question:
- How do I change the looks of the poll?
- Answer:
- Edit the CSS file. If you'd like to change the colors of the results bars, you'll need to change the border-bottom and background of .democracy-choice. If you need something specific, you can ask me.
- Question:
- It does not show status bars, it doesn't load any css or javascript, and there's no AJAX communication.
- Answer:
- This means your theme does not include a vital hook that plugins use to add information to the <head> of your page. To check, View Source of a page and see if there is anything that says <!-- Added By Democracy poll.... If its not there, you need to edit header.php of your theme (/wp-content/themes/**YOURTHEME**/header.php and somewhere in the <head>, add this code: <?php wp_head(); ?> . This code basically allows Plugins to add css and javascript references very easily. MOST themes include it, but some neglect to.
Contact Developer
I am always eager to help you with your problems involving this plugin. Chances are there's something wrong with my code and by telling me you are probably helping other users too.
* Email:
jalenack@gmail.com
* AIM:
Harc Serf
ICQ:
305917227
Yahoo:
jalenack
MSN Messenger:
jalenack@hotmail.com
* Online Contact form:
http://blog.jalenack.com/contact.php
* = Most likely venues for a quick response
Tags: poll democracy ajax wordpress plugin
Contributors: jalenack
Andrew Sutherland
http://blog.jalenack.com
Some hat tips by...
Denis de Bernhardy
http://semiologic
Original Release: June 28, 2005
This release: August 2, 2005
Version: 1.0 RC 1
Released under the CC GPL 2.0
http://creativecommons.org/licenses/GPL/2.0/




