Results 1 to 5 of 5

Thread: Fix for Checkbox Distinct Values OR Logic

  1. #1
    Join Date
    May 2008
    Posts
    4

    Default Fix for Checkbox Distinct Values OR Logic

    I was having a problem with the or logic search not working for the checkboxes distinct values in version 2.5.6. I edited the search.inc.php to add _or to the checkbox name. I have tested this with version 2.5.6 and with CMS Realty. Here is the revised code for case 'checkbox_or':

    PHP Code:
    case 'checkbox_or':
        
    $display .= '<tr><td class="searchpage_field_caption">'.$browse_caption.'</td>';
        
    $display .= '<td align="left">';
        while (!
    $recordSet->EOF) {
            
    $field_output $misc->make_db_unsafe ($recordSet->fields['listingsdbelements_field_value']);
            
    $num_type '';
            if (
    $config['configured_show_count'] == 1) {
                
    $num_type $recordSet->fields['num_type'];
                
    $num_type "($num_type)";
            }
            if(
    $dateFormat==TRUE){
                
    $display .= '<input type="checkbox" name="'.$browse_field_name.'_or[]" value="'.$field_output.'" />'.date($format,$field_output).' '.$num_type.'';
                
    $display .= $config['search_list_separator'];
            }else{
            if (
    $field_type == 'number')
                {
                
    $field_display $misc->international_num_format($field_output$config['number_decimals_number_fields']);
                
    $display .= '<input type="checkbox" name="'.$browse_field_name.'_or[]" value="'.$field_output.'" />'.$field_display.' '.$num_type.'';
                
    $display .= $config['search_list_separator'];
                } else {
                
    $display .= '<input type="checkbox" name="'.$browse_field_name.'_or[]" value="'.$field_output.'" />'.$field_output.' '.$num_type.'';
                
    $display .= $config['search_list_separator'];
                }

            }
            
    $recordSet->MoveNext();
        } 
    // end while
        
    $display .= '</td></tr>';
        break; 

  2. #2
    Join Date
    Jul 2005
    Location
    Sao Paulo, BRAZIL
    Posts
    3,763

    Default Re: Fix for Checkbox Distinct Values OR Logic

    Hi jennifer,

    In fact it is a bug and you could also open a Bug Report - but not needed anymore.
    I have just fixed it at SVN (rev.2395). With the next O-R release (after v.2.5.6) it will be implemented by default. I gave the credits to you.

    Thanks,
    Eduardo
    Last edited by ebmarques; 06-29-2009 at 03:25 PM. Reason: after v.2.5.6 not v.2.4.6

    Open-Realty® DOCs
    We can easily forgive a child who is afraid of the dark; the real tragedy of life is when men are afraid of the light. (Author Unknown)

  3. #3
    Join Date
    Sep 2008
    Location
    Lizella, GA
    Posts
    17

    Default Re: Fix for Checkbox Distinct Values OR Logic

    Jennifer ... thanks for posting this fix. I just changed to the checkbox search and didn't even realize I had the issue until I read your post. The fix is working for me!

  4. #4
    Join Date
    May 2008
    Posts
    4

    Default Re: Fix for Checkbox Distinct Values OR Logic

    Great! I am glad I contribute a tiny bit to this great project.

  5. #5
    Join Date
    Apr 2004
    Posts
    11

    Default Re: Fix for Checkbox Distinct Values OR Logic

    I am running off 2.5.8
    I modified search.inc.php by replacing the case 'checkbox_or': section with this code, but it didn't fix the problem.

    When I use the "distinct list with OR logic" it works fine by using this in the url:

    "City_or[]=City1&City_or[]=city2"

    But when I use the "checkbox list of distinct values with OR logic" the url doesn't include the OR and I get:

    "City%5B%5D=City1&City%5B%5D=City2"

    It works like an "and".

    Is it possible when I upgraded I didn't get all the necessary changed files?

Similar Threads

  1. Replies: 1
    Last Post: 03-15-2008, 04:31 PM
  2. List checkbox values comma separated on search results page?
    By bit in forum General Help (CLOSED)
    Replies: 8
    Last Post: 11-16-2007, 01:31 PM
  3. Distinct list in Quicksearch?
    By bos1970 in forum Addon help, ideas and discussion (CLOSED)
    Replies: 1
    Last Post: 03-14-2007, 04:58 AM
  4. Search with Multiple checkbox values
    By apsona in forum General Help (CLOSED)
    Replies: 26
    Last Post: 11-10-2006, 11:40 AM
  5. Searching - Display of checkbox list of individual values
    By Anonymous in forum HELP (CLOSED)
    Replies: 0
    Last Post: 09-04-2003, 08:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •