Recent Edits
[[Referendum]] is an issue voting system.
* "Referendum source code":http://sandbox.sourcelabs.com/referendum/index.phps
Essentially...
» complete change[[Referendum]] is an issue voting system.
* "Referendum source code":http://sandbox.sourcelabs.com/referendum/index.phps
Essentially Referendum is a simple [[CRUD]] application, users insert votes, issues and ballots, and then read them out in tables.
h1. Ajax Voting
The [[Ajax]] voting system works like this:
# User clicks on a vote
## Ajax fires off a request
## Vote class is set to pending
# Server receives request
## Server deletes all votes for the issue from the user's IP
## A new vote is inserted
## The current tally of votes for the issue is selected from the [[database]] and returned.
# Client receives response - including the tally and the id of the issue.
## Vote tally is updated
## User's vote is set to selected
h1. Database Schema
<pre>
<code>
-- Database: `referendum`
--
-- --------------------------------------------------------
--
-- Table structure for table `ballots`
--
CREATE TABLE `ballots` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) collate utf8_unicode_ci NOT NULL default '',
`description` text collate utf8_unicode_ci NOT NULL,
`created` datetime NOT NULL default '0000-00-00 00:00:00',
`updated` timestamp NOT NULL default CURRENT_TIMESTAMP,
`password` varchar(32) collate utf8_unicode_ci NOT NULL default '',
`css` text collate utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`),
KEY `created` (`created`,`updated`),
FULLTEXT KEY `description` (`description`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=7 ;
-- --------------------------------------------------------
--
-- Table structure for table `issues`
--
CREATE TABLE `issues` (
`id` int(11) NOT NULL auto_increment,
`ballot_id` int(11) NOT NULL default '0',
`title` varchar(255) collate utf8_unicode_ci NOT NULL default '',
`description` text collate utf8_unicode_ci NOT NULL,
`created` datetime NOT NULL default '0000-00-00 00:00:00',
`name` varchar(255) collate utf8_unicode_ci NOT NULL default '',
`ip` int(4) NOT NULL default '0',
`link` text collate utf8_unicode_ci NOT NULL,
`approved` tinyint(1) NOT NULL default '0',
`homepage` text collate utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
KEY `ballot_id` (`ballot_id`),
KEY `approved` (`approved`),
FULLTEXT KEY `description` (`description`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=5 ;
-- --------------------------------------------------------
--
-- Table structure for table `votes`
--
CREATE TABLE `votes` (
`id` int(11) NOT NULL auto_increment,
`issue_id` int(11) NOT NULL default '0',
`ip` int(4) NOT NULL default '0',
`vote` tinyint(1) NOT NULL default '0',
`time` timestamp NOT NULL default CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `ballot_id` (`issue_id`,`ip`,`vote`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=70 ;
</code>
</pre>
h1. Images
* "famfamfam":http://famfamfam.com
Discuss Feature Ideas Here.
* [[RSS]] Feeds for ballots: <a rev='vote_for' href='http://sandbox.sourcelabs.com/referendum/index.php?ballot=1&issue=2#forIssue2'><img...
Discuss Feature Ideas Here.
* [[RSS]] Feeds for ballots: <a rev='vote_for' href='http://sandbox.sourcelabs.com/referendum/index.php?ballot=1&issue=2#forIssue2'><img src='http://sandbox.sourcelabs.com/referendum/voteyes.png'></a>
** This is a top priority and should be in soon - [[User:alex|alex]]
* Add [[CSS]] Templates - let users pick from CSS templates when creating new ballots.
* -Allow deletion of issues- done
* -Allow deletion of issues- issues - done
Discuss Feature Ideas Here.
* [[RSS]] Feeds for ballots: <a rev='vote_for' href='http://sandbox.sourcelabs.com/referendum/index.php?ballot=1&issue=2#forIssue2'><img src='http://sandbox.sourcelabs.com/referendum/voteyes.png'></a>
** This is a top priority and should be in soon - [[User:alex|alex]]
* Add [[CSS]] Templates - let users pick from CSS templates when creating new ballots.
* -Allow deletion of issues- issues - done
* -Allow deletion of issues - issues: <a rev='vote_for' href='http://sandbox.sourcelabs.com/referendum/index.php?ballot=1&issue=4#forIssue4'><img...
Discuss Feature Ideas Here.
* [[RSS]] Feeds for ballots: <a rev='vote_for' href='http://sandbox.sourcelabs.com/referendum/index.php?ballot=1&issue=2#forIssue2'><img src='http://sandbox.sourcelabs.com/referendum/voteyes.png'></a>
** This is a top priority and should be in soon - [[User:alex|alex]]
* Add [[CSS]] Templates - let users pick from CSS templates when creating new ballots.
* -Allow deletion of issues - issues: <a rev='vote_for' href='http://sandbox.sourcelabs.com/referendum/index.php?ballot=1&issue=4#forIssue4'><img src='http://sandbox.sourcelabs.com/referendum/voteyes.png'></a>- done
* -Allow Allow deletion of issues: <a rev='vote_for' href='http://sandbox.sourcelabs.com/referendum/index.php?ballot=1&issue=4#forIssue4'><img...
Discuss Feature Ideas Here.
* [[RSS]] Feeds for ballots: <a rev='vote_for' href='http://sandbox.sourcelabs.com/referendum/index.php?ballot=1&issue=2#forIssue2'><img src='http://sandbox.sourcelabs.com/referendum/voteyes.png'></a>
** This is a top priority and should be in soon - [[User:alex|alex]]
* Add [[CSS]] Templates - let users pick from CSS templates when creating new ballots.
* -Allow Allow deletion of issues: <a rev='vote_for' href='http://sandbox.sourcelabs.com/referendum/index.php?ballot=1&issue=4#forIssue4'><img src='http://sandbox.sourcelabs.com/referendum/voteyes.png'></a>- done src='http://sandbox.sourcelabs.com/referendum/voteyes.png'></a>
** This is a top priority and should be in soon - [[User:alex|alex]]
* Add [[CSS]] Templates - let users pick from CSS templates...
» complete changeDiscuss Feature Ideas Here.
* [[RSS]] Feeds for ballots: <a rev='vote_for' href='http://sandbox.sourcelabs.com/referendum/index.php?ballot=1&issue=2#forIssue2'><img src='http://sandbox.sourcelabs.com/referendum/voteyes.png'></a>
** This is a top priority and should be in soon - [[User:alex|alex]]
* Add [[CSS]] Templates - let users pick from CSS templates when creating new ballots.
* Allow deletion of issues: <a rev='vote_for' href='http://sandbox.sourcelabs.com/referendum/index.php?ballot=1&issue=4#forIssue4'><img src='http://sandbox.sourcelabs.com/referendum/voteyes.png'></a>
* Allow deletion of issues: <a rev='vote_for' href='http://sandbox.sourcelabs.com/referendum/index.php?ballot=1&issue=4#forIssue4'><img...
» complete changeDiscuss Feature Ideas Here.
* [[RSS]] Feeds for ballots: <a rev='vote_for' href='http://sandbox.sourcelabs.com/referendum/index.php?ballot=1&issue=2#forIssue2'><img src='http://sandbox.sourcelabs.com/referendum/voteyes.png'></a>
* Add [[CSS]] Templates - let users pick from CSS templates when creating new ballots.
* Allow deletion of issues: <a rev='vote_for' href='http://sandbox.sourcelabs.com/referendum/index.php?ballot=1&issue=4#forIssue4'><img src='http://sandbox.sourcelabs.com/referendum/voteyes.png'></a> src='voteyes.png'></a>
* Allow deletion of issues: <a rev='vote_for' href='http://sandbox.sourcelabs.com/referendum/index.php?ballot=1&issue=4#forIssue4'><img...
» complete changeDiscuss Feature Ideas Here.
* [[RSS]] Feeds for ballots: <a rev='vote_for' href='http://sandbox.sourcelabs.com/referendum/index.php?ballot=1&issue=2#forIssue2'><img src='http://sandbox.sourcelabs.com/referendum/voteyes.png'></a>
* Add [[CSS]] Templates - let users pick from CSS templates when creating new ballots.
* Allow deletion of issues: <a rev='vote_for' href='http://sandbox.sourcelabs.com/referendum/index.php?ballot=1&issue=4#forIssue4'><img src='voteyes.png'></a>
* [[RSS]] Feeds for ballots: Feeds: <a rev='vote_for' href='http://sandbox.sourcelabs.com/referendum/index.php?ballot=1&issue=2#forIssue2'><img
Discuss Feature Ideas Here.
* [[RSS]] Feeds for ballots: Feeds: <a rev='vote_for' href='http://sandbox.sourcelabs.com/referendum/index.php?ballot=1&issue=2#forIssue2'><img src='http://sandbox.sourcelabs.com/referendum/voteyes.png'></a>
* Add [[CSS]] Templates - let users pick from CSS templates when creating new ballots.
* Add [[CSS]] Templates
» complete changeDiscuss Feature Ideas Here.
* [[RSS]] Feeds: <a rev='vote_for' href='http://sandbox.sourcelabs.com/referendum/index.php?ballot=1&issue=2#forIssue2'><img src='http://sandbox.sourcelabs.com/referendum/voteyes.png'></a>
* Add [[CSS]] Templates
* [[RSS]] Feeds: <a rev='vote_for' href='http://sandbox.sourcelabs.com/referendum/index.php?ballot=1&issue=2#forIssue2'><img...
» complete changeDiscuss Feature Ideas Here.
* [[RSS]] Feeds: <a rev='vote_for' href='http://sandbox.sourcelabs.com/referendum/index.php?ballot=1&issue=2#forIssue2'><img src='http://sandbox.sourcelabs.com/referendum/voteyes.png'></a> src='voteyes.png'></a>
* [[RSS]] Feeds: <a rev='vote_for' href='http://sandbox.sourcelabs.com/referendum/index.php?ballot=1&issue=2#forIssue2'><img...
» complete changeDiscuss Feature Ideas Here.
* [[RSS]] Feeds: <a rev='vote_for' href='http://sandbox.sourcelabs.com/referendum/index.php?ballot=1&issue=2#forIssue2'><img src='voteyes.png'></a>
Discuss Feature Ideas Here.
