WordPress.org

Forums

Poll Plugin for WordPress (28 posts)

  1. pera
    Member
    Posted 10 years ago #

    It's for WordPress 1.2, will it work with WordPress 1.5 to ?

  2. mat8iou
    Member
    Posted 10 years ago #

    Which poll plugin?

    If you are referring to the one here: http://www.lesterchan.net/portfolio/programming.php then you are in luck, as yesterday evening I managed to get it to work with 1.5, as I mentioned in another post.

    I have managed to get the plugin to work with a bit of fiddling.
    You can download a zip with the ammended files from:
    http://www.mtaylor.co.uk/temp/wp-polls_050403.zip
    Make sure you look through the readme file, as ther are some changes there as well. Other changes are documented at the ends of the source code files.

    I hope this works for you.

  3. pera
    Member
    Posted 10 years ago #

    Thanks, it's working :)

  4. Alile
    Member
    Posted 10 years ago #

    I just tried to install this plugin and I got this message when I ran wp-admin/polls-install.php

    WordPress database error: [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 '( aid int(10) unsigned NOT NULL auto_increment, qid int(10) NOT]
    CREATE TABLE ( aid int(10) unsigned NOT NULL auto_increment, qid int(10) NOT NULL default '0', answers varchar(200) NOT NULL default '', votes int(10) NOT NULL default '0', PRIMARY KEY (aid))

    WordPress database error: [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 '( id int(10) unsigned NOT NULL auto_increment, question varchar]
    CREATE TABLE ( id int(10) unsigned NOT NULL auto_increment, question varchar(200) NOT NULL default '', timestamp varchar(20) NOT NULL default '', total_votes int(10) NOT NULL default '0', PRIMARY KEY (id))

    WordPress database error: [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 'VALUES (1, 'How Is My Site?', '1112894265', 0)' at line 1]
    INSERT INTO VALUES (1, 'How Is My Site?', '1112894265', 0);

    WordPress database error: [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 'VALUES (1, 1, 'Good', 0)' at line 1]
    INSERT INTO VALUES (1, 1, 'Good', 0);

    WordPress database error: [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 'VALUES (2, 1, 'Excellent', 0)' at line 1]
    INSERT INTO VALUES (2, 1, 'Excellent', 0);

    WordPress database error: [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 'VALUES (3, 1, 'Bad', 0)' at line 1]
    INSERT INTO VALUES (3, 1, 'Bad', 0);

    WordPress database error: [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 'VALUES (4, 1, 'Can Be Improved', 0)' at line 1]
    INSERT INTO VALUES (4, 1, 'Can Be Improved', 0);

    WordPress database error: [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 'VALUES (5, 1, 'No Comments', 0)' at line 1]
    INSERT INTO VALUES (5, 1, 'No Comments', 0);

    Can some one please tell me what to do now? I don't know what it means. :(
    I asked my host if they had upgraded the Zend Optimizer when they upgraded PHP to version 4.3.10 and they just to me that it is at the latest version currently.

    I don't know what to do. :(

  5. gmaestro
    Member
    Posted 10 years ago #

    I'm having some difficulty also, even following Mathew's very clear directions I'm getting:

    Fatal error: Call to undefined function: vote_poll() in /home2/jason/public_html/gm/wp-content/themes/parishuddha/index.php on line 1

    hmm...might it work with a different theme?

  6. gmaestro
    Member
    Posted 10 years ago #

    nope.

    Fatal error: Call to undefined function: vote_poll() in /home2/jason/public_html/gm/wp-content/themes/clasikue/index.php on line 4

  7. gmaestro
    Member
    Posted 10 years ago #

    Nevermind...I'm a loser. Well, that, and no where does it say in the directions that one needs to activate at the dashboard, just to use the whatever.php to install. I'm just glad to get it going.

  8. thepope
    Member
    Posted 10 years ago #

    I'd like to display 2 or more polls on one page, the problem is of course the cookie disallows the other polls. Here is the cookie line:

    // If User Click Vote
    if(isset($_POST['vote'])) { $voted = true; }
    // Check User Cookie
    if(isset($_COOKIE["voted_".$polls_questions[0]['id']])) { $voted = true; }

    I am calling the polls by ID:
    <?php get_polls('3'); ?>
    <?php get_polls('2'); ?>
    <?php get_polls('1'); ?>

    Is this a quick change? Thanks so much

  9. spoonbill
    Member
    Posted 10 years ago #

    hmmm, it all works here, but once i cast a vote i get this on top of my page:

    Warning: Cannot modify header information - headers already sent by (output started at /home/.feabhra/shdsmith/sietsesmith.com/blog/wp-content/themes/connections/index.php:4) in /home/.feabhra/shdsmith/sietsesmith.com/blog/wp-content/plugins/polls.php on line 80

    what does it mean? (im a total n00b at coding..)

  10. spoonbill
    Member
    Posted 10 years ago #

    hmm, i seem to have fixed it.. dont ask me how :)

  11. ghecko
    Member
    Posted 10 years ago #

    It all installs fine and shows up but when you vote the results always stay at 0% no votes - any ideas.

  12. parisgv
    Member
    Posted 10 years ago #

    ive got the error:

    [quote]

    WordPress database error: [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 '( aid int(10) unsigned NOT NULL auto_increment, qid int(10) NOT]
    CREATE TABLE ( aid int(10) unsigned NOT NULL auto_increment, qid int(10) NOT NULL default '0', answers varchar(200) NOT NULL default '', votes int(10) NOT NULL default '0', PRIMARY KEY (aid))

    WordPress database error: [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 '( id int(10) unsigned NOT NULL auto_increment, question varchar]
    CREATE TABLE ( id int(10) unsigned NOT NULL auto_increment, question varchar(200) NOT NULL default '', timestamp varchar(20) NOT NULL default '', total_votes tinyint(4) NOT NULL default '0', PRIMARY KEY (id))

    WordPress database error: [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 'VALUES (1, 'How Is My Site?', '1075479885', 0)' at line 1]
    INSERT INTO VALUES (1, 'How Is My Site?', '1075479885', 0);

    WordPress database error: [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 'VALUES (1, 1, 'Good', 0)' at line 1]
    INSERT INTO VALUES (1, 1, 'Good', 0);

    WordPress database error: [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 'VALUES (2, 1, 'Excellent', 0)' at line 1]
    INSERT INTO VALUES (2, 1, 'Excellent', 0);

    WordPress database error: [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 'VALUES (3, 1, 'Bad', 0)' at line 1]
    INSERT INTO VALUES (3, 1, 'Bad', 0);

    WordPress database error: [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 'VALUES (4, 1, 'Can Be Improved', 0)' at line 1]
    INSERT INTO VALUES (4, 1, 'Can Be Improved', 0);

    WordPress database error: [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 'VALUES (5, 1, 'No Comments', 0)' at line 1]
    INSERT INTO VALUES (5, 1, 'No Comments', 0);[/quote]

    y? whats wrong?

  13. Lester Chan
    Member
    Posted 10 years ago #

    hi all, my guess is that u all didnt put in the tables to wp-settings.

    -> Installation Instructions
    --------------------------------------------------
    // Open wp-settings.php

    Find:
    ------------------------------------------------------------------
    $wpdb->postmeta = $table_prefix . 'postmeta';
    ------------------------------------------------------------------
    Add Below It:
    ------------------------------------------------------------------
    $wpdb->pollsa = $table_prefix . 'pollsa';
    $wpdb->pollsq = $table_prefix . 'pollsq';
    ------------------------------------------------------------------

  14. parisgv
    Member
    Posted 10 years ago #

    no, we did this :)

  15. anela
    Member
    Posted 10 years ago #

    Those of you with the MySQL error - are you SURE you made the changes to the wp-settings and uploaded it? I got the MySQL error, the exact same thing until I realized I'd forgotten to upload the wp-settings file. Once I did that, it installed with a snap.

    *off to try polls now...*

  16. osiosal
    Member
    Posted 10 years ago #

    I'm getting a similar error listed above. Everything seemed to install just fine, but after anyone casts a vote, I get the following message on the screen:

    Warning: Cannot modify header information - headers already sent by (output started at /home/tir-na-o/public_html/WordPress/wp-content/themes/plain-vanilla/header.php:6) in /home/tir-na-o/public_html/WordPress/wp-content/plugins/polls.php on line 71

    any ideas?

  17. PaddyMann
    Member
    Posted 10 years ago #

    Hi, a few points.

    The installation script, almost certainly, is failing because you haven't uploaded a fixed version of wp_settings.php.

    Secondly there are a few bugs that could do with addressing.

    - Slashes aren't dealt with very well. Please refer to http://uk.php.net/manual/en/function.get-magic-quotes-gpc.php so as to only add slashes if it hasn't already been done!
    - And remove slashes from input boxes [shown after giving a poll name including quotation marks or apostrophes]
    - And finally, as of bugs I've currently come across, please put up a polite message if no poll is found :) Rather than a somewhat unattractive MySQL error.

    Cheers, looking forward to using it, will post again if I manage to successfully fix the above for my site.

  18. DDT
    Member
    Posted 10 years ago #

    hmm, ok I have installed the poll plugin and it works almost perfect. Two thingies.

    1 View results doesn't work. And I find it strange because after voting it does show the results. I guess in my case the results are only shown when var showresults=1 and var vote exists. How can I solve this?

    2 Cookies don't work I can vote as much as I want????

    Any pointers???

  19. PaddyMann
    Member
    Posted 10 years ago #

    i had the same cookies problem - its not really a great method .. but then there aren't any good methods for polls (?), other than insisting everyone signs up.

    personally i've uninstalled the addon for the moment and will return to it when i have more time.

  20. flavarite
    Member
    Posted 10 years ago #

    Thanks for the great plugin. So far everything works great. I've come accross an issue with using Permalinks and the poll plugin.

    I had permalinks on in WP but turned them off to get this to work for the time being. When viewing a post via its permalink and you click on VIEW RESULTS for any poll on that page it errors out with the following message as an example:

    The requested URL /2005/06/05/briannes-gonna-be-21-the-plan/index.php was not found on this server.

    Any ideas on how to get thsi plugin to work with permalinks on?

    The cookies aren't working for me either. Any ideas on this yet? It's allowing me to vote on the same poll more than once.

  21. SmilingJack
    Member
    Posted 10 years ago #

    For cookie support see my post here:
    http://wordpress.org/support/topic/34555

    Hope that helps.

  22. caipirina
    Member
    Posted 10 years ago #

    so .. is there any working poll plugin for WP 1.5 by now? without undergoing the above ordeals ??

  23. Ringo
    Member
    Posted 10 years ago #

    I think there's probably a lot more people that have it working then are posting "it's not working" in this thread. I had no difficulty setting it up or using it. The ONLY thing that got in the way was my wp template layout ......
    You should try it caipirina ....

  24. trimmedinred
    Member
    Posted 10 years ago #

    i got this error all works but when someone vote you get the error

    Warning: Cannot modify header information - headers already sent by (output started at /nfsn/content/tpu/htdocs/wp-content/themes/falling_dreams/header.php:4) in /nfsn/content/tpu/htdocs/wp-content/plugins/polls.php on line 71

    if anyone could help please do

  25. ChrisTabone
    Member
    Posted 10 years ago #

    It looks like the header error is because of a conflict in the header.php file sending information before the setcookie(); command in poll.php. Apparently setcookie(); technically sends headers to the client computer similarly to normal http headers. If any content (i.e. "echo" commands or text) is sent to the client before setcookie(); is used, an error occurs.

    There are a couple ways to fix this, but a quick [and sloppy] hack is to edit the index.php file in your template and change:

    <?php get_header(); ?>
    <?php vote_poll(); ?>

    to

    <?php ob_start();
    get_header();
    vote_poll();
    ob_end_flush();
    ?>

    It fixes both the error that you're seeing and also allows the cookie to function properly. In programming terms, it would be much better to re-code the polls.php and get the setcookie(); function to work earlier before any of the content is sent to the client. The ob_start(); and ob_end_flush(); basically creates a buffer for php to store all the information until the headers are fully established and then send the data to the client at once. So long as there isn't a tremendous amount of stuff in the headers.php and poll.php files, everything should be ok.

    If anyone knows how to successfully re-code the polls.php file, any help would be appreciated (so that the hack isn't required) :)

  26. aktiv
    Member
    Posted 9 years ago #

  27. JuryDuty
    Member
    Posted 9 years ago #

    This poll works GREAT on my site, but the formatting of the archives are all messed up--they skew WAY to the left and right of the page.

    I've been scouring the wp-polls.php file, but can't seem to find what's causing this behavior. Any ideas?

    You can see it at http://www.thechristianguitarist.com/wp-polls.php

  28. JuryDuty
    Member
    Posted 9 years ago #

    NM--I fixed the problem by nesting the poll tables within a second table. No problem now! :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags