X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fdirectory.php;h=8ed4c2200776ab49d43895dffd6e76a107e8b2ef;hb=2aad62190fd2c0d85e636d01b7e6607a2510906b;hp=fa3a89e45a7dac0e810f9236bddc6d18f1726117;hpb=6e981ed798f8938ce7f0de91d523b1ba6359381c;p=friendica.git
diff --git a/mod/directory.php b/mod/directory.php
index fa3a89e45a..8ed4c22007 100644
--- a/mod/directory.php
+++ b/mod/directory.php
@@ -6,6 +6,8 @@ function directory_init(&$a) {
if(local_user()) {
require_once('include/contact_widgets.php');
+ $a->page['aside'] .= follow_widget();
+
$a->page['aside'] .= findpeople_widget();
}
@@ -31,7 +33,7 @@ function directory_content(&$a) {
require_once("mod/proxy.php");
if((get_config('system','block_public')) && (! local_user()) && (! remote_user()) ||
- (get_config('system','block_local_dir')) && (! local_user()) && (! remote_user())) {
+ (get_config('system','block_local_dir')) && (! local_user()) && (! remote_user())) {
notice( t('Public access denied.') . EOL);
return;
}
@@ -44,27 +46,12 @@ function directory_content(&$a) {
else
$search = ((x($_GET,'search')) ? notags(trim(rawurldecode($_GET['search']))) : '');
- $tpl = get_markup_template('directory_header.tpl');
-
- $globaldir = '';
- $gdirpath = get_config('system','directory');
- if(strlen($gdirpath)) {
- $globaldir = '
';
+ $gdirpath = '';
+ $dirurl = get_config('system','directory');
+ if(strlen($dirurl)) {
+ $gdirpath = zrl($dirurl,true);
}
- $admin = '';
-
- $o .= replace_macros($tpl, array(
- '$search' => $search,
- '$globaldir' => $globaldir,
- '$desc' => t('Find on this site'),
- '$admin' => $admin,
- '$finding' => (strlen($search) ? '' . t('Finding: ') . "'" . $search . "'" . '
' : ""),
- '$sitedir' => t('Site Directory'),
- '$submit' => t('Find')
- ));
-
if($search) {
$search = dbesc($search);
@@ -159,8 +146,6 @@ function directory_content(&$a) {
$about = ((x($profile,'about') == 1) ? t('About:') : False);
- $tpl = get_markup_template('directory_item.tpl');
-
if($a->theme['template_engine'] === 'internal') {
$location_e = template_escape($location);
}
@@ -168,23 +153,23 @@ function directory_content(&$a) {
$location_e = $location;
}
- $entry = replace_macros($tpl,array(
- '$id' => $rr['id'],
- '$profile_link' => $profile_link,
- '$photo' => proxy_url($a->get_cached_avatar_image($rr[$photo])),
- '$alt_text' => $rr['name'],
- '$name' => $rr['name'],
- '$details' => $pdesc . $details,
- '$page_type' => $page_type,
- '$profile' => $profile,
- '$location' => $location_e,
- '$gender' => $gender,
- '$pdesc' => $pdesc,
- '$marital' => $marital,
- '$homepage' => $homepage,
- '$about' => $about,
-
- ));
+ $entry = array(
+ 'id' => $rr['id'],
+ 'url' => $profile_link,
+ 'thumb' => proxy_url($a->get_cached_avatar_image($rr[$photo]), false, PROXY_SIZE_THUMB),
+ 'img_hover' => $rr['name'],
+ 'name' => $rr['name'],
+ 'details' => $pdesc . $details,
+ 'page_type' => $page_type,
+ 'profile' => $profile,
+ 'location' => $location_e,
+ 'gender' => $gender,
+ 'pdesc' => $pdesc,
+ 'marital' => $marital,
+ 'homepage' => $homepage,
+ 'about' => $about,
+
+ );
$arr = array('contact' => $rr, 'entry' => $entry);
@@ -193,12 +178,27 @@ function directory_content(&$a) {
unset($profile);
unset($location);
- $o .= $entry;
+ if(! $arr['entry'])
+ continue;
+
+ $entries[] = $arr['entry'];
}
- $o .= "\r\n";
- $o .= paginate($a);
+ $tpl = get_markup_template('directory_header.tpl');
+
+ $o .= replace_macros($tpl, array(
+ '$search' => $search,
+ '$globaldir' => t('Global Directory'),
+ '$gdirpath' => $gdirpath,
+ '$desc' => t('Find on this site'),
+ '$contacts' => $entries,
+ '$finding' => t('Finding:'),
+ '$findterm' => (strlen($search) ? $search : ""),
+ '$title' => t('Site Directory'),
+ '$submit' => t('Find'),
+ '$paginate' => paginate($a),
+ ));
}
else