age query in dirsearch
This commit is contained in:
parent
72f6edd595
commit
9bc5e05d3c
@ -32,6 +32,8 @@ function dirsearch_content(&$a) {
|
|||||||
$gender = ((x($_REQUEST,'gender')) ? $_REQUEST['gender'] : '');
|
$gender = ((x($_REQUEST,'gender')) ? $_REQUEST['gender'] : '');
|
||||||
$marital = ((x($_REQUEST,'marital')) ? $_REQUEST['marital'] : '');
|
$marital = ((x($_REQUEST,'marital')) ? $_REQUEST['marital'] : '');
|
||||||
$keywords = ((x($_REQUEST,'keywords')) ? $_REQUEST['keywords'] : '');
|
$keywords = ((x($_REQUEST,'keywords')) ? $_REQUEST['keywords'] : '');
|
||||||
|
$agege = ((x($_REQUEST,'agege')) ? intval($_REQUEST['agege']) : 0 );
|
||||||
|
$agele = ((x($_REQUEST,'agele')) ? intval($_REQUEST['agele']) : 0 );
|
||||||
|
|
||||||
// TODO - a meta search which joins all of these things to one search string
|
// TODO - a meta search which joins all of these things to one search string
|
||||||
|
|
||||||
@ -58,6 +60,14 @@ function dirsearch_content(&$a) {
|
|||||||
if($keywords)
|
if($keywords)
|
||||||
$sql_extra .= " OR xprof_keywords like '" . protect_sprintf( '%' . dbesc($keywords) . '%' ) . "' ";
|
$sql_extra .= " OR xprof_keywords like '" . protect_sprintf( '%' . dbesc($keywords) . '%' ) . "' ";
|
||||||
|
|
||||||
|
// we only support an age range currently. You must set both agege
|
||||||
|
// (greater than or equal) and agele (less than or equal)
|
||||||
|
|
||||||
|
if($agele && $agege) {
|
||||||
|
$sql_extra .= " OR ( xprof_age <= " . intval($agele) . " ";
|
||||||
|
$sql_extra .= " AND xprof_age >= " . intval($agege) . ") ";
|
||||||
|
}
|
||||||
|
|
||||||
$perpage = (($_REQUEST['n']) ? $_REQUEST['n'] : 80);
|
$perpage = (($_REQUEST['n']) ? $_REQUEST['n'] : 80);
|
||||||
$page = (($_REQUEST['p']) ? intval($_REQUEST['p'] - 1) : 0);
|
$page = (($_REQUEST['p']) ? intval($_REQUEST['p'] - 1) : 0);
|
||||||
$startrec = (($page+1) * $perpage) - $perpage;
|
$startrec = (($page+1) * $perpage) - $perpage;
|
||||||
|
Reference in New Issue
Block a user