diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-03-30 09:07:43 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-03-30 09:07:43 +0200 |
commit | 6822415ee2efd4e2d3e5458c36cd5f582887969a (patch) | |
tree | 30b7aaed9e4d8b56e3a062c95a92d8d276d027b3 /include | |
parent | e06e64823fbecbe67bcf59897ecad6b9c402744e (diff) | |
parent | 6d0e1b0e07f26ee07d9f53732daab8ade12566d0 (diff) | |
download | volse-hubzilla-6822415ee2efd4e2d3e5458c36cd5f582887969a.tar.gz volse-hubzilla-6822415ee2efd4e2d3e5458c36cd5f582887969a.tar.bz2 volse-hubzilla-6822415ee2efd4e2d3e5458c36cd5f582887969a.zip |
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'include')
-rw-r--r-- | include/channel.php | 15 | ||||
-rw-r--r-- | include/hubloc.php | 3 | ||||
-rw-r--r-- | include/text.php | 8 |
3 files changed, 20 insertions, 6 deletions
diff --git a/include/channel.php b/include/channel.php index c94f5c657..460c818da 100644 --- a/include/channel.php +++ b/include/channel.php @@ -1573,14 +1573,25 @@ function advanced_profile() { $profile['howlong'] = relative_date(App::$profile['howlong'], t('for %1$d %2$s')); } + if(App::$profile['keywords']) { + $keywords = str_replace(',',' ', App::$profile['keywords']); + $keywords = str_replace(' ',' ', $keywords); + $karr = explode(' ', $keywords); + if($karr) { + for($cnt = 0; $cnt < count($karr); $cnt ++) { + $karr[$cnt] = '<a href="' . z_root() . '/directory/f=&keywords=' . trim($karr[$cnt]) . '">' . $karr[$cnt] . '</a>'; + } + } + $profile['keywords'] = array( t('Tags:'), implode(' ', $karr)); + } + + if(App::$profile['sexual']) $profile['sexual'] = array( t('Sexual Preference:'), App::$profile['sexual'] ); if(App::$profile['homepage']) $profile['homepage'] = array( t('Homepage:'), linkify(App::$profile['homepage']) ); if(App::$profile['hometown']) $profile['hometown'] = array( t('Hometown:'), linkify(App::$profile['hometown']) ); - if(App::$profile['keywords']) $profile['keywords'] = array( t('Tags:'), App::$profile['keywords']); - if(App::$profile['politic']) $profile['politic'] = array( t('Political Views:'), App::$profile['politic']); if(App::$profile['religion']) $profile['religion'] = array( t('Religion:'), App::$profile['religion']); diff --git a/include/hubloc.php b/include/hubloc.php index 0d1a2e560..33d5dcbb2 100644 --- a/include/hubloc.php +++ b/include/hubloc.php @@ -270,7 +270,8 @@ function locations_by_netid($netid) { dbesc($netid) ); - return array_elm_to_str($locs,'location',', '); + + return array_elm_to_str($locs,'location',', ','trim_and_unpunify'); } diff --git a/include/text.php b/include/text.php index f9cefd020..f634f0d55 100644 --- a/include/text.php +++ b/include/text.php @@ -2189,13 +2189,13 @@ function ids_to_querystr($arr,$idx = 'id',$quote = false) { * @returns string */ -function array_elm_to_str($arr,$elm,$delim = ',') { +function array_elm_to_str($arr,$elm,$delim = ',',$each = 'trim') { $tmp = []; if($arr && is_array($arr)) { foreach($arr as $x) { if(is_array($x) && array_key_exists($elm,$x)) { - $z = trim($x[$elm]); + $z = $each($x[$elm]); if(($z) && (! in_array($z,$tmp))) { $tmp[] = $z; } @@ -2205,7 +2205,9 @@ function array_elm_to_str($arr,$elm,$delim = ',') { return implode($delim,$tmp); } - +function trim_and_unpunify($s) { + return unpunify(trim($s)); +} /** |