From 44ee18b810b8671c9b522b06a5d8d0e62a3bef00 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 2 Aug 2014 23:28:51 -0700 Subject: Let site admin choose what profile fields to support. --- mod/profiles.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/profiles.php b/mod/profiles.php index 2062f094f..03e6801d2 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -458,11 +458,17 @@ function profiles_content(&$a) { $o = ''; + if(! local_user()) { notice( t('Permission denied.') . EOL); return; } + require_once('include/identity.php'); + + $profile_fields_basic = get_profile_fields_basic(); + $profile_fields_advanced = get_profile_fields_advanced(); + if((argc() > 1) && (intval(argv(1)))) { $r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1", intval($a->argv[1]), @@ -486,6 +492,11 @@ function profiles_content(&$a) { )); $advanced = ((feature_enabled(local_user(),'advanced_profiles')) ? true : false); + if($advanced) + $fields = $profile_fields_advanced; + else + $fields = $profile_fields_basic; + $opt_tpl = get_markup_template("profile-hide_friends.tpl"); $hide_friends = replace_macros($opt_tpl,array( @@ -511,11 +522,12 @@ function profiles_content(&$a) { '$profile_drop_link' => 'profiles/drop/' . $r[0]['id'] . '?t=' . get_form_security_token("profile_drop"), + '$fields' => $fields, '$guid' => $r[0]['profile_guid'], '$banner' => t('Edit Profile Details'), '$submit' => t('Submit'), '$viewprof' => t('View this profile'), - '$editvis' => t('Edit visibility'), + '$editvis' => t('Edit visibility'), '$profpic' => t('Change Profile Photo'), '$cr_prof' => t('Create a new profile using these settings'), '$cl_prof' => t('Clone this profile'), -- cgit v1.2.3