Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author xnau webdesign

    (@xnau)

    It certainly is, if you’re familiar with constructing queries, that’s a good way to go. If you want to use the plugin to show the results, however, you will need to use a filter so the query is used by the plugin to generate the results.

    Take a look at the plugin API under ‘pdb-list_query’

    Thread Starter Ghostflasher

    (@ghostflasher)

    Thanks xnau!

    I found that solution too and was able to finish my multi column search. Next on the list is multilanguage support… Let’s get to work ??

    Thanks for the great plugin… I just donated a couple of bucks.

    Plugin Author xnau webdesign

    (@xnau)

    Thank you!

    Hi Ghostflasher,

    We face the same challenge of searching multiple fields. Will you share your solution with us?

    Thank you in advance.

    Thread Starter Ghostflasher

    (@ghostflasher)

    Hi Powerjob,

    sorry for the late reply. I was a bit in a hurry to complete my work on time.
    Ok, It is actually pretty easy, when u know how to do it. First you have create your own search form. U have to add brackets to search_field -> search_field[] and value -> value[]

    Use the pdb_search_custom and build there your form. Leave the
    $this->search_sort_form_top(); active and delete the rest. So u can be sure, that the nonce and the start of the form is correct.

    Then add your fields like that:

    <select name='search_field[]' id='pdb-search_field_select'  class='search-item' style='display:none;'>
                      <ul><option value='columnName' selected >someValue</option></ul>
              </select>
                            <input type='checkbox' name='value[]' value='someValue'> someValue</input>

    Be sure to add the search_field selector before every searchfield. That way you can submit in what field you want to search with the following searchinput.

    Don’t forget to add the submit button in the end of the form, that was opened by the search_sort_form_top() function. Close the form properly.

    Now u only have to readout the $_POST in the displaying list file. Read out the search_field and the submitted values and hook them up with the [pdb_list filter=”*searchterms*”] shortcode.

    e.g.
    $filter = "[pdb_list filter='city~london']";

    then

    `echo do_shortcode($filter);’

    I guess it’s a pretty dirty walkaround but it seems to work and I didn’t had to alter any file from the plugin. So when there are any updates for the plugin this should still work.

    hope u can figure it out.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Custom MySQL queries’ is closed to new replies.