+-------------------------------------------------------+ | tgcSimplePoll | | | | small but powerful way to build a voting booth, | | easy to integrate into existing sites | | | | Version: 2.0.0 | | | | Author: Carsten Lucke | | Email: luckec@tool-garage.de | | Website: http://www.tool-garage.de | +-------------------------------------------------------+ Copyright (c) 2002-2004 by Carsten Lucke This program and all associated files are released under the GNU Lesser Public License, see lgpl.txt for details! Introduction: ============= This brief introduction should help you to get the poll running as fast as possible. Installation: ------------- (1) Create a database where you want to install the poll-tables in. If you have already done so, you're done here. (2) Edit config/config.php in the line where you see something like: define('SP_DB_DSN', 'mysql://tgc:tgc123@localhost/tgcSimplePoll'); Set this pattern to the appropriate values for your database connection. (3) If you want the install-script to set a prefix in front of the poll-tables edit the following line in /config/config.php to fit your needs: define('SP_DB_TABLEPREFIX', ''); (4) Copy the files to your webserver (5) Open install.php in your browser to install the tables. Now you should be able to log in to the admin-area. Password: admin Username: admin The first thing you do should be changing the login-data. (6) You're ready for a first run now. Usage: ------ There are two ways to use the poll. You can display the admin-area or the polls. Look at admin.php and index.php how to do this. Advanced stuff: =============== Localized Language-Files: ------------------------- From this version you can have your poll in a language you wish. All you need is to go into the data directory and create a file for your language. German and English come with this script. To build your own language-file take the default.ini and copy it to one that describes your language best. For example dk.ini for Denmark. Now translate all the English stuff (that's default) to your destination language. To use your language you have to tell tgcSimplePoll, which file to use when instantiating it. $settings = array( 'language' => 'dk' ); $poll = &new tgcSimplePoll('myPoll', $settings); $markup = $poll->run(); Multiple polls in one single page: ---------------------------------- You can have multiple polls in a single page. To do so, just create as much object's you need. The only thing to do is giving them different ids: $poll = &new tgcSimplePoll('myPoll_1'); $markup = $poll->run(); if (PEAR::isError($markup)) { echo 'Poll error: ' . $markup->getMessage(); } else { echo $markup; } $poll = &new tgcSimplePoll('myPoll_2'); $markup2 = $poll->run(); if (PEAR::isError($markup2)) { echo 'Poll error: ' . $markup2->getMessage(); } else { echo $markup2; } See the API documentation on tool-garage.de for further information. Have fun with a lot of polls!!!