The Poll extension for the Yii framework allows you to create custom polls for both anonymous and authenticated users to vote on.
This has been tested with 1.1.8, but should work with any version.
You must also:
*An example of this type of setup is explained here: Building a Blog System using Yii
The next step is to install the database schema located in '/data/poll.sql', modifying the table prefixes as needed, as well as the foreign key constraint referencing the user's ID.
return array( ... 'import' => array( 'application.modules.poll.models.*', 'application.modules.poll.components.*', ), 'modules' => array( 'poll' => array( // Force users to vote before seeing results 'forceVote' => TRUE, // Restrict anonymous votes by IP address, // otherwise it's tied only to user_id 'ipRestrict' => TRUE, // Allow guests to cancel their votes // if ipRestrict is enabled 'allowGuestCancel' => FALSE, ), ), );
The Poll extension has the basic Gii-created CRUD functionality, as well as a portlet to load elsewhere.
To load the latest poll:
To load a specific poll:
$this->widget('EPoll', array('poll_id' => 1));
February 9, 2012
October 18, 2011
October 17, 2011