Support » Plugin: Participants Database » User search with logic operators

  • Hi,

    Thank you for this great plugin. For showing the list in the Front End, I am using the following shortcode:

    [pdb_list search=true sort=true display_count=true template=detailed list_limit=10]

    When the user searches “blue”, all occurrencies of blue will be filtered. However, how could I make that the user searches “blue” AND; OR; AND/OR “seven” for “colour” and “number” fields? This type of searching is in the Back End, but not in the Front End.


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


    The frontend search I provide is pretty bare-bones. If you want something more complex, you have to code your own search function. I can supply you with some details of you’re ready to do that.

    Thanks for the answer. I would be happy to do it myself if you could help me.


    Plugin Author xnau webdesign


    OK, well the basic idea is that you can put the shortcode into a template using the “do_shortcode” function. That will allow you to build your filter statement using supplied variables. First, create a form that uses your search logic. This form will submit to the page where the shortcode is. When the shortcode is displayed, it uses the submitted values to build the filter statement….for instance if you wanted to look for a name in either of two states:

    <?php echo do_shortcode('[pdb_list filter="last_name=' . $_POST['last_name'] . '&state=' . $_POST['state1'] . '|state=' . $_POST['state2'] . '"]') ?>

    There’s other ways of doing it, but that should get you started on the simplest method.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘User search with logic operators’ is closed to new replies.