some prep work for the next big feature push

This commit is contained in:
nobody 2020-08-12 19:06:13 -07:00
parent 777cafa6ee
commit dbaa4df7e0
2 changed files with 48 additions and 0 deletions

View file

@ -1713,6 +1713,23 @@ class Activity {
}
}
$keywords = [];
if (is_array($person_obj['tag'])) {
foreach ($person_obj['tag'] as $t) {
if (is_array($t) && isset($t['type']) && $t['type'] === 'Hashtag') {
if (isset($t['name'])) {
$tag = escape_tags((substr($t['name'],0,1) === '#') ? substr($t['name'],1) : $t['name']);
if ($tag) {
$keywords[] = $tag;
}
}
}
}
}
$about = ((isset($person_obj['summary'])) ? html2bbcode($person_obj['summary']) : EMPTY_STR);
$r = q("select * from xchan where xchan_hash = '%s' limit 1",
dbesc($url)
);

View file

@ -289,4 +289,35 @@ function xchan_change_key($oldx,$newx,$data) {
foreach($acls as $k => $v) {
xchan_keychange_acl($k,$v,$oldx,$newx);
}
}
function xprof_store_lowlevel($profile) {
if (! $profile['hash']) {
return false;
}
$store = [
$arr['xprof_hash'] => $profile['hash'],
$arr['xprof_dob'] => (($profile['birthday'] === '0000-00-00') ? $profile['birthday'] : datetime_convert('','',$profile['birthday'],'Y-m-d')),
$arr['xprof_age'] => (($profile['age']) ? intval($profile['age']) : 0),
$arr['xprof_desc'] => (($profile['description']) ? htmlspecialchars($profile['description'], ENT_COMPAT,'UTF-8',false) : ''),
$arr['xprof_gender'] => (($profile['gender']) ? htmlspecialchars($profile['gender'], ENT_COMPAT,'UTF-8',false) : ''),
$arr['xprof_marital'] => (($profile['marital']) ? htmlspecialchars($profile['marital'], ENT_COMPAT,'UTF-8',false) : ''),
$arr['xprof_sexual'] => (($profile['sexual']) ? htmlspecialchars($profile['sexual'], ENT_COMPAT,'UTF-8',false) : ''),
$arr['xprof_locale'] => (($profile['locale']) ? htmlspecialchars($profile['locale'], ENT_COMPAT,'UTF-8',false) : ''),
$arr['xprof_region'] => (($profile['region']) ? htmlspecialchars($profile['region'], 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_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) : ''),
$arr['xprof_keywords'] => (($profile['keywords']) ? htmlspecialchars($profile['keywords'], ENT_COMPAT,'UTF-8',false) : ''),
];
return create_table_from_array('xchan',$store);
}