X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fidentity.php;h=8f515580f475cba0cb28651a24a71b6ccb41447d;hb=0305aa2d8218a0919526a08910ffaebfdc5bb2c5;hp=2e6327d987368a7e9b9358c332ea202fccf1d1ef;hpb=d7d653aab65e230c1ac8aede73ab43333ef68b55;p=friendica.git diff --git a/include/identity.php b/include/identity.php index 2e6327d987..8f515580f4 100644 --- a/include/identity.php +++ b/include/identity.php @@ -4,6 +4,7 @@ */ use Friendica\App; +use Friendica\Content\Feature; use Friendica\Content\ForumManager; use Friendica\Core\Cache; use Friendica\Core\Config; @@ -11,7 +12,8 @@ use Friendica\Core\PConfig; use Friendica\Core\System; use Friendica\Core\Worker; use Friendica\Database\DBM; -use Friendica\Object\Contact; +use Friendica\Model\Contact; +use Friendica\Protocol\Diaspora; require_once 'include/bbcode.php'; require_once 'mod/proxy.php'; @@ -309,7 +311,7 @@ function profile_sidebar($profile, $block = 0) } // show edit profile to yourself - if (!$is_contact && $profile['uid'] == local_user() && feature_enabled(local_user(), 'multi_profiles')) { + if (!$is_contact && $profile['uid'] == local_user() && Feature::isEnabled(local_user(), 'multi_profiles')) { $profile['edit'] = array(System::baseUrl(). '/profiles', t('Profiles'),"", t('Manage/edit profiles')); $r = q( "SELECT * FROM `profile` WHERE `uid` = %d", @@ -336,7 +338,7 @@ function profile_sidebar($profile, $block = 0) } } } - if (!$is_contact && $profile['uid'] == local_user() && !feature_enabled(local_user(), 'multi_profiles')) { + if (!$is_contact && $profile['uid'] == local_user() && !Feature::isEnabled(local_user(), 'multi_profiles')) { $profile['edit'] = array(System::baseUrl(). '/profiles/'.$profile['id'], t('Edit profile'),"", t('Edit profile')); $profile['menu'] = array( 'chg_photo' => t('Change profile photo'), @@ -373,9 +375,9 @@ function profile_sidebar($profile, $block = 0) $location = $pdesc = $gender = $marital = $homepage = $about = false; } - $firstname = ((strpos($profile['name'], ' ')) - ? trim(substr($profile['name'], 0, strpos($profile['name'], ' '))) : $profile['name']); - $lastname = (($firstname === $profile['name']) ? '' : trim(substr($profile['name'], strlen($firstname)))); + $split_name = Diaspora::splitName($profile['name']); + $firstname = $split_name['first']; + $lastname = $split_name['last']; if ($profile['guid'] != "") { $diaspora = array( @@ -443,10 +445,6 @@ function profile_sidebar($profile, $block = 0) $p["photo"] = proxy_url($p["photo"], false, PROXY_SIZE_SMALL); } - if ($a->theme['template_engine'] === 'internal') { - $location = template_escape($location); - } - $tpl = get_markup_template('profile_vcard.tpl'); $o .= replace_macros( $tpl, @@ -794,7 +792,7 @@ function advanced_profile(App $a) } //show subcribed forum if it is enabled in the usersettings - if (feature_enabled($uid, 'forumlist_profile')) { + if (Feature::isEnabled($uid, 'forumlist_profile')) { $profile['forumlist'] = array( t('Forums:'), ForumManager::profileAdvanced($uid)); }