X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fprofiles.php;h=9ce478ba198a375a80d664fcfea4c8935dab4f2c;hb=9330a6994c1b9aee49a482efe32e84ca1a944c9b;hp=993504a712425b780ed0a571d9c00009317b8f2c;hpb=6800b07fc5177badb4b6f3e007ab642ecb0e50c0;p=friendica.git diff --git a/mod/profiles.php b/mod/profiles.php index 993504a712..9ce478ba19 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -1,6 +1,7 @@ $locality, "region" => $region, "country-name" => $country_name)); $r = q("UPDATE `contact` SET `about` = '%s', `location` = '%s', `keywords` = '%s', `gender` = '%s' WHERE `self` = 1 AND `uid` = %d", dbesc($about), @@ -508,7 +498,7 @@ function profiles_post(&$a) { // Update global directory in background $url = $_SESSION['my_url']; - if($url && strlen(get_config('system','directory_submit_url'))) + if($url && strlen(get_config('system','directory'))) proc_run('php',"include/directory.php","$url"); require_once('include/profile_update.php'); @@ -516,8 +506,9 @@ function profiles_post(&$a) { } } } +} - +if(! function_exists('profile_activity')) { function profile_activity($changed, $value) { $a = get_app(); @@ -540,7 +531,7 @@ function profile_activity($changed, $value) { return; $arr = array(); - $arr['uri'] = $arr['parent-uri'] = item_new_uri($a->get_hostname(), local_user()); + $arr['uri'] = $arr['parent-uri'] = item_new_uri($a->get_hostname(), local_user()); $arr['uid'] = local_user(); $arr['contact-id'] = $self[0]['id']; $arr['wall'] = 1; @@ -552,7 +543,7 @@ function profile_activity($changed, $value) { $arr['author-avatar'] = $arr['owner-avatar'] = $self[0]['thumb']; $arr['verb'] = ACTIVITY_UPDATE; $arr['object-type'] = ACTIVITY_OBJ_PROFILE; - + $A = '[url=' . $self[0]['url'] . ']' . $self[0]['name'] . '[/url]'; @@ -570,7 +561,7 @@ function profile_activity($changed, $value) { $changes .= $ch; } - $prof = '[url=' . $self[0]['url'] . '?tab=profile' . ']' . t('public profile') . '[/url]'; + $prof = '[url=' . $self[0]['url'] . '?tab=profile' . ']' . t('public profile') . '[/url]'; if($t == 1 && strlen($value)) { $message = sprintf( t('%1$s changed %2$s to “%3$s”'), $A, $changes, $value); @@ -578,9 +569,9 @@ function profile_activity($changed, $value) { } else $message = sprintf( t('%1$s has an updated %2$s, changing %3$s.'), $A, $prof, $changes); - - $arr['body'] = $message; + + $arr['body'] = $message; $arr['object'] = '' . ACTIVITY_OBJ_PROFILE . '' . $self[0]['name'] . '' . '' . $self[0]['url'] . '/' . $self[0]['name'] . ''; @@ -607,8 +598,9 @@ function profile_activity($changed, $value) { } } +} - +if(! function_exists('profiles_content')) { function profiles_content(&$a) { if(! local_user()) { @@ -664,8 +656,10 @@ function profiles_content(&$a) { '$no_selected' => (($r[0]['hide-friends'] == 0) ? " checked=\"checked\" " : "") )); + $personal_account = !(in_array($a->user["page-flags"], + array(PAGE_COMMUNITY, PAGE_PRVGROUP))); - + $detailled_profile = (get_pconfig(local_user(),'system','detailled_profile') AND $personal_account); $f = get_config('system','birthday_input_format'); if(! $f) @@ -674,6 +668,17 @@ function profiles_content(&$a) { $is_default = (($r[0]['is-default']) ? 1 : 0); $tpl = get_markup_template("profile_edit.tpl"); $o .= replace_macros($tpl,array( + '$personal_account' => $personal_account, + '$detailled_profile' => $detailled_profile, + + '$details' => array( + 'detailled_profile', //Name + t('Show more profile fields:'), //Label + $detailled_profile, //Value + '', //Help string + array(t('No'),t('Yes')) //Off - On strings + ), + '$multi_profiles' => feature_enabled(local_user(),'multi_profiles'), '$form_security_token' => get_form_security_token("profile_edit"), '$form_security_token_photo' => get_form_security_token("profile_photo"), @@ -775,10 +780,10 @@ function profiles_content(&$a) { return $o; } - + //Profiles list. else { - + //If we don't support multi profiles, don't display this list. if(!feature_enabled(local_user(),'multi_profiles')){ $r = q( @@ -790,11 +795,11 @@ function profiles_content(&$a) { goaway($a->get_baseurl(true) . '/profiles/'.$r[0]['id']); } } - + $r = q("SELECT * FROM `profile` WHERE `uid` = %d", local_user()); if(count($r)) { - + $tpl_header = get_markup_template('profile_listing_header.tpl'); $o .= replace_macros($tpl_header,array( '$header' => t('Edit/Manage Profiles'), @@ -802,22 +807,22 @@ function profiles_content(&$a) { '$cr_new' => t('Create New Profile'), '$cr_new_link' => 'profiles/new?t=' . get_form_security_token("profile_new") )); - - + + $tpl = get_markup_template('profile_entry.tpl'); - + foreach($r as $rr) { $o .= replace_macros($tpl, array( '$photo' => $a->get_cached_avatar_image($rr['thumb']), '$id' => $rr['id'], '$alt' => t('Profile Image'), '$profile_name' => $rr['profile-name'], - '$visible' => (($rr['is-default']) ? '' . t('visible to everybody') . '' + '$visible' => (($rr['is-default']) ? '' . t('visible to everybody') . '' : '' . t('Edit visibility') . '') )); } } return $o; } - +} }