X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fdirectory.php;h=9e004ab5d8b41c1e2a28bb630aa95618f7585998;hb=d0dfcc71a82ac423db68a12fd2eaf6d13cb18e1f;hp=f3fbb9eb77cb7834af4a3d5f553e418dbefec160;hpb=d2280d4120ca09ff5f3013e961a1f43bb5244cc6;p=friendica.git diff --git a/mod/directory.php b/mod/directory.php index f3fbb9eb77..9e004ab5d8 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -1,6 +1,8 @@ set_pager_itemspage(60); if(local_user()) { @@ -9,30 +11,24 @@ function directory_init(App &$a) { $a->page['aside'] .= findpeople_widget(); $a->page['aside'] .= follow_widget(); - } else { unset($_SESSION['theme']); unset($_SESSION['mobile-theme']); } - - } - -function directory_post(App &$a) { +function directory_post(App $a) { if(x($_POST,'search')) $a->data['search'] = $_POST['search']; } - - -function directory_content(App &$a) { +function directory_content(App $a) { global $db; require_once("mod/proxy.php"); - if((get_config('system','block_public')) && (! local_user()) && (! remote_user()) || + if((get_config('system','block_public')) && (! local_user()) && (! remote_user()) || (get_config('system','block_local_dir')) && (! local_user()) && (! remote_user())) { notice( t('Public access denied.') . EOL); return; @@ -75,7 +71,7 @@ function directory_content(App &$a) { $publish = ((get_config('system','publish_all')) ? '' : " AND `publish` = 1 " ); - $r = $db->q("SELECT COUNT(*) AS `total` FROM `profile` + $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 (dbm::is_result($r)) @@ -85,11 +81,11 @@ function directory_content(App &$a) { $limit = intval($a->pager['start']).",".intval($a->pager['itemspage']); - $r = $db->q("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `user`.`nickname`, `user`.`timezone` , `user`.`page-flags`, + $r = q("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `user`.`nickname`, `user`.`timezone` , `user`.`page-flags`, `contact`.`addr`, `contact`.`url` AS profile_url FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` LEFT JOIN `contact` ON `contact`.`uid` = `user`.`uid` - WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 AND `contact`.`self` $sql_extra $order LIMIT ".$limit); + WHERE `is-default` $publish AND `user`.`blocked` = 0 AND `contact`.`self` $sql_extra $order LIMIT ".$limit); if (dbm::is_result($r)) { if (in_array('small', $a->argv)) { @@ -124,7 +120,7 @@ function directory_content(App &$a) { } // if(strlen($rr['dob'])) { // if(($years = age($rr['dob'],$rr['timezone'],'')) != 0) -// $details .= '
' . t('Age: ') . $years ; +// $details .= '
' . t('Age: ') . $years ; // } // if(strlen($rr['gender'])) // $details .= '
' . t('Gender: ') . $rr['gender'];