lfpoll is a voting program which can easily be internationalized.
It can also be used for several different questions at the same
time.

lfpoll is written perl. It does not require any special library.
It needs perl only.

Installation:
-------------
Edit cgi-bin/lfpoll and change the values of $url (http address
of the program), $img (http address of the directory with the images),
$dbdir (directory where the poll data files are stored).
This directory must at least be writable for the process under which 
the web-server is running (chmod 1777 or chmod 777 is of course the
easiest solution).

Setting up a question:
----------------------
Create in the $dbdir directory a file called XX.txt where
XX is the number of the opinion poll (voteid parameter, lfpoll 
can handle several different polls at the same time).
This file needs to be writable for the process under which the
web-server runs (usually nobody). Chmod 666 *.txt will of course always
work.
Here is an example:
Take the included box10.poll.html file and change the ACTION="http..."
Then think about a question and a number of possible answers.
E.g "Which color do you like best?"
Possible answers are: green blue red

The input form must then look like this:
    <INPUT TYPE="radio" NAME="sel" VALUE="green">I like green<BR>
    <INPUT TYPE="radio" NAME="sel" VALUE="blue" CHECKED>I like blue<BR>
    <INPUT TYPE="radio" NAME="sel" VALUE="red">I like red<BR>

The parmeters behind the VALUE must exaclty like that
appear in the XX.txt file.
What this XX is depends on the voteid which is defined in the next line:

    <INPUT TYPE="hidden" NAME="voteid" VALUE="42">
    <INPUT TYPE="hidden" NAME="lang" VALUE="1">
    <INPUT TYPE="submit" VALUE="vote!">

This means you need a 42.txt file with permissions 666 in $dbdir
and the format of the file must be as follows:
1~green~
4~blue~
3~red~

This file consists of columns seperated by "~". The first column
is the vote count for this question. The following colums contain
the answer strings specified behind the VALUE parameters of the
questions. So, green, blue and red in this case. It is important
that the strings are exactly equal to what is written
on the
<INPUT TYPE="radio" NAME="sel" VALUE="...
line.

You can write e.g the following sentence:
<INPUT TYPE="radio" NAME="sel" VALUE="orange is better">I like orange<BR>
The the 42.txt file looks then like this:
1~green~
4~blue~
3~red~
1~orange is better~

The value of the "lang" parameter determines in which column the
strings are to be found in the 42.txt file. 1 means first column
after the vote counts.
You count e.g have the following possible answers in german:
grn, blau, rot, orange ist besser.
If you gave german the language number 2 ( NAME="lang" VALUE="2" )
then the 42.txt file would look like:

1~green~gr&uuml;n~
4~blue~blau~
3~red~rot~
1~orange is better~orange ist besser~

All colums in the file must be filled. You can not use
language number 4 without having answers for languages 1,2,3 in the
file. The currently supported languages are:
English =1
German =2
French =3
Dutch =4

Please note also the strings in the 42.txt file are the ones
displayed in the answer. Therefore it makes sence to put some longer 
string like "orange is better"

The XX_lasthost.txt file
------------------------
This file is automatically generated in the $dbdir directory.
(the directory must be writeable for the process under which the
webserver runs, usually nobody)
It contais the IP address of the one who voted last. lfpoll uses this
to check that somebody does not vote repeatedly.
The rules are: You can vote again after 15 min or if sombody else
has voted in between. This is because many people use proxy servers
and then the lfpoll would think that these users are all the same
and would not let them vote.
If you want to vote for testing purposes several times then
you need to overwrite the XX_lasthost.txt file:
echo "something" > 42_lasthost.txt

Adding new languages
--------------------
To add a new language in lfpoll means just adding a new
voteresulthead_ chapter at the end of the file.
So edit cgi-bin/lfpoll and search for __ voteresulthead_1 __
copy it to a new __ voteresulthead_X __ and translate it.
X is the next highest unused language number

==================================================================
lfpoll was written by Guido Socher <guido.socher@linuxfocus.org>
Copyright: GPL
