aboutsummaryrefslogtreecommitdiffstats
path: root/mod/directory.php
diff options
context:
space:
mode:
authorStefan Parviainen <saparvia@caterva.eu>2014-11-09 00:18:26 +0100
committerStefan Parviainen <saparvia@caterva.eu>2014-11-09 00:18:26 +0100
commit28f3d7be5a104bc1f1e1eff2e22fd19b4ab3a2d1 (patch)
tree7563f1807a0330cb7ba2a308b4f565dbd74e2ec5 /mod/directory.php
parentb5fad9feefd0f261807222d8a4c42ead6253a65c (diff)
downloadvolse-hubzilla-28f3d7be5a104bc1f1e1eff2e22fd19b4ab3a2d1.tar.gz
volse-hubzilla-28f3d7be5a104bc1f1e1eff2e22fd19b4ab3a2d1.tar.bz2
volse-hubzilla-28f3d7be5a104bc1f1e1eff2e22fd19b4ab3a2d1.zip
New layout for directory
Diffstat (limited to 'mod/directory.php')
-rw-r--r--mod/directory.php56
1 files changed, 49 insertions, 7 deletions
diff --git a/mod/directory.php b/mod/directory.php
index 3d7632ec0..1571efcf5 100644
--- a/mod/directory.php
+++ b/mod/directory.php
@@ -122,6 +122,10 @@ function directory_content(&$a) {
$pdesc = (($rr['description']) ? $rr['description'] . '<br />' : '');
$connect_link = ((local_user()) ? z_root() . '/follow?f=&url=' . urlencode($rr['address']) : '');
+ // Checking status is disabled ATM until someone checks the performance impact more carefully
+ //$online = remote_online_status($rr['address']);
+ $online = '';
+
if(in_array($rr['hash'],$contacts))
$connect_link = '';
@@ -142,8 +146,6 @@ function directory_content(&$a) {
if(($years = age($rr['birthday'],'UTC','')) != 0)
$details .= '<br />' . t('Age: ') . $years ;
}
- if(strlen($rr['gender']))
- $details .= '<br />' . t('Gender: ') . $rr['gender'];
$page_type = '';
@@ -155,13 +157,48 @@ function directory_content(&$a) {
|| (x($profile,'country') == 1))
$location = t('Location:');
- $gender = ((x($profile,'gender') == 1) ? t('Gender:') : False);
+ $gender = ((x($profile,'gender') == 1) ? t('Gender: ') . $profile['gender']: False);
- $marital = ((x($profile,'marital') == 1) ? t('Status:') : False);
+ $marital = ((x($profile,'marital') == 1) ? t('Status: ') . $profile['marital']: False);
- $homepage = ((x($profile,'homepage') == 1) ? t('Homepage:') : False);
-
- $about = ((x($profile,'about') == 1) ? t('About:') : False);
+ $homepage = ((x($profile,'homepage') == 1) ? t('Homepage: ') : False);
+ $homepageurl = ((x($profile,'homepage') == 1) ? $profile['homepage'] : '');
+
+ $hometown = ((x($profile,'hometown') == 1) ? t('Hometown: ') . $profile['hometown'] : False);
+
+ $about = ((x($profile,'about') == 1) ? t('About: ') . $profile['about'] : False);
+
+ $keywords = ((x($profile,'keywords')) ? $profile['keywords'] : '');
+
+logger('keywords: '.$keywords);
+ if($keywords) {
+ $keywords = str_replace(',',' ', $keywords);
+ $keywords = str_replace(' ',' ', $keywords);
+ $karr = explode(' ', $keywords);
+ $out = '';
+ if($karr) {
+ if(local_user()) {
+ $r = q("select keywords from profile where uid = %d and is_default = 1 limit 1",
+ intval(local_user())
+ );
+ if($r) {
+ $keywords = str_replace(',',' ', $r[0]['keywords']);
+ $keywords = str_replace(' ',' ', $keywords);
+ $marr = explode(' ', $keywords);
+ }
+ }
+ foreach($karr as $k) {
+ if(strlen($out))
+ $out .= ', ';
+ if($marr && in_arrayi($k,$marr))
+ $out .= '<strong>' . $k . '</strong>';
+ else
+ $out .= $k;
+ }
+ }
+
+ }
+logger('out: '.$out);
$entry = array(
@@ -179,9 +216,14 @@ function directory_content(&$a) {
'pdesc' => $pdesc,
'marital' => $marital,
'homepage' => $homepage,
+ 'homepageurl' => $homepageurl,
+ 'hometown' => $hometown,
'about' => $about,
'conn_label' => t('Connect'),
'connect' => $connect_link,
+ 'online' => $online,
+ 'kw' => (($out) ? t('Keywords: ') : ''),
+ 'keywords' => $out,
);
$arr = array('contact' => $rr, 'entry' => $entry);