Topic: New plugin: djg_poll

Poll plugin using ajax in Frontend.
- display poll by id, random, newest, list of archive,
- single or multi answare,
- can set time restrict,
- cookie and/or IP secure,
- statistics

http://www.wolfcms.org/repository/plugin/126/releases
https://github.com/djgprv/djg_poll

This plugin is under developement, so if there will be some bugs or if you want me to change something, just let me know - djgprv[at]gmail.com

Last edited by djgprv (2014-07-24 21:54)

"Everyone knows something cannot be done. Then along comes a man who does not know that it cannot be done and does it."
Albert Einstein

2

Re: New plugin: djg_poll

hi djgprv, just downloaded your poll mod and giving it a go looks really good. Just a quick question: I can't seem to see any functions to display the poll results (as seen in your last screenshot) am I missing a file or was it never developed sad ? Thanks.

Last edited by blake (2012-10-01 15:24)

Re: New plugin: djg_poll

Hi blake, thanks for use my plugin. To display result like in the last screen You must use djg_poll_show_archive(); It display only disable polls (for example voting is finished).
To disable poll go to "List of all polls" and click to green turn on/off icon.
In my screen :
body:

<?php if (Plugin::isEnabled('djg_poll')) djg_poll_show_archive(); ?>

sidebar:

<?php if (Plugin::isEnabled('djg_poll')) djg_poll_show_newest_poll(); ?>
"Everyone knows something cannot be done. Then along comes a man who does not know that it cannot be done and does it."
Albert Einstein

4

Re: New plugin: djg_poll

dziękuję!

I had only created one poll and this was causing an error so it did not display the results part. Looks good.

The "Time between vote" - does this control the cookie to stop users voting more than once, or is this something else?

I'm going to be doing some development (if you have not already created) to add:
• Admin can set a start and end time for poll (day/month/year/ hour minute)
• Admin can set how many times a users can vote (will do through cookie or session)
• Admin can set if poll results are displayed to user after vote
• Admin can edit poll text once live (through the edit area)

Once complete would you like me to pass over to add to the core?

dzięki.

Last edited by blake (2012-10-02 16:57)

Re: New plugin: djg_poll

Thank You for help. At first i have to finnish translation sad I have little problem with english.
Ad. 1: good idea, i've seen this function in wordpress plugin (more advanced)
Ad. 2: now You can set time between votes (defined in hours) like in select (every hour ...) and chose IP and/or cookie protect
Ad. 3: why would anyone deny to view results? I think it doesn't have sense sad
Ad. 4: unrecommended in my opinion
If you have free time to upgarde some functions or make translation amendments will be glad.

"Everyone knows something cannot be done. Then along comes a man who does not know that it cannot be done and does it."
Albert Einstein

Re: New plugin: djg_poll

Michael, have you thought about opening a repository for the plugin, say on github. I'd contribute Russian translation at least. And maybe some improvements...

Or is there a way to contribute to WolfCMS repos?

(I am Max Korinets that emailed you recently)

Last edited by yentsun (2012-12-06 12:39)

Thumbs up

Re: New plugin: djg_poll

Hi, new version is available.
0.0.2 - clean up, bug fixes, lifetime option, polish translation

"Everyone knows something cannot be done. Then along comes a man who does not know that it cannot be done and does it."
Albert Einstein

8

Re: New plugin: djg_poll

I agree with @yentsun. Your plugins are very nice and you'd definitely benefit from putting them on Github or Bitbucket.

Pozdrawiam!

Last edited by mm (2013-02-14 13:16)

Re: New plugin: djg_poll

Thanks mm and sorry because i found another bug.
ver 0.0.3 - new trim text fynction, fixed division by zero in renderPollResults

"Everyone knows something cannot be done. Then along comes a man who does not know that it cannot be done and does it."
Albert Einstein

10

Re: New plugin: djg_poll

Git repository is avalible. Enjoy.

"Everyone knows something cannot be done. Then along comes a man who does not know that it cannot be done and does it."
Albert Einstein

Re: New plugin: djg_poll

I'm getting an error with Wolf 0.7.7:

Fatal error: Call to a member function fetchAll() on a non-object in /home/getheard/public_html/wolf/plugins/djg_poll/views/polls.php on line 14

Haven't dug far enough into the newest release, yet.  Hopefully tonight.

Last edited by mtylerb (2013-05-26 19:25)

Cheers,

Tyler

Re: New plugin: djg_poll

It seems to be a SQL error.  The SQL the script is creating is (as shown by phpMyAdmin for clarity):

SELECT * , (
    pollq_startvote = "0000-00-00 00:00:00"
    OR pollq_endvote = "0000-00-00 00:00:00"
    OR (
        NOW( )
        BETWEEN pollq_startvote
        AND pollq_endvote
    )
) AS pollq_dead
FROM ngh_djg_pollsq
ORDER BY pollq_id DESC
LIMIT 

When I manually run that in phpMyAdmin, I get an error:

#1064 - 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 '' at line 1

Cheers,

Tyler

Re: New plugin: djg_poll

Seems it was an upgrade issue.  There's only a couple small issues I've found.

1: even though I've upgraded (everything except the CSS files), both the index.php file and the plugin_settings table show version 0.0.4, the admin side of the site is showing version 0.0.3.

2: mysql_escape_string is deprecated and will be removed in upcoming versions of PHP.  I'm running 5.4 on my server and am getting deprecated warnings every time I try to save the settings.  Line 129 of the Controller file has the reference.  As far as I know, this is unnecessary with Wolf using PDO, inputs are sanitized when bound to the SQL statement.  Correct me if I'm wrong.

Last edited by mtylerb (2013-05-26 19:50)

Cheers,

Tyler

14

Re: New plugin: djg_poll

Hi,

first, very nice plugin.

second, there's huge voting security bug smile you can open several windows with same poll and vote in each one of them... IP is not checked when the vote is saved to DB.

fix:
in Model file Djgpoll.php, method addVote in first if conditions add on the end:

 or (self::checkIP($questionId)) 

Last edited by moroz (2013-11-29 23:36)

Thumbs up

15

Re: New plugin: djg_poll

@moroz thank you
I will check this and fix it next release.

"Everyone knows something cannot be done. Then along comes a man who does not know that it cannot be done and does it."
Albert Einstein

16

Re: New plugin: djg_poll

v.0.34 is available

* added cancel votes functionality
* editable usleep and cookie prefix variables
* cleanup the code
* dba tables structure has bean changed
* small changes in en-message.php
* update icons
* added "total unique voters" in statistics
* tested in WolfCMS 0.8.0

"Everyone knows something cannot be done. Then along comes a man who does not know that it cannot be done and does it."
Albert Einstein