• edwardjs

    (@edwardjs)


    I would like an optional secondary text to be used for Poll question. I’d like to Display “Agree” instead of a long question where i am just gauging agreements to an article or statement. The Question would be used for the Archive page but i’d like an optonal text to overide the Question. Also, it could be a Shortcode Parameter which wold be GREAT!

    [democracy id=”1″ QText=”Agree or Disagree”]

    • This topic was modified 4 months ago by edwardjs.
    • This topic was modified 4 months ago by edwardjs.
Viewing 1 replies (of 1 total)
  • Thread Starter edwardjs

    (@edwardjs)

    I Would like to share my solution that may be added in next version.

    // Added post_id filtering to DemocracyPoll Archive [ democracy-archives post_id="211" ]
    // output = Archive listing of all polls in selected post#.
    // modified get_dem_polls() function in theme-functions.php
    //

    ...
    if( isset( $rg->post_id ) ){
    $postID = $rg->post_id; // var created because unable to succesfully use %d in next line..
    $WHERE['post_id'] = $wpdb->prepare('WHERE in_posts LIKE "%'. $postID .'%"', (int) $rg->post_id); //array(1,2,3,4,5));
    //$WHERE['post_id'] = $wpdb->prepare('WHERE in_posts LIKE "%\%d%"', (int) $rg->post_id); //array(1,2,3,4,5));
    }
    //ADD a post_id parm to the rg object
    // 'post_id' => null, // customization

    // Does a Text Search via WHERE LIKE
    // Improvement needed-> value search via SQL WHERE IN;
    // needs correct syntax using an Array with, %d variable substitution

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.