import_diaspora - a few more atypical settings
This commit is contained in:
parent
a6b9d1595e
commit
94e7a425e6
@ -25,16 +25,27 @@ function import_diaspora($data) {
|
|||||||
|
|
||||||
$channel_id = $c['channel']['channel_id'];
|
$channel_id = $c['channel']['channel_id'];
|
||||||
|
|
||||||
// todo - add nsfw, auto follow, (and strip exif in hubzilla)
|
// todo - add auto follow settings, (and strip exif in hubzilla)
|
||||||
|
|
||||||
$location = escape_tags($data['user']['profile']['location']);
|
$location = escape_tags($data['user']['profile']['location']);
|
||||||
if(! $location)
|
if(! $location)
|
||||||
$location = '';
|
$location = '';
|
||||||
|
|
||||||
|
|
||||||
q("update channel set channel_location = '%s' where channel_id = %d",
|
q("update channel set channel_location = '%s' where channel_id = %d",
|
||||||
dbesc($location)
|
dbesc($location),
|
||||||
|
intval($channel_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if($data['user']['profile']['nsfw']) {
|
||||||
|
// fixme for hubzilla which doesn't use pageflags any more
|
||||||
|
q("update channel set channel_pageflags = (channel_pageflags & %d) where channel_id = %d",
|
||||||
|
intval(PAGE_ADULT),
|
||||||
|
intval($channel_id)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$photos = import_profile_photo($data['user']['profile']['image_url'],$c['channel']['channel_hash']);
|
$photos = import_profile_photo($data['user']['profile']['image_url'],$c['channel']['channel_hash']);
|
||||||
if($photos[4])
|
if($photos[4])
|
||||||
@ -55,15 +66,20 @@ function import_diaspora($data) {
|
|||||||
|
|
||||||
$gender = escape_tags($data['user']['profile']['gender']);
|
$gender = escape_tags($data['user']['profile']['gender']);
|
||||||
$about = diaspora2bb($data['user']['profile']['bio']);
|
$about = diaspora2bb($data['user']['profile']['bio']);
|
||||||
|
$publish = intval($data['user']['profile']['searchable']);
|
||||||
if($data['user']['profile']['birthday'])
|
if($data['user']['profile']['birthday'])
|
||||||
$dob = datetime_convert('UTC','UTC',$data['user']['profile']['birthday'],'Y-m-d');
|
$dob = datetime_convert('UTC','UTC',$data['user']['profile']['birthday'],'Y-m-d');
|
||||||
else
|
else
|
||||||
$dob = '0000-00-00';
|
$dob = '0000-00-00';
|
||||||
|
|
||||||
$r = q("update profile set gender = '%s', about = '%s', dob = '%s' where uid = %d",
|
// we're relying on the fact that this channel was just created and will only
|
||||||
|
// have the default profile currently
|
||||||
|
|
||||||
|
$r = q("update profile set gender = '%s', about = '%s', dob = '%s', publish = %d where uid = %d",
|
||||||
dbesc($gender),
|
dbesc($gender),
|
||||||
dbesc($about),
|
dbesc($about),
|
||||||
dbesc($dob),
|
dbesc($dob),
|
||||||
|
dbesc($publish),
|
||||||
intval($channel_id)
|
intval($channel_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user