- while ($rr = dba::fetch($r)) {
- $itemurl= '';
-
- $itemurl = (($rr['addr'] != "") ? $rr['addr'] : $rr['profile_url']);
-
- $profile_link = 'profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']);
-
- $pdesc = (($rr['pdesc']) ? $rr['pdesc'] . '<br />' : '');
-
- $details = '';
- if (strlen($rr['locality'])) {
- $details .= $rr['locality'];
- }
- if (strlen($rr['region'])) {
- if (strlen($rr['locality'])) {
- $details .= ', ';
- }
- $details .= $rr['region'];
- }
- if (strlen($rr['country-name'])) {
- if (strlen($details)) {
- $details .= ', ';
- }
- $details .= $rr['country-name'];
- }
-// if(strlen($rr['dob'])) {
-// if(($years = age($rr['dob'],$rr['timezone'],'')) != 0)
-// $details .= '<br />' . L10n::t('Age: ') . $years ;
-// }
-// if(strlen($rr['gender']))
-// $details .= '<br />' . L10n::t('Gender: ') . $rr['gender'];
-
- $profile = $rr;
-
- if ((x($profile, 'address') == 1)
- || (x($profile, 'locality') == 1)
- || (x($profile, 'region') == 1)
- || (x($profile, 'postal-code') == 1)
- || (x($profile, 'country-name') == 1)
- ) {
- $location = L10n::t('Location:');
- }
-
- $gender = ((x($profile, 'gender') == 1) ? L10n::t('Gender:') : false);
- $marital = ((x($profile, 'marital') == 1) ? L10n::t('Status:') : false);
- $homepage = ((x($profile, 'homepage') == 1) ? L10n::t('Homepage:') : false);
- $about = ((x($profile, 'about') == 1) ? L10n::t('About:') : false);
-
- $location_e = $location;
-
- $photo_menu = [
- 'profile' => [L10n::t("View Profile"), Profile::zrl($profile_link)]
- ];
-
- $entry = [
- 'id' => $rr['id'],
- 'url' => $profile_link,
- 'itemurl' => $itemurl,
- 'thumb' => proxy_url($rr[$photo], false, PROXY_SIZE_THUMB),
- 'img_hover' => $rr['name'],
- 'name' => $rr['name'],
- 'details' => $details,
- 'account_type' => Contact::getAccountType($rr),
- 'profile' => $profile,
- 'location' => $location_e,
- 'tags' => $rr['pub_keywords'],
- 'gender' => $gender,
- 'pdesc' => $pdesc,
- 'marital' => $marital,
- 'homepage' => $homepage,
- 'about' => $about,
- 'photo_menu' => $photo_menu,
-
- ];
-
- $arr = ['contact' => $rr, 'entry' => $entry];
-
- Addon::callHooks('directory_item', $arr);
-
- unset($profile);
- unset($location);
-
- if (!$arr['entry']) {
- continue;
- }
-
- $entries[] = $arr['entry'];