aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-06-30 00:49:53 -0700
committerfriendica <info@friendica.com>2013-06-30 00:49:53 -0700
commit9bc5e05d3c7f614a402ea5e8cb1e1d641090f650 (patch)
tree76578b1cc965fab1ea7928930860f263097bd229
parent72f6edd59507797ef4073aed01ca1a0d14fa8cfd (diff)
downloadvolse-hubzilla-9bc5e05d3c7f614a402ea5e8cb1e1d641090f650.tar.gz
volse-hubzilla-9bc5e05d3c7f614a402ea5e8cb1e1d641090f650.tar.bz2
volse-hubzilla-9bc5e05d3c7f614a402ea5e8cb1e1d641090f650.zip
age query in dirsearch
-rw-r--r--mod/dirsearch.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/mod/dirsearch.php b/mod/dirsearch.php
index 5465e11ff..edcac9033 100644
--- a/mod/dirsearch.php
+++ b/mod/dirsearch.php
@@ -32,6 +32,8 @@ function dirsearch_content(&$a) {
$gender = ((x($_REQUEST,'gender')) ? $_REQUEST['gender'] : '');
$marital = ((x($_REQUEST,'marital')) ? $_REQUEST['marital'] : '');
$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
@@ -58,6 +60,14 @@ function dirsearch_content(&$a) {
if($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);
$page = (($_REQUEST['p']) ? intval($_REQUEST['p'] - 1) : 0);
$startrec = (($page+1) * $perpage) - $perpage;