X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mod%2Fdirectory.php;h=411024dc1aace31a38e12b6f735d5a693a5a0fd7;hb=92c4ca091193e571d76a9db7b2d4078e2b3dc473;hp=08354e3a90b5a103643a3e62817d8150c7180689;hpb=2d0a749734bb33be00b9674cb34582c602ff0d74;p=friendica.git diff --git a/mod/directory.php b/mod/directory.php index 08354e3a90..411024dc1a 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -10,9 +10,9 @@ use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Database\DBA; -use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\Profile; +use Friendica\Util\Proxy as ProxyUtils; function directory_init(App $a) { @@ -36,8 +36,6 @@ function directory_post(App $a) function directory_content(App $a) { - require_once("mod/proxy.php"); - if ((Config::get('system', 'block_public') && !local_user() && !remote_user()) || (Config::get('system', 'block_local_dir') && !local_user() && !remote_user()) ) { @@ -61,7 +59,7 @@ function directory_content(App $a) } if ($search) { - $search = dbesc($search); + $search = DBA::escape($search); $sql_extra = " AND ((`profile`.`name` LIKE '%$search%') OR (`user`.`nickname` LIKE '%$search%') OR @@ -78,6 +76,8 @@ function directory_content(App $a) (`profile`.`education` LIKE '%$search%') OR (`profile`.`pub_keywords` LIKE '%$search%') OR (`profile`.`prv_keywords` LIKE '%$search%'))"; + } else { + $sql_extra = ''; } $publish = (Config::get('system', 'publish_all') ? '' : " AND `publish` = 1 " ); @@ -86,7 +86,7 @@ function directory_content(App $a) $cnt = DBA::fetchFirst("SELECT COUNT(*) AS `total` FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is-default` $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed` $sql_extra"); - if (DBM::is_result($cnt)) { + if (DBA::isResult($cnt)) { $a->set_pager_total($cnt['total']); } @@ -101,7 +101,7 @@ function directory_content(App $a) WHERE `is-default` $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed` AND `contact`.`self` $sql_extra $order LIMIT $limit" ); - if (DBM::is_result($r)) { + if (DBA::isResult($r)) { if (in_array('small', $a->argv)) { $photo = 'thumb'; } else { @@ -149,6 +149,8 @@ function directory_content(App $a) || (x($profile, 'country-name') == 1) ) { $location = L10n::t('Location:'); + } else { + $location = ''; } $gender = ((x($profile, 'gender') == 1) ? L10n::t('Gender:') : false); @@ -166,7 +168,7 @@ function directory_content(App $a) 'id' => $rr['id'], 'url' => $profile_link, 'itemurl' => $itemurl, - 'thumb' => proxy_url($rr[$photo], false, PROXY_SIZE_THUMB), + 'thumb' => ProxyUtils::proxifyUrl($rr[$photo], false, ProxyUtils::SIZE_THUMB), 'img_hover' => $rr['name'], 'name' => $rr['name'], 'details' => $details,