diff options
author | Paolo T <tuscanhobbit@users.noreply.github.com> | 2014-02-25 16:33:40 +0100 |
---|---|---|
committer | Paolo T <tuscanhobbit@users.noreply.github.com> | 2014-02-25 16:33:40 +0100 |
commit | 0a98f6b878ec89be7282621192d9daf80f125e6c (patch) | |
tree | 718a4771ce1fb86931531226898b0b5d00e4a337 /include/dir_fns.php | |
parent | 34d30e4d7eb48bd801482531a0d775328bd43ab4 (diff) | |
parent | b1021df485fb6129acda5bba616bac10aea75a45 (diff) | |
download | volse-hubzilla-0a98f6b878ec89be7282621192d9daf80f125e6c.tar.gz volse-hubzilla-0a98f6b878ec89be7282621192d9daf80f125e6c.tar.bz2 volse-hubzilla-0a98f6b878ec89be7282621192d9daf80f125e6c.zip |
Merge pull request #1 from friendica/master
Update this fork
Diffstat (limited to 'include/dir_fns.php')
-rw-r--r-- | include/dir_fns.php | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/include/dir_fns.php b/include/dir_fns.php index 0c9a6bd9f..c2e614831 100644 --- a/include/dir_fns.php +++ b/include/dir_fns.php @@ -22,7 +22,8 @@ function dir_sort_links() { function dir_safe_mode() { $observer = get_observer_hash(); - + if (! $observer) + return; if ($observer) $safe_mode = get_xconfig($observer,'directory','safe_mode'); if($safe_mode === '0') @@ -138,12 +139,15 @@ function update_directory_entry($ud) { } +/** + * @function local_dir_update($uid,$force) + * push local channel updates to a local directory server + * + */ +function local_dir_update($uid,$force) { - -function syncdirs($uid) { - - logger('syncdirs', LOGGER_DEBUG); + logger('local_dir_update', LOGGER_DEBUG); $p = q("select channel.channel_hash, channel_address, channel_timezone, profile.* from profile left join channel on channel_id = uid where uid = %d and is_default = 1", intval($uid) @@ -166,6 +170,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']); @@ -200,10 +208,10 @@ function syncdirs($uid) { } + $address = $p[0]['channel_address'] . '@' . get_app()->get_hostname(); if(perm_is_allowed($uid,'','view_profile')) { - import_directory_profile($hash,$profile); - + import_directory_profile($hash,$profile,$address,0); } else { // they may have made it private @@ -216,8 +224,8 @@ function syncdirs($uid) { } } - $ud_hash = random_string(); - update_modtime($ud_hash,$hash,$p[0]['channel_address'] . '@' . get_app()->get_hostname(),1); + $ud_hash = random_string() . '@' . get_app()->get_hostname(); + update_modtime($hash,$ud_hash,$p[0]['channel_address'] . '@' . get_app()->get_hostname(),(($force) ? (-1) : 1)); } |