WordPress.org

Ready to get started?Download WordPress

Forums

WP-Polls - Cannot Add Different Polls To Posts (13 posts)

  1. Danny Albeck
    Member
    Posted 6 years ago #

    Hello,

    I am using WordPress 2.5.1 and WP-Polls, I love the plug-in the only problem I have is I cannot add a different poll to my posts. I have the code in there when I click on the little poll icon and I enter in the correct ID, but it displays the poll that I am running in the sidebar instead of the pollid I enter in. Any ideas?

  2. Lester Chan
    Member
    Posted 6 years ago #

    Type [poll id="1"]

  3. Danny Albeck
    Member
    Posted 6 years ago #

    I have, still nothing =/

  4. Lester Chan
    Member
    Posted 6 years ago #

    Uninstall WP-Polls and try to install it again.

  5. Danny Albeck
    Member
    Posted 6 years ago #

    Still not working =(

  6. Danny Albeck
    Member
    Posted 6 years ago #

    ok, kind of a solution,

    If I use the [poll id="2"] command it displays the active poll, but if I use the HTML editor and put: <?php get_poll(2);?> it works. The only thing I am afraid of is my client not knowing how to do this.

  7. Lester Chan
    Member
    Posted 6 years ago #

    Did you use the HTML editor to put [poll id="2"] by right you should.

  8. Danny Albeck
    Member
    Posted 6 years ago #

    Yup, tried both "Visual" and "HTML". Is there anywhere in the code of the plugin I can edit the button to enter in the PHP command line instead of [poll id=""] ??

  9. Lester Chan
    Member
    Posted 6 years ago #

    Weird, I just tested and it works fine for me. Are you able to reproduce this issue on a fresh copy of WP-Polls and WP 2.5.1?

    You can try editing polls-admin-js I think. After that you need to packed the JS using Dean Packer.

  10. Danny Albeck
    Member
    Posted 6 years ago #

    I am assuming this is the code here:

    // Function: Insert Poll Quick Tag
    
    function insertPoll(where, myField) {
    
    	var poll_id = prompt(polls_admin_text_enter_poll_id);
    
    	while(isNaN(poll_id)) {
    
    		poll_id = prompt(polls_admin_text_enter_poll_id_again);
    
    	}
    
    	if (poll_id > 0) {
    
    		if(where == 'code') {
    
    			edInsertContent(myField, '[poll id="' + poll_id + '"]');
    
    		} else {
    
    			return '[poll id="' + poll_id + '"]';
    
    		}
    
    	}
    
    }

    Would you be able to assist me here with entering in the PHP command?

  11. Lester Chan
    Member
    Posted 6 years ago #

    bingo!

    edInsertContent(myField, '<?php get_poll(' + poll_id + '); ?>');

    return '<?php get_poll(' + poll_id + '); ?>';

  12. Danny Albeck
    Member
    Posted 6 years ago #

    Cool, I will try it out when I get home. You mentioned something about packing, where do I get this?

  13. Lester Chan
    Member
    Posted 6 years ago #

    After you edit it,

    Go to http://dean.edwards.name/packer/, paste the WHOLE file javascript code into the field.

    Checked "Base62 encode" and "Shrink variables" and then copy the output to polls-admin-js-packed.js overwriting the only line that is being there.

Topic Closed

This topic has been closed to new replies.

About this Topic