extend the directory profiles a bit more

This commit is contained in:
friendica 2013-12-25 01:57:04 -08:00
parent 48f882c34b
commit fe00e9b261
6 changed files with 40 additions and 4 deletions

View File

@ -167,6 +167,10 @@ function syncdirs($uid) {
$profile['region'] = $p[0]['region']; $profile['region'] = $p[0]['region'];
$profile['postcode'] = $p[0]['postal_code']; $profile['postcode'] = $p[0]['postal_code'];
$profile['country'] = $p[0]['country_name']; $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']) { if($p[0]['keywords']) {
$tags = array(); $tags = array();
$k = explode(' ',$p[0]['keywords']); $k = explode(' ',$p[0]['keywords']);

View File

@ -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_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_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(); $clean = array();
if(array_key_exists('keywords',$profile) and is_array($profile['keywords'])) { if(array_key_exists('keywords',$profile) and is_array($profile['keywords'])) {
import_directory_keywords($hash,$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_region = '%s',
xprof_postcode = '%s', xprof_postcode = '%s',
xprof_country = '%s', xprof_country = '%s',
xprof_about = '%s',
xprof_homepage = '%s',
xprof_hometown = '%s',
xprof_keywords = '%s' xprof_keywords = '%s'
where xprof_hash = '%s' limit 1", where xprof_hash = '%s' limit 1",
dbesc($arr['xprof_desc']), 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_region']),
dbesc($arr['xprof_postcode']), dbesc($arr['xprof_postcode']),
dbesc($arr['xprof_country']), dbesc($arr['xprof_country']),
dbesc($arr['xprof_about']),
dbesc($arr['xprof_homepage']),
dbesc($arr['xprof_hometown']),
dbesc($arr['xprof_keywords']), dbesc($arr['xprof_keywords']),
dbesc($arr['xprof_hash']) dbesc($arr['xprof_hash'])
); );
@ -1712,7 +1722,7 @@ function import_directory_profile($hash,$profile,$addr,$ud_flags = 1, $suppress_
else { else {
$update = true; $update = true;
logger('import_directory_profile: new profile'); 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_hash']),
dbesc($arr['xprof_desc']), dbesc($arr['xprof_desc']),
dbesc($arr['xprof_dob']), 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_region']),
dbesc($arr['xprof_postcode']), dbesc($arr['xprof_postcode']),
dbesc($arr['xprof_country']), dbesc($arr['xprof_country']),
dbesc($arr['xprof_about']),
dbesc($arr['xprof_homepage']),
dbesc($arr['xprof_hometown']),
dbesc($arr['xprof_keywords']) dbesc($arr['xprof_keywords'])
); );
} }

View File

@ -1,6 +1,7 @@
<?php <?php
require_once('include/dir_fns.php'); require_once('include/dir_fns.php');
require_once('include/bbcode.php');
function dirprofile_init(&$a) { function dirprofile_init(&$a) {
@ -108,9 +109,10 @@ function dirprofile_init(&$a) {
$marital = ((x($profile,'marital') == 1) ? t('Status: ') . $profile['marital'] : False); $marital = ((x($profile,'marital') == 1) ? t('Status: ') . $profile['marital'] : False);
$sexual = ((x($profile,'sexual') == 1) ? t('Sexual Preference: ') . $profile['sexual'] : 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'] : ''); $keywords = ((x($profile,'keywords')) ? $profile['keywords'] : '');
if($keywords) { if($keywords) {
@ -153,6 +155,7 @@ function dirprofile_init(&$a) {
'$pdesc' => $pdesc, '$pdesc' => $pdesc,
'$marital' => $marital, '$marital' => $marital,
'$homepage' => $homepage, '$homepage' => $homepage,
'$hometown' => $hometown,
'$about' => $about, '$about' => $about,
'$kw' => (($out) ? t('Keywords: ') : ''), '$kw' => (($out) ? t('Keywords: ') : ''),
'$keywords' => $out, '$keywords' => $out,

View File

@ -207,6 +207,9 @@ function dirsearch_content(&$a) {
$entry['gender'] = $rr['xprof_gender']; $entry['gender'] = $rr['xprof_gender'];
$entry['marital'] = $rr['xprof_marital']; $entry['marital'] = $rr['xprof_marital'];
$entry['sexual'] = $rr['xprof_sexual']; $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']; $entry['keywords'] = $rr['xprof_keywords'];
$entries[] = $entry; $entries[] = $entry;

View File

@ -126,12 +126,16 @@ function zfinger_init(&$a) {
$profile['region'] = $p[0]['region']; $profile['region'] = $p[0]['region'];
$profile['postcode'] = $p[0]['postal_code']; $profile['postcode'] = $p[0]['postal_code'];
$profile['country'] = $p[0]['country_name']; $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']) { if($p[0]['keywords']) {
$tags = array(); $tags = array();
$k = explode(' ',$p[0]['keywords']); $k = explode(' ',$p[0]['keywords']);
if($k) { if($k) {
foreach($k as $kk) { foreach($k as $kk) {
if(trim($kk)) { if(trim($kk," \t\n\r\0\x0B,")) {
$tags[] = trim($kk," \t\n\r\0\x0B,"); $tags[] = trim($kk," \t\n\r\0\x0B,");
} }
} }

View File

@ -18,6 +18,15 @@
{{if $sexual}} {{if $sexual}}
<div class="directory-sexual">{{$sexual}} </div> <div class="directory-sexual">{{$sexual}} </div>
{{/if}} {{/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}} {{if $kw}}
<div class="directory-keywords">{{$kw}} {{$keywords}}</div> <div class="directory-keywords">{{$kw}} {{$keywords}}</div>
{{/if}} {{/if}}