From fe00e9b2615dbc06ee0db82ca2c4334baa64e258 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 25 Dec 2013 01:57:04 -0800 Subject: extend the directory profiles a bit more --- include/dir_fns.php | 4 ++++ include/zot.php | 15 ++++++++++++++- mod/dirprofile.php | 7 +++++-- mod/dirsearch.php | 3 +++ mod/zfinger.php | 6 +++++- view/tpl/direntry_large.tpl | 9 +++++++++ 6 files changed, 40 insertions(+), 4 deletions(-) diff --git a/include/dir_fns.php b/include/dir_fns.php index 7be0bd4c6..ab8b67985 100644 --- a/include/dir_fns.php +++ b/include/dir_fns.php @@ -167,6 +167,10 @@ function syncdirs($uid) { $profile['region'] = $p[0]['region']; $profile['postcode'] = $p[0]['postal_code']; $profile['country'] = $p[0]['country_name']; + $profile['about'] = $p[0]['about']; + $profile['homepage'] = $p[0]['homepage']; + $profile['hometown'] = $p[0]['hometown']; + if($p[0]['keywords']) { $tags = array(); $k = explode(' ',$p[0]['keywords']); diff --git a/include/zot.php b/include/zot.php index b0d87cea9..9d3e66e40 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1644,6 +1644,10 @@ function import_directory_profile($hash,$profile,$addr,$ud_flags = 1, $suppress_ $arr['xprof_postcode'] = (($profile['postcode']) ? htmlspecialchars($profile['postcode'], ENT_COMPAT,'UTF-8',false) : ''); $arr['xprof_country'] = (($profile['country']) ? htmlspecialchars($profile['country'], ENT_COMPAT,'UTF-8',false) : ''); + $arr['xprof_about'] = (($profile['about']) ? htmlspecialchars($profile['about'], ENT_COMPAT,'UTF-8',false) : ''); + $arr['xprof_homepage'] = (($profile['homepage']) ? htmlspecialchars($profile['homepage'], ENT_COMPAT,'UTF-8',false) : ''); + $arr['xprof_hometown'] = (($profile['hometown']) ? htmlspecialchars($profile['hometown'], ENT_COMPAT,'UTF-8',false) : ''); + $clean = array(); if(array_key_exists('keywords',$profile) and is_array($profile['keywords'])) { import_directory_keywords($hash,$profile['keywords']); @@ -1692,6 +1696,9 @@ function import_directory_profile($hash,$profile,$addr,$ud_flags = 1, $suppress_ xprof_region = '%s', xprof_postcode = '%s', xprof_country = '%s', + xprof_about = '%s', + xprof_homepage = '%s', + xprof_hometown = '%s', xprof_keywords = '%s' where xprof_hash = '%s' limit 1", dbesc($arr['xprof_desc']), @@ -1704,6 +1711,9 @@ function import_directory_profile($hash,$profile,$addr,$ud_flags = 1, $suppress_ dbesc($arr['xprof_region']), dbesc($arr['xprof_postcode']), dbesc($arr['xprof_country']), + dbesc($arr['xprof_about']), + dbesc($arr['xprof_homepage']), + dbesc($arr['xprof_hometown']), dbesc($arr['xprof_keywords']), dbesc($arr['xprof_hash']) ); @@ -1712,7 +1722,7 @@ function import_directory_profile($hash,$profile,$addr,$ud_flags = 1, $suppress_ else { $update = true; logger('import_directory_profile: new profile'); - $x = q("insert into xprof (xprof_hash, xprof_desc, xprof_dob, xprof_age, xprof_gender, xprof_marital, xprof_sexual, xprof_locale, xprof_region, xprof_postcode, xprof_country, xprof_keywords) values ('%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s') ", + $x = q("insert into xprof (xprof_hash, xprof_desc, xprof_dob, xprof_age, xprof_gender, xprof_marital, xprof_sexual, xprof_locale, xprof_region, xprof_postcode, xprof_country, xrpof_about, xprof_homepage, xprof_hometown, xprof_keywords) values ('%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s') ", dbesc($arr['xprof_hash']), dbesc($arr['xprof_desc']), dbesc($arr['xprof_dob']), @@ -1724,6 +1734,9 @@ function import_directory_profile($hash,$profile,$addr,$ud_flags = 1, $suppress_ dbesc($arr['xprof_region']), dbesc($arr['xprof_postcode']), dbesc($arr['xprof_country']), + dbesc($arr['xprof_about']), + dbesc($arr['xprof_homepage']), + dbesc($arr['xprof_hometown']), dbesc($arr['xprof_keywords']) ); } diff --git a/mod/dirprofile.php b/mod/dirprofile.php index 01a0debfc..ba056e864 100644 --- a/mod/dirprofile.php +++ b/mod/dirprofile.php @@ -1,6 +1,7 @@ $pdesc, '$marital' => $marital, '$homepage' => $homepage, + '$hometown' => $hometown, '$about' => $about, '$kw' => (($out) ? t('Keywords: ') : ''), '$keywords' => $out, diff --git a/mod/dirsearch.php b/mod/dirsearch.php index 43cb13470..d1f4761bc 100644 --- a/mod/dirsearch.php +++ b/mod/dirsearch.php @@ -207,6 +207,9 @@ function dirsearch_content(&$a) { $entry['gender'] = $rr['xprof_gender']; $entry['marital'] = $rr['xprof_marital']; $entry['sexual'] = $rr['xprof_sexual']; + $entry['sexual'] = $rr['xprof_about']; + $entry['sexual'] = $rr['xprof_homepage']; + $entry['sexual'] = $rr['xprof_hometown']; $entry['keywords'] = $rr['xprof_keywords']; $entries[] = $entry; diff --git a/mod/zfinger.php b/mod/zfinger.php index aad8e224d..94671271b 100644 --- a/mod/zfinger.php +++ b/mod/zfinger.php @@ -126,12 +126,16 @@ function zfinger_init(&$a) { $profile['region'] = $p[0]['region']; $profile['postcode'] = $p[0]['postal_code']; $profile['country'] = $p[0]['country_name']; + $profile['about'] = $p[0]['about']; + $profile['homepage'] = $p[0]['homepage']; + $profile['hometown'] = $p[0]['hometown']; + if($p[0]['keywords']) { $tags = array(); $k = explode(' ',$p[0]['keywords']); if($k) { foreach($k as $kk) { - if(trim($kk)) { + if(trim($kk," \t\n\r\0\x0B,")) { $tags[] = trim($kk," \t\n\r\0\x0B,"); } } diff --git a/view/tpl/direntry_large.tpl b/view/tpl/direntry_large.tpl index c71dd0eb9..a1800c994 100755 --- a/view/tpl/direntry_large.tpl +++ b/view/tpl/direntry_large.tpl @@ -18,6 +18,15 @@ {{if $sexual}}
{{$sexual}}
{{/if}} +{{if $homepage}} +
{{$homepage}}
+{{/if}} +{{if $hometown}} +
{{$hometown}}
+{{/if}} +{{if $about}} +
{{$about}}
+{{/if}} {{if $kw}}
{{$kw}} {{$keywords}}
{{/if}} -- cgit v1.2.3