WordPress.org

Forums

YOP Poll
[resolved] results from one poll populating to all polls (24 posts)

  1. 401frankie
    Member
    Posted 1 year ago #

    Hi!
    the set-up: yop poll inserted into tablepress table.
    Each state has 1 page. take "alabama" for example. within the "alabama" page there is a tablepress table with the names of individual sites such as "alabama artificial limb". Each site is a line of the table. the yop poll was inserted via "copy and paste" individually in each box of the table.
    the results from one poll are populating all polls with the same question, even across different pages!
    http://www.databasedog.com/wordpress/?page_id=30
    How can I fix this?
    Thanks!

    http://wordpress.org/plugins/yop-poll/

  2. TobiasBg
    Member
    Posted 1 year ago #

    Hi,

    thanks for your post, and sorry for the trouble.

    I'm not familiar with YOP poll, but my assumption here is that you need to pass some sort of unique ID to each poll. Otherwise, it will take e.g. the current post's ID which is the ID of the page with the table. And with that, all polls are actually the same one.

    Regards,
    Tobias

  3. 401frankie
    Member
    Posted 1 year ago #

    thank you. that is a good idea.
    1) how do i go about that? an example of the poll looks like this: [yop_poll id="2"]
    I am afraid if I just add some random number like [yop_poll id="2" 1] that it will actually be making some kind of command. Am I wrong about this? can I just add 1,2,3,4.... to the end of the poll?
    2) And, if this is the way to go about it, I have 4 polls in 566 entries. Is there a way to make it self-populate instead of entering 2,264 separate changes? maybe [yop_poll id="2+(n+1)"] or something?
    thanks!

  4. TobiasBg
    Member
    Posted 1 year ago #

    Hi,

    ok, so each poll has an ID.
    But then you'll have to create one poll for each residency in each state anyway, i.e. you'll have 2,264 polls with a different ID.
    And unfortunately you'll have to add them to the table cells manually (or use an external programming mechanism that generates a CSV that you then import into TablePress).

    Regards,
    Tobias

  5. 401frankie
    Member
    Posted 1 year ago #

    woah! I didn't expect that answer! haha! Well, I guess i better get to work.
    Thanks,TobiasBg

  6. 401frankie
    Member
    Posted 1 year ago #

    Hi Tobias,
    how bout this? I can "clone" each poll 566 times. Is there a way that I can command the program to instantly create 566 clones instead of doing them one at a time?
    thanks!

  7. 401frankie
    Member
    Posted 1 year ago #

    OR is there a different poll that is better suited for this use?

  8. 401frankie
    Member
    Posted 1 year ago #


  9. TobiasBg
    Member
    Posted 1 year ago #

    Hi,

    sorry, for that you'll have to wait for a reply by the YOP Poll developer :-(

    But it's just reasonable that you'll need 2,264 different polls, as you seem to want to let people reply to four different questions/properties for 566 entries (which are spread over 50 states).
    So, that's 556*4=2,264 polls.

    As this is indeed a lot of manual work (and there's room for error, and it's not really extensible), you might want to check out a custom solution, based on a custom mySQL table and some PHP programming.

    Regards,
    Tobias

  10. 401frankie
    Member
    Posted 1 year ago #

    Hi Tobias,
    Custom means hiring someone else? or is this available through wordpress?
    Also, you have seen the website... do you think there is a better way to do this than a poll within a table?
    **This question is open to anyone reading this! **
    I have entered around 1,200 entries (via cloning), but the room for error has me freaked out.
    Thanks again!

  11. 401frankie
    Member
    Posted 1 year ago #

    I'm unsure of what to do.
    I have now entered all the polls but this is impractical. in order to test the site I need to take some of the polls...but finding them in order to reset in over 2,000 clones is not working.
    I need a better idea.
    Is there a forum that may have other users who can suggest different plug ins?

  12. TobiasBg
    Member
    Posted 1 year ago #

    Hi,

    yes, "custom" could mean hiring someone, or developing it yourself (if you have programming skills).
    Unfortunately, I'm not aware of existing plugins that can do this. Sorry :-(
    You could try the more general forums at http://wordpress.org/support/ or maybe ask on a platform like StackExchange.

    Regards,
    Tobias

  13. YOP
    Member
    Plugin Author

    Posted 1 year ago #

    Hi 401frankie,

    To generate more easily all the polls you need edit inc/admin.php and in
    view_all_polls_operations function where you have

    if ( 'clone' == $action ) {

    replace

    foreach ( $bulkyoppolls as $yoppoll_id ) {
                            $yoppoll_id  = ( int )$yoppoll_id;
                            $poll_author = Yop_Poll_Model::get_poll_field_from_database_by_id( 'poll_author', $yoppoll_id );
                            if ( ( $this->current_user_can( 'clone_own_polls' ) && $poll_author == $current_user->ID ) || ( $this->current_user_can( 'clone_polls' ) ) ){
                                    Yop_Poll_Model::clone_poll( $yoppoll_id );
                            }
                            else {
                                $total_uncloned++;
                            }
                        }

    with

    foreach ( $bulkyoppolls as $yoppoll_id ) {
                            $yoppoll_id  = ( int )$yoppoll_id;
                            $poll_author = Yop_Poll_Model::get_poll_field_from_database_by_id( 'poll_author', $yoppoll_id );
                            if ( ( $this->current_user_can( 'clone_own_polls' ) && $poll_author == $current_user->ID ) || ( $this->current_user_can( 'clone_polls' ) ) ){
                                for ( $i = 0; $i < 5; $i++ ) {
                                    Yop_Poll_Model::clone_poll( $yoppoll_id );
                                }
                            }
                            else {
                                $total_uncloned++;
                            }
                        }

    In for ( $i = 0; $i < 5; $i++ ) replace "5" wit the value you want.
    We would recommend to start with a smaller value, maximum 50, as it may take a while until all 50 clones are generated.

    To clone the poll go to "All Polls", select the poll you want to clone and from the menu at the top, in Bulk Actions, choose Clone and click on Apply.

    This should generate the number of clones you want.

    Regards,

    YOP Team

  14. TobiasBg
    Member
    Posted 1 year ago #

    Hi,

    good to hear that there's an automated way to create those polls!
    It will still be some work to insert them into the tables.

    Regards,
    Tobias

  15. 401frankie
    Member
    Posted 1 year ago #

    thanks! I have already entered them, but I am grateful to have that info and will use it next time.
    So... now that I have all the clones in there, is there a way to "reset all" without clicking the boxes of each poll? Or to otherwise choose a selection of boxes without clicking? (
    I'm sure there's a php for that! read that like: there's an app for that! haha!)

  16. TobiasBg
    Member
    Posted 1 year ago #

    Hi,

    sorry, I don't know. Let's hope that YourOwnProgrammer can help again.

    Regards,
    Tobias

  17. YOP
    Member
    Plugin Author

    Posted 1 year ago #

    Hi 401frankie,

    You can select the first poll, press the Shift key on your keyboard and at the same time select the last poll you want to reset. By doing doing this you will automatically select all the polls in between.

    Next, in Bulk Actions, choose Reset Votes and click on Apply.

    Best wishes,

    YOP Team

  18. 401frankie
    Member
    Posted 1 year ago #

    the requested URL is too large for the server so it cannot perform this command.

  19. 401frankie
    Member
    Posted 1 year ago #

    Tobias,
    I checked out stack exchange. it seems you are not allowed to ask open-ended questions. I think it has become clear that I am not going about this the right way. Are there other sites to get help?

  20. TobiasBg
    Member
    Posted 1 year ago #

    Hi,

    sorry, I'm not really aware of other places, as I'm basically just using the WordPress Forums.

    Regards,
    Tobias

  21. YOP
    Member
    Plugin Author

    Posted 1 year ago #

    Hi 401frankie,

    You can either modify your script and reset all the polls at once or reset them in groups, but not more than 300 at a time (even so, it may take a while to do that).

    Regards,

    YOP Team

  22. TobiasBg
    Member
    Posted 1 year ago #

    Hi,

    yes, doing it in chunks is probably also worth a shot.

    Regards,
    Tobias

  23. 401frankie
    Member
    Posted 1 year ago #

    Tobias and YourOwnProgrammer,
    Thank you!

  24. TobiasBg
    Member
    Posted 1 year ago #

    Hi,

    no problem, you are very welcome! :-)

    Best wishes,
    Tobias

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic