diff options
author | friendica <info@friendica.com> | 2013-12-25 01:57:04 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-12-25 01:57:04 -0800 |
commit | fe00e9b2615dbc06ee0db82ca2c4334baa64e258 (patch) | |
tree | cd940d1b5b9aacf5455d92e95a2e324fbdffd546 | |
parent | 48f882c34b737205451a28da1238a38ec0d4af00 (diff) | |
download | volse-hubzilla-fe00e9b2615dbc06ee0db82ca2c4334baa64e258.tar.gz volse-hubzilla-fe00e9b2615dbc06ee0db82ca2c4334baa64e258.tar.bz2 volse-hubzilla-fe00e9b2615dbc06ee0db82ca2c4334baa64e258.zip |
extend the directory profiles a bit more
-rw-r--r-- | include/dir_fns.php | 4 | ||||
-rw-r--r-- | include/zot.php | 15 | ||||
-rw-r--r-- | mod/dirprofile.php | 7 | ||||
-rw-r--r-- | mod/dirsearch.php | 3 | ||||
-rw-r--r-- | mod/zfinger.php | 6 | ||||
-rwxr-xr-x | 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 @@ <?php require_once('include/dir_fns.php'); +require_once('include/bbcode.php'); function dirprofile_init(&$a) { @@ -108,9 +109,10 @@ function dirprofile_init(&$a) { $marital = ((x($profile,'marital') == 1) ? t('Status: ') . $profile['marital'] : False); $sexual = ((x($profile,'sexual') == 1) ? t('Sexual Preference: ') . $profile['sexual'] : False); -// $homepage = ((x($profile,'homepage') == 1) ? t('Homepage: ') . $profile['homepage'] : False); + $homepage = ((x($profile,'homepage') == 1) ? t('Homepage: ') . linkify($profile['homepage']) : False); + $hometown = ((x($profile,'hometown') == 1) ? t('Hometown: ') . $profile['hometown'] : False); -// $about = ((x($profile,'about') == 1) ? t('About: ') . $profile['about'] : False); + $about = ((x($profile,'about') == 1) ? t('About: ') . bbcode($profile['about']) : False); $keywords = ((x($profile,'keywords')) ? $profile['keywords'] : ''); if($keywords) { @@ -153,6 +155,7 @@ function dirprofile_init(&$a) { '$pdesc' => $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}} <div class="directory-sexual">{{$sexual}} </div> {{/if}} +{{if $homepage}} +<div class="directory-homepage">{{$homepage}} </div> +{{/if}} +{{if $hometown}} +<div class="directory-hometown">{{$hometown}} </div> +{{/if}} +{{if $about}} +<div class="directory-about">{{$about}} </div> +{{/if}} {{if $kw}} <div class="directory-keywords">{{$kw}} {{$keywords}}</div> {{/if}} |