CMS MADE SIMPLE FORGE

CGUserDirectory

 

[#6932] Searching on multiple properties

avatar
Created By: Nik (NikNak)
Date Submitted: Thu Oct 06 06:17:36 -0400 2011

Assigned To: Robert Campbell (calguy1000)
Version: 1.2.6
CMSMS Version: None
Severity: Major
Resolution: Fixed
State: Closed
Summary:
Searching on multiple properties
Detailed Description:
Hi Robert

With regard to this problem,
http://forum.cmsmadesimple.org/viewtopic.php?f=7&t=57118

I have made the code work (for me) like this AROUND LINE 177 of
action.do_search.php

//	THIS IS WHAT IT WAS BEFORE 
//	$joins[] = 'LEFT JOIN '.cms_db_prefix().'module_feusers_properties P ON U.id
= P.userid';
//	foreach( $searchdata as $propname => $propval )
//	  {
//	    $where[] = '(P.title = ? AND P.data REGEXP ?)';
//	    $qparms[] = $propname;
//	    $qparms[] = $propval;
//	  }


// HACK      
if( $allany == 'all' ){
$loopycount = 0;
	foreach( $searchdata as $propname => $propval )
	  {$loopycount = $loopycount +1;
$joins[] = 'LEFT JOIN '.cms_db_prefix().'module_feusers_properties
P'.$loopycount.' ON U.id = P'.$loopycount.'.userid';
$where[] = '(P'.$loopycount.'.title = ? AND P'.$loopycount.'.data REGEXP
?)';
	    $qparms[] = $propname;
	    $qparms[] = $propval;
	  }

} else {
$joins[] = 'LEFT JOIN '.cms_db_prefix().'module_feusers_properties P ON U.id =
P.userid';
	foreach( $searchdata as $propname => $propval )
	  {	
	    $where[] = '(P.title = ? AND P.data REGEXP ?)';
	    $qparms[] = $propname;
	    $qparms[] = $propval;
	  }
}



I am no coder - so this may not be the best way to achieve the result - I just
thought it might help for you to be aware of the problem.

Many thanks for your ongoing work

Nik



History

Comments
avatar
Date: 2012-01-12 21:47
Posted By: Robert Campbell (calguy1000)

fixed in svn
      
avatar
Date: 2012-01-13 04:34
Posted By: Nik (NikNak)

Thanks again Robert 
      
Updates

Updated: 2014-08-23 11:21
cmsms_version_id: 29050 => -1
state: Open => Closed

Updated: 2012-01-12 21:47
resolution_id: => 7