From eac29badb2fade43dfe3fd6373ffc675858143dd Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 30 Aug 2012 18:17:38 -0700 Subject: start on contacts/profiles --- mod/directory.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'mod/directory.php') diff --git a/mod/directory.php b/mod/directory.php index 8a5685c9a..4e7626ed5 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -61,19 +61,19 @@ function directory_content(&$a) { if($search) $search = dbesc($search); - $sql_extra = ((strlen($search)) ? " AND MATCH (`profile`.`name`, `user`.`nickname`, `pdesc`, `locality`,`region`,`country-name`,`gender`,`marital`,`sexual`,`about`,`romance`,`work`,`education`,`pub_keywords`,`prv_keywords` ) AGAINST ('$search' IN BOOLEAN MODE) " : ""); + $sql_extra = ((strlen($search)) ? " AND MATCH (`profile`.`name`, `user`.`nickname`, `pdesc`, `locality`,`region`,`country_name`,`gender`,`marital`,`sexual`,`about`,`romance`,`work`,`education`,`pub_keywords`,`prv_keywords` ) AGAINST ('$search' IN BOOLEAN MODE) " : ""); $publish = ((get_config('system','publish_all')) ? '' : " AND `publish` = 1 " ); - $r = q("SELECT COUNT(*) AS `total` FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra "); + $r = q("SELECT COUNT(*) AS `total` FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is_default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra "); if(count($r)) $a->set_pager_total($r[0]['total']); $order = " ORDER BY `name` ASC "; - $r = q("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `user`.`nickname`, `user`.`timezone` , `user`.`page-flags` FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra $order LIMIT %d , %d ", + $r = q("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `user`.`nickname`, `user`.`timezone` , `user`.`page-flags` FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is_default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra $order LIMIT %d , %d ", intval($a->pager['start']), intval($a->pager['itemspage']) ); @@ -99,10 +99,10 @@ function directory_content(&$a) { $details .= ', '; $details .= $rr['region']; } - if(strlen($rr['country-name'])) { + if(strlen($rr['country_name'])) { if(strlen($details)) $details .= ', '; - $details .= $rr['country-name']; + $details .= $rr['country_name']; } if(strlen($rr['dob'])) { if(($years = age($rr['dob'],$rr['timezone'],'')) != 0) @@ -127,8 +127,8 @@ function directory_content(&$a) { if((x($profile,'address') == 1) || (x($profile,'locality') == 1) || (x($profile,'region') == 1) - || (x($profile,'postal-code') == 1) - || (x($profile,'country-name') == 1)) + || (x($profile,'postal_code') == 1) + || (x($profile,'country_name') == 1)) $location = t('Location:'); $gender = ((x($profile,'gender') == 1) ? t('Gender:') : False); -- cgit v1.2.3