• @Kowlin There is a pull request (not authored by me) which fixes the problem. The Javascript problem is easy to fix. However, that in and of itself does not wholly fix the problem. The second part is that the Persona theme is laid out a bit different in HTML and the poll client javascript expects to insert the poll into a certain HTML element. Altering the poll code to work correctly for Persona means breaking all other themes. I have my own fixes for these issues but haven't pushed anything because of the theme compatibility problem.

    How I fixed the JS problem:

    index 5eb6a09..7b78147 100644
    --- a/public/js/poll/main.js
    +++ b/public/js/poll/main.js
    @@ -1,7 +1,7 @@
     (function() {
            window.Poll = {
                    load: function(data) {
    -                       Poll.sockets.emit.load(data.pollid, function(err, poll)
    +                       Poll.sockets.emit.load(data, function(err, poll) {
                                    if (!err) {
                                            Poll.view.init(poll, function(pollView)
                                                    if (parseInt(poll.info.deleted,
    diff --git a/templates/poll/notify.tpl b/templates/poll/notify.tpl
    index a4c5354..fc693c2 100644
    --- a/templates/poll/notify.tpl
    +++ b/templates/poll/notify.tpl
    @@ -1 +1 @@
    -<script>Poll.load({ pollid: {pollid} })</script>
    \ No newline at end of file

    And how I fixed the Persona theme problem:

    diff --git a/public/js/poll/view.js b/public/js/poll/view.js
    index 1d586ad..900f3e4 100644
    --- a/public/js/poll/view.js
    +++ b/public/js/poll/view.js
    @@ -63,7 +63,7 @@
                    insertPoll: function(poll, callback) {
                            View.parsePoll(poll, function(html) {
    -                               $('#post-container .post-row[data-index="0"] .po
    +                               $('.posts .clearfix[data-index="0"] .content').p

  • @phil said:

    •                           $('.posts .clearfix[data-index="0"] .content').p

    missing since what? p = poll ??

  • @Schamper This plugin would be very usefull in fact. I'm pretty sure that some people are moving from NodeBB to Discourse because of this problem. About me I spent some time installing nodeBB, which is fabulous, but the BIG problem is that I didn't find any working poll system on NodeBB until now, and I'm thinking about migrating to Discourse.. Sad, don't you think ?

  • lmao @Schamper being the reason why you are giving up on forum software.

    I think people need to understand that he has done those plugins as side projects that are open source. He has no reason to even update these other than his own motivation.
    Yes it would be nice for them to work on the latest version but if you are that desperate for a plug then use the nodebb version that the plugin supports.

    BitBangers is still running nodebb v0.6 as we rely heavily on the shoutbox which is only really compatible up to v0.6.

  • @Schamper The poll plugin is now working on my 0.8.2 NodeBB. Thank you very much for this awesome work !! 🙂 👍

  • Plugin & Theme Dev

    Just wanted to let everyone know that this plugin is still being worked on. A couple weeks back I spent a lot of time reworking the server code and yesterday I spent some time reworking the poll creator. Some notable new features:

    • The creator will look for an existing poll in your post and allow you to edit it
    • Adding options is a bit more obvious now
    • The date-time picker now works again
    • The preview of your post doesn't show some bastardised list anymore
    • Lots and lots of code improvement


    Next up is working on the poll viewer and some other stuff. Hopefully I'll be able to release a 0.9.x compatible version soon 🙂

  • Good news.. Can you now add a poll after a topic has been created? Like for instance in the second post?

  • Plugin & Theme Dev

    @whitts currently it's still a design decision to only allow polls in the first post. With the new hooks (well, new since when this was originally created) however, it should be possible to allow a poll by editing the first post.

    Maybe with poll 2.0 😉 I'd need some good arguments to why allowing a poll in every post will be a good idea.

  • GNU/Linux

    @Schamper said:

    Maybe with poll 2.0 😉 I'd need some good arguments to why allowing a poll in every post will be a good idea.

    There isn't one IMO 🙂

  • It wasn't so much as to allow a poll in every post.. It was more for if someone posts a topic.. Then people argue about it and they decide to do a poll about it. They could just add a poll to the current topic and not have to create a new one. Thanks

  • Plugin & Theme Dev

    @whitts well that should be possible.

  • if possible creator of thread put more than one poll in thread and maximum votes per user i will move to nodebb from mybb.

    something that i need much, but mybb not want offer for me so http://community.mybb.com/thread-154224.html

  • Plugin & Theme Dev

    @martec max votes per user on a single poll? That's already supported. Multiple polls per thread is not something I'm considering, I'd much rather go with multiple questions on a single poll. Either way, it'll be something that will take quite some effort to implement, given the current method of doing polls. I do want to have something like that supported some day, though.

  • @Schamper

    hi, thanks for answer.
    what the difference with multiple questions on a single poll and Multiple polls per thread?
    what i need that thread creator create multiple poll, so probably in this case not has any difference?

    maybe, will complicate when need change one of the question, why if need add one option in one of the questions, probably need recreate all questions. If plugin accept more than one poll, will need recreate only question that need made change.

    anyway, i will wait more progress before migration to nodebb.

  • Plugin & Theme Dev

    @martec it will make a very large difference codewise 👍 also in UX, having a single poll with multiple questions makes much more sense than having multiple polls with each one question.

  • Hi @Schamper When I create a poll either by entering the

    [poll <settings>]

    • Poll options
    • Another option

    Or by using the creator button I get the same results which is, I hit submit button and it accepts the action but then just stops. Don't reset to the form post, doesn't freeze my ability to exit or discard post/poll. It just stays like its trying to submit but nothing happens.

  • Plugin & Theme Dev

    @MassivelyIndie are you on the development branch?

  • @Schamper said:

    @MassivelyIndie are you on the development branch?

    How do I determine that?

  • Plugin & Theme Dev

    @MassivelyIndie if you don't know, you're not. Download the plugin from there and place it in node_modules manually, for the time being. https://github.com/Schamper/nodebb-plugin-poll/tree/development

  • Plugin & Theme Dev

    Boom! New release, no one saw that coming, huh?

    Poll plugin version 0.2.0 was just published to NPM. Aside from being almost completely rewritten, it now works better than ever!
    Some noteworthy changes:

    • NodeBB 1.0.0 compatible
    • Reliably add a poll by editing the first post
    • The creator will look for an existing poll in your post and allow you to edit it
    • The creator itself has been completely overhauled
    • The preview of your post doesn't show some bastardised list anymore
    • Fresh new paint of code pretty much everywhere
    • Mostly stable

    Important! Polls created by a previous version (so < 0.2.0) will NOT work with this version of the plugin. Due to the amount of changes in the way how polls are stored, there are currently no plans of supporting older polls.

    I've also updated the first post (it was still stuck on version 0.0.2 😨) and I even added some screenshots!

Suggested Topics

| |