Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Poll Extension for Vanilla 0.9.3

2

Comments

  • Maybe it could be an option?

    Sometimes you might just want people to vote on something but not wax lyrical.

    I reckon an admin option to have the thread closed and stickied but still be votable in would be useful.

    Of course, I like complicating things.
  • I think I'll make it a setting in the extension so that you can configure it with the conf/ files or something. Another issue: Should people be able to edit their polls? The problem is that they could manipulate the results (by switching positions etc.), but I've come across many instances where people want to add new options, for example.
  • edited December 2005
    Creating Polls is finished. Pictures: http://bytetastic.com/vanilla/Picture%205.png http://bytetastic.com/vanilla/Picture%206.png A new option field is automagically created when you start writing in the one furthest down. I'd still like feedback on wether or not one should be able to edit them. This was easier than I expected. <3 Vanila mark: Will you include this extension in the default Vanilla 0.9.3 distribution if I finish it before you're done?
  • i know this isnt entirely the question you asked, but are *any* extensions being included in the v1 distribution?
  • Making polls and then editing the options to skew results seems kind of silly; these things were never scientific research tools. I can think of several legitimate reasons, though, why someone would want to edit their options (typos, clarifications, changes, additions)

    I would be happy to install your extension on my site; let's just say that if it works there, it'll work anywhere
  • mini: 0.9.3 is pretty sparse with no extensions.
  • and...?
  • edited December 2005
    It's finally finished! At least to a degree which lets me release an acceptable beta.

    Poll Extension 0.1
    Which requires Vanilla 0.9.3 of course.

    To use, you need to install two tables:
    CREATE TABLE `LUM_Poll` ( `PollID` int(8) NOT NULL auto_increment, `DiscussionID` int(8) NOT NULL default '0', `Title` varchar(255) NOT NULL default '', `Options` text, PRIMARY KEY (`PollID`) ) ENGINE=MyISAM; CREATE TABLE `LUM_PollVote` ( `PollID` int(8) default NULL, `UserID` int(10) default NULL, `Vote` int(3) NOT NULL ) ENGINE=MyISAM;

    I'll write a PHP script to do it some other time.

    You can go to http://bytetastic.com/vanilla/forum/ to see what it's like.
    You can log in with username "User1" through "User7", and password "vanilla".
  • Hmm, doesn't work here (probably my fault, since I'm running a relatively old and modified revision).

    Copied the files into the extension folder, made the two tables in the database, enabled the extension, started a new discussion, made some poll options and a question (the form works great), but no poll appears in the post.

    I checked the database, and the two poll tables are empty.

    Tomorrow I'll do some debugging and see if the delegates you hooked into are even there in my copy.
  • Ah.. No, I think I used a modified delegate after all. Sorry. It's one of the delegates from the Attachment extension:

    Open File: Vanilla.Control.DiscussionForm ================================================= Find on Line 97: $ResultDiscussion = $dm->SaveDiscussion($this->Discussion); Inset After: $this->DelegateParameters["ResultDiscussion"] = &$ResultDiscussion; $this->CallDelegate("PostSaveDiscussion");
  • Well I've been meaning to install the Attachment extension anyway...
  • Mark has commited these changes to the SVN: http://lussumo.com/svn/vanilla/trunk/library/Vanilla/Vanilla.Control.DiscussionForm.php :D
  • edited December 2005
    Well I got that problem fixed, but the poll still wouldn't display when I looked at the thread.

    In the end I discovered that "$Comment->Body = $output.$Comment->Body;" wasn't doing anything, so I replaced it with "echo($output);" and everything worked.

    Now, to figure out why the attachment extension is having the same problem...
  • Bergamot: Hmm.. Odd. Is your snapshot of 0.9.3 old? The thing is, if you echo the output, it just appears at the top of the entire Discussion form. If you add it to the body of the comment, it'll appear inside the comment (just the first comment for Polls). I have no idea why it wouldn't work for you.
  • that poll extension is really good skyfex, but i do think that users shouldn't be able to change their vote each time they visit the topic.
  • Since when were people ever allowed to change their votes? It's not like you walk in on poll day, vote for someone, realise someone else is becoming more popular, and then go back and change yours?
  • I got it working; turns out it *was* my fault; I moved the comment options to after the body, and the delegate with it. Moving it back fixed it.

    I kind of like the vote changing, it keeps the results lively.
  • I could make changing your vote an option. But it's harder to not let the user change their vote than it is letting them do it, so I won't do it right now =P
  • Hi all, After seeing your poll extension I had to try 0.9.3 to install this. Being a compleet newbie to mysql, php and css it took me a litlle time to get it up and running, but I got it right now. Only problem: I can't get the poll working. I installed it in the extensions folder. renamed poll.php to default.php to get it recognized by vanilla. no problems until I try to open a discussion. then about 8 errors are reported starting with this one: Notice: Undefined index: Poll in vogelblik.nl/vanilla/library/Framework/Framework.Functions.php on line 369 the rest appear to be a result of this one Warning: Missing argument 2 for addselect() in vogelblik.nl/vanilla/library/Framework/Framework.Class.SqlBuilder.php on line 85 Warning: Missing argument 4 for addwhere() in vogelblik.nl/vanilla/library/Framework/Framework.Class.SqlBuilder.php on line 114 Warning: Missing argument 5 for addwhere() in vogelblik.nl/vanilla/library/Framework/Framework.Class.SqlBuilder.php on line 114 Notice: Undefined index: DiscussionID in vogelblik.nl/vanilla/library/Framework/Framework.Class.SqlBuilder.php on line 115 Notice: Undefined index: in vogelblik.nl/vanilla/library/Framework/Framework.Class.SqlBuilder.php on line 115 Notice: Undefined index: = in vogelblik.nl/vanilla/library/Framework/Framework.Class.SqlBuilder.php on line 116 Notice: Undefined index: in vogelblik.nl/vanilla/library/Framework/Framework.Class.SqlBuilder.php on line 116 A fatal, non-recoverable error has occurred Technical information (for support personel): Error Message An error occured while getting the poll for this discussion. Affected Elements Poll.GetPollFromDiscussionID(); The error occurred on or near: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''=.' limit 0, 1' at line 1 any suggestions?
This discussion has been closed.