Poll Manager

Poll Manager allows you to manage polls that you would like to have running on your website.

To access Poll Manager:

Click the Poll Manager icon in your Control Panel.

The first time you access Poll Manager, you will need to install it by clicking Install Poll Software.

You will receive a confirmation that the request will be completed within ten (10) minutes.

For detailed instructions and commands for setting up a poll, click on Instructions and Documentation.

Getting Started
To manually add a new poll:
Click Allow a New Poll.
Copy the following HTML code into the page the poll will be on: <p>WebSite Poll: Yes, No, or Maybe</p>
<form action="/cgi-bin/poll.cgi" method="post">
<input type="hidden" name="poll_id" value="yesorno" />
<input type="hidden" name="poll_title" value="Yes, No or Maybe" />
<input type="hidden" name="redirrect" value="http://yahoo.com" />
<input type="radio" name="vote" value="Yes" /> Yes <br />
<input type="radio" name="vote" value="No" /> No <br />
<input type="radio" name="vote" value="Maybe"> Maybe <br />
<input type="submit" value="Vote!" />
</form>

Put the following code into your website to view the results:

<a href="/cgi-bin/poll.cgi?poll_id=yesorno"> View Poll Results </a>

If you use Server Side Includes(SSI), you may use the following in your website.
<!--#include virtual="/cgi-bin/poll.cgi?poll_id=yesorno&ssi=1" -->

Each time that you decide to change the poll_id to start a brand new poll, you must re-click Allow New Poll.
Once you get the hang of creating and displaying polls, try changing the colors of the results by creating a CSS style sheet and changing the bar_color attribute, making an SSI based page to display the results, and also displaying links to random past polls. All of these are explained in detail in the documentation section above.

To add a new poll using the Poll Wizard:
Click Poll Wizard from the Poll Manger's main page.
You'll be asked the question that the poll will ask, how many possible responses you'd like to include, and the URL to which you'd like to redirect users after they vote. Click Continue when finished.
Enter the answers to your poll, the URL to a stylesheet (if applicable), and the color you would like to use for the poll's progress bar. Click Continue when finished.
The wizard will generate all of the code snippets you will need to display the poll, its results, and link to random previous polls (if applicable).

Configuring the form method

The form method determines how your form (your poll) will interact with the server. It must be post, for your poll to work. The opening line of your firm will be:

<form action="/path/to/poll.cgi" method="post">

Configuring the Poll Information

name="poll_id" type="hidden"

REQUIRED Value will contain the id of the current poll. This value will not be seen by users.

name="poll_title" type="hidden"

REQUIRED Value will contain the poll's title. This value will be displayed to users, and should be descriptive of the poll.

name="redirrect" type="hidden"

OPTIONAL Value will contain a fully qualified URL to which the user will be directed to after voting.

Configuring the Voting options
type="radio" name="vote" (at least 1)

REQUIRED This will be the means by which the users vote. The values will contain the answer to the poll. These will be displayed in the results page, and should be entered as you would like them displayed.

Example:
<form action="/cgi-bin/poll.cgi" method="post">
<input type="hidden" name="poll_id" value="yesno">
<input type="hidden" name="poll_title" value="Yes, No or Maybe">
<input type="hidden" name="redirrect" value="http://yahoo.com">
<input type="radio" name="vote" value="No"> No <br>
<input type="radio" name="vote" value="Maybe"> Maybe <br>
</form>

This form can be placed anywhere on your site, in any html page, and can be formatted however you like.

Displaying Results
To Display the Results of Your Poll, method 1:
Create an HTML document that contains your content and has a .shtml extension. This extension tells the web server to parse includes and display the results of the include.

In this example, "results.shtml" will be the example SHTML document.

<html>
<body>
<div align="center">
<!--#include virtual="/cgi-bin/poll.cgi?poll_id=yesno&ssi=1" -->
</div>
</body>
</html>

The above example will display the poll identified by poll_id. In this case, it is our aforementioned yesno poll.

To display results via SSI (Server Side Includes), you must also give the script the parameter ssi=1 or ssi=yes, as shown above.

The default color of the results bars is black. This can be changed by also passing in the "bar_color=COLOR" parameter. For example:

<!--#include virtual="/cgi-bin/poll.cgi?poll_id=yesno&bar_color=yellow&ssi=1" -->

The available colors are as follows:

black
blue
brown
cyan
green
grey
orange
red
yellow
Additional colors can also be added. To do this, create a jpeg image that is one pixel X one pixel, of any color you choose. Upload it to the directory you specified as "$image_url" (yourdomain.com/images by default), in the format of YOURCOLOR_pix.jpg. If you create a 1x1 px. jpeg of the color chartreuse, you would name it "chartreuse_pix.jpg". Then, you can use that color.
<!--#include virtual="/cgi-bin/poll.cgi?poll_id=yesno&bar_color=chartruse&ssi=1" -->

To Display the Results of Your Poll, method 2:
If you do not wish to use SSI, you can make a link directly to the current poll. Simply use this format:

<a href="/cgi-bin/poll.cgi?poll_id=yesno"> View Poll Results </a>

Again, you can pass in the bar color, and the css style.

<a href="/cgi-bin/poll.cgi?poll_id=yesno&bar_color=orange&css=poll_yellow.css"> View Poll Results </a>

When displaying the results this way, 25 random past polls will also be generated in a menu on the left-hand side of the page.

To Display Past Polls:
You can also include a list to past polls. Use the same method of including the "include" line, but use the following variables:

<!--#include virtual="/cgi-bin/poll.cgi?past_polls=1" -->

The past_polls variable will be given in this case, with a value of "1" or "yes".

This will link to the built-in function of displaying the poll results. With just the above link, the default colors format will be used. You can, however, give extra options to further customize the displayed results.

<!--#include virtual="/cgi-bin/poll.cgi?past_polls=1&bar_color=red" -->

Use the above include to link to results that display a red bar.

Note: For any SSI included poll data, you will need to do all the formatting within the page. Simply the raw html will be displayed with the includes, so putting them within a table or div would be a lot prettier.

CSS Support

You have the option to either modify the default CSS style, or copy it and modify the copy. It is best to copy it and modify it so as to not loose the original copy if an error is made

Two CSS Styles are provided. The default black and white style, and a more colorful red and yellow one.

To use a custom CSS when displaying the links to past polls, as described above, try the following:

<!--#include virtual="/cgi-bin/poll.cgi?past_polls=1&bar_color=red&css=poll_yellow.css" -- >

The above will create the links to the poll data that will be displayed using red bars, and the poll_yellow.css style sheet.

For the sake of example, you can use the following for the default style, even though it is not required:

<!--#include virtual="/cgi-bin/poll.cgi?past_polls=1&bar_color=red&css=poll_default.css" - ->

User configurable variables within the script
This requires that you edit the script itself

# Full Unix Path to directory where the data files will be stored (not
# web accessible == better)
#
#
$data_dir = '/home/YOUR_USERNAME/poll_data';
# Absolute URL to grab images from (leave blank for root web '/')
#
#
$image_url = '/images';
# Absolute URL to grab CSS files from (leave blank for root web '/')
#
#
$css_dir = '';
# List of referers that are allowed to post to polls
#
#
@referers = (
"yourdomain.com",
"www.yourdomain.com",
"your.other.com",
"your.other.other.com"
);
# When the browser blocks the referer, do we want to allow a vote?
# 1=yes 0=no
#
$allow_empty_ref = 0;
# If set to 1, this value will disallow the creation of a new poll unless
# a file named "create.allow" is placed into $data_dir. This file should
# be created/uploaded whenever a new poll needs to be made. It will
# automatically be removed upon creation of the poll.
# secure = 1, not = 0
#
$more_secure = 1;

If $more_secure is set to 1 (one), then a poll cannot be created unless you first click the Allow a new poll button in the Poll Manager. Once a vote is posted to the poll, you will again be unable to create a new poll until the above step is repeated. This redundancy prevents malicious users from creating an unlimited number of polls. There are some other checks for naughty people of this type, but all of these can be bypassed rather easily.