New Poll Package! |
[eluser]Iverson[/eluser]
I've had to do polls for my past couple of projects so I decided to write a quick package for it. The only caveat is that it requires DataMapper. I'm currently writing a standalone that will use CI's native DB lib but for those who want it, here it is. I'm also going to write a function to display the question and its answers also. This isn't meant to be a high powered polling system but a quick solution for simple polls. Feedback is still welcome. Download / User Guide Includes: - Example controller with all the features - Database schema sql file - Required Models & Libs (Including DataMapper) Functions: create($question) - creates a new poll add_answer($answer) - adds an answer to the poll object vote($answer_id) - adds a vote to an answer reset_votes($poll_id) - useful function to reset the votes for a poll get_results($poll_id) - returns an associative array with the key being the answer's id and the value being the total amount of votes for that answer Configuration (application/config/gpool.php) $config['vote_span'] - Number of seconds a user must wait to vote again $config['max_votes'] - Number of times a user can vote $config['max_votes_message'] - Message if user has exceeded the $max_votes variable $config['voted_already_message'] - Message if user has voted within the $vote_span amount of seconds $config['success_message'] Message if user's vote was successful $config['save_error_message'] - Message if we tried to save the vote but was unsuccessful $config['no_answer_message'] - This should never happen Download / User Guide
[eluser]Dam1an[/eluser]
[quote author="benfike" date="1245010589"]How to use it?[/quote] Did you even look at the user guide for it? It all seems simple enough
[eluser]wiredesignz[/eluser]
Good work Iverson. I'm always impressed by contributions like this that show a lot of work has been done making it presentable. (I should take a hint)
|
Welcome Guest, Not a member yet? Register Sign In |