From abd58bce6899aff274be2e24db08cca46c4b135b Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 26 Mar 2013 19:37:33 -0700 Subject: set hidden flags on new directory entries, not just existing ones --- include/zot.php | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/zot.php b/include/zot.php index 78978bbf9..5fab76932 100644 --- a/include/zot.php +++ b/include/zot.php @@ -523,9 +523,26 @@ function import_xchan($arr) { } else { $import_photos = true; + + $dirmode = get_config('system','directory_mode'); + + if((($arr['site']['directory_mode'] === 'standalone') || ($dirmode & DIRECTORY_MODE_STANDALONE)) +&& ($arr['site']['url'] != z_root())) + $arr['searchable'] = false; + + $hidden = (1 - intval($arr['searchable'])); + + if($hidden) + $new_flags = XCHAN_FLAGS_HIDDEN; + else + $new_flags = 0; + + + + $x = q("insert into xchan ( xchan_hash, xchan_guid, xchan_guid_sig, xchan_pubkey, xchan_photo_mimetype, - xchan_photo_l, xchan_addr, xchan_url, xchan_connurl, xchan_name, xchan_network, xchan_photo_date, xchan_name_date) - values ( '%s', '%s', '%s', '%s' , '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s') ", + xchan_photo_l, xchan_addr, xchan_url, xchan_connurl, xchan_name, xchan_network, xchan_photo_date, xchan_name_date, xchan_flags) + values ( '%s', '%s', '%s', '%s' , '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d) ", dbesc($xchan_hash), dbesc($arr['guid']), dbesc($arr['guid_sig']), @@ -538,7 +555,8 @@ function import_xchan($arr) { dbesc($arr['name']), dbesc('zot'), dbesc($arr['photo_updated']), - dbesc($arr['name_updated']) + dbesc($arr['name_updated']), + intval($new_flags) ); update_modtime($xchan_hash); $changed = true; -- cgit v1.2.3