<?xml version="1.0" encoding="UTF-8"?>

<rss version='2.0'
     xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule">
    <channel>
        <!-- This XML Feed shows details for the page About Referendum -->
        <creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.5/
          </creativeCommons:license>
        <title>About Referendum</title>
        <description>&lt;p&gt;&lt;a class=&quot;wikilink&quot; href=&quot;http://swik.net/Referendum&quot;&gt;Referendum&lt;/a&gt; is an issue voting system.&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a rel=&#039;nofollow&#039; href=&quot;http://sandbox.sourcelabs.com/referendum/index.phps&quot;&gt;Referendum source code&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Essentially Referendum is a simple &lt;a class=&quot;wikilink&quot; href=&quot;http://swik.net/CRUD&quot;&gt;&lt;span class=&quot;caps&quot;&gt;CRUD&lt;/span&gt;&lt;/a&gt; application, users insert votes, issues and ballots, and then read them out in tables.&lt;/p&gt;


	&lt;h1&gt;Ajax Voting&lt;/h1&gt;


The &lt;a class=&quot;wikilink&quot; href=&quot;http://swik.net/Ajax&quot;&gt;Ajax&lt;/a&gt; voting system works like this:
	&lt;ol&gt;
	&lt;li&gt;User clicks on a vote
	&lt;ol&gt;
	&lt;li&gt;Ajax fires off a request&lt;/li&gt;
		&lt;li&gt;Vote class is set to pending&lt;/li&gt;
	&lt;/ol&gt;
	&lt;/li&gt;
		&lt;li&gt;Server receives request
	&lt;ol&gt;
	&lt;li&gt;Server deletes all votes for the issue from the user&amp;#8217;s IP&lt;/li&gt;
		&lt;li&gt;A new vote is inserted&lt;/li&gt;
		&lt;li&gt;The current tally of votes for the issue is selected from the &lt;a class=&quot;wikilink&quot; href=&quot;http://swik.net/database&quot;&gt;database&lt;/a&gt; and returned.&lt;/li&gt;
	&lt;/ol&gt;
	&lt;/li&gt;
		&lt;li&gt;Client receives response &amp;#8211; including the tally and the id of the issue.
	&lt;ol&gt;
	&lt;li&gt;Vote tally is updated&lt;/li&gt;
		&lt;li&gt;User&amp;#8217;s vote is set to selected&lt;/li&gt;
	&lt;/ol&gt;&lt;/li&gt;
	&lt;/ol&gt;


	&lt;h1&gt;Database Schema&lt;/h1&gt;


&lt;pre&gt;
&lt;code&gt;

-- 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 &#039;&#039;,
  `description` text collate utf8_unicode_ci NOT NULL,
  `created` datetime NOT NULL default &#039;0000-00-00 00:00:00&#039;,
  `updated` timestamp NOT NULL default CURRENT_TIMESTAMP,
  `password` varchar(32) collate utf8_unicode_ci NOT NULL default &#039;&#039;,
  `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 &#039;0&#039;,
  `title` varchar(255) collate utf8_unicode_ci NOT NULL default &#039;&#039;,
  `description` text collate utf8_unicode_ci NOT NULL,
  `created` datetime NOT NULL default &#039;0000-00-00 00:00:00&#039;,
  `name` varchar(255) collate utf8_unicode_ci NOT NULL default &#039;&#039;,
  `ip` int(4) NOT NULL default &#039;0&#039;,
  `link` text collate utf8_unicode_ci NOT NULL,
  `approved` tinyint(1) NOT NULL default &#039;0&#039;,
  `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 &#039;0&#039;,
  `ip` int(4) NOT NULL default &#039;0&#039;,
  `vote` tinyint(1) NOT NULL default &#039;0&#039;,
  `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 ;
&lt;/code&gt;
&lt;/pre&gt;

	&lt;h1&gt;Images&lt;/h1&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a rel=&#039;nofollow&#039; href=&quot;http://famfamfam.com&quot;&gt;famfamfam&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;
</description>
                <category>Documentation</category>
        <category>Referendum</category>

        <pubDate>Mon, 27 Feb 2006 13:04:58 -0800</pubDate>
        <lastBuildDate>Thu, 07 Jun 2007 18:38:45 -0700</lastBuildDate>
            
    </channel>
</rss>
