poll tool
-
Hello
I would like to delve deeper into the matter nodebb.
I want to create a poll tool.
-
when you create a new theme to a button "create poll" appear.
-
Then comes a pop-up window to where you can make a survey.
- And answers
- Can be extended
It would have three databases are created.
1. the poll: Poll ID, Poll title, Poll creator username, Poll creator user ID
2. the reply: answer ID, answering title, Poll ID
3. the user vote: user id, answer ID, Poll IDthe poll created will appear in the post.
each registered user can vote.then it should be present in the menu or anywhere a list of polls.
the profile of the users an extra pad could be created where his polls are to be seen in outline.
the result list could still make pretty with charts .. but that's second
I would like to tinker.
Who can I ask me for questions about the system NodeBB?or are there any tutorials anchor the work with the NodeBB?
-
-
So you want to create plugin? You can watch https://community.nodebb.org/topic/218/how-to-guide-for-writing-your-first-plugin and the whole category for information
-
@ogerly there is a plugin for polls
https://community.nodebb.org/topic/1549/nodebb-plugin-poll-poll-plugin
-
Thank you for the link.
I've installed the tool to me.when I click "Allow guests to View Poll Results" it will not be saved!
NodeBB 0.7.x
If I reload the tick out again.
I also gepeostet it at github.
-
So the tool is running.
following error, I've found.
the poll will be created.
when you save the text is not new reloaded.
Here are the screenshots -
@ogerly said:
So the tool is running.
following error, I've found.
the poll will be created.
when you save the text is not new reloaded.
Here are the screenshotsYes.. This is an error with nodeBB 0.7.2.
On @exodo, we have fixed it, just change the file public/js/poll/main.js with this code:(function() { window.Poll = { load: function(data) { $(window).one('action:ajaxify.contentLoaded', function () { Poll.sockets.emit.load(data, function(err, poll) { if (!err) { Poll.view.init(poll, function(pollView) { if (parseInt(poll.info.deleted, 10) === 1 || parseInt(poll.info.ended, 10) === 1) { Poll.view.showMessage({ title: 'Voting unavailable', content: 'This poll has ended or has been marked as deleted. You can still view the results.' }, pollView); } }); } else if (err.message != 'Not logged in') { app.alertError('Something went wrong while getting the poll!'); } }); }); } }; })();
Really, the change is only in the line:
Poll.sockets.emit.load(data, function(err, poll) {
And then, change the file templates/poll/notify.tpl with:
<script>Poll.load({pollid})</script>
After that, It should work well