diff --git a/include/identity.php b/include/identity.php
index 380556246..382b096fe 100644
--- a/include/identity.php
+++ b/include/identity.php
@@ -1253,6 +1253,24 @@ function advanced_profile(&$a) {
if($a->profile['name']) {
+ $profile_fields_basic = get_profile_fields_basic();
+ $profile_fields_advanced = get_profile_fields_advanced();
+
+ $advanced = ((feature_enabled($a->profile['profile_uid'],'advanced_profiles')) ? true : false);
+ if($advanced)
+ $fields = $profile_fields_advanced;
+ else
+ $fields = $profile_fields_basic;
+
+ $clean_fields = array();
+ if($fields) {
+ foreach($fields as $k => $v) {
+ $clean_fields[] = trim($k);
+ }
+ }
+
+
+
$tpl = get_markup_template('profile_advanced.tpl');
$profile = array();
@@ -1370,6 +1388,7 @@ function advanced_profile(&$a) {
'$canlike' => (($profile['canlike'])? true : false),
'$likethis' => t('Like this thing'),
'$profile' => $profile,
+ '$fields' => $clean_fields,
'$editmenu' => profile_edit_menu($a->profile['profile_uid']),
'$things' => $things
));
diff --git a/view/tpl/profile_advanced.tpl b/view/tpl/profile_advanced.tpl
index 3d09b762d..b7c527c31 100755
--- a/view/tpl/profile_advanced.tpl
+++ b/view/tpl/profile_advanced.tpl
@@ -31,186 +31,241 @@
-
- - {{$profile.fullname.0}}
- - {{$profile.fullname.1}}
-
+ {{foreach $fields as $f}}
+ {{if $f == 'name'}}
+
+ - {{$profile.fullname.0}}
+ - {{$profile.fullname.1}}
+
+ {{/if}}
+
+ {{if $f == 'gender'}}
{{if $profile.gender}}
- {{$profile.gender.0}}
- {{$profile.gender.1}}
{{/if}}
+ {{/if}}
+ {{if $f == 'birthday'}}
{{if $profile.birthday}}
- {{$profile.birthday.0}}
- {{$profile.birthday.1}}
{{/if}}
+ {{/if}}
+ {{if $f == 'age'}}
{{if $profile.age}}
- {{$profile.age.0}}
- {{$profile.age.1}}
{{/if}}
+ {{/if}}
+
+ {{if $f == 'marital'}}
{{if $profile.marital}}
- ♥ {{$profile.marital.0}}
- {{$profile.marital.1}}{{if $profile.marital.with}} ({{$profile.marital.with}}){{/if}}{{if $profile.howlong}} {{$profile.howlong}}{{/if}}
{{/if}}
+ {{/if}}
+ {{if $f == 'sexual'}}
{{if $profile.sexual}}
- {{$profile.sexual.0}}
- {{$profile.sexual.1}}
{{/if}}
+ {{/if}}
+ {{if $f == 'keywords'}}
{{if $profile.keywords}}
- {{$profile.keywords.0}}
- {{$profile.keywords.1}}
{{/if}}
+ {{/if}}
+ {{if $f == 'homepage'}}
{{if $profile.homepage}}
- {{$profile.homepage.0}}
- {{$profile.homepage.1}}
{{/if}}
+ {{/if}}
+ {{if $f == 'hometown'}}
{{if $profile.hometown}}
- {{$profile.hometown.0}}
- {{$profile.hometown.1}}
{{/if}}
+ {{/if}}
+
+ {{if $f == 'politic'}}
{{if $profile.politic}}
- {{$profile.politic.0}}
- {{$profile.politic.1}}
{{/if}}
+ {{/if}}
+ {{if $f == 'religion'}}
{{if $profile.religion}}
- {{$profile.religion.0}}
- {{$profile.religion.1}}
{{/if}}
+ {{/if}}
+ {{if $f == 'about'}}
{{if $profile.about}}
- {{$profile.about.0}}
- {{$profile.about.1}}
{{/if}}
+ {{/if}}
+ {{if $f == 'interest'}}
{{if $profile.interest}}
- {{$profile.interest.0}}
- {{$profile.interest.1}}
{{/if}}
+ {{/if}}
+ {{if $f == 'likes'}}
{{if $profile.likes}}
- {{$profile.likes.0}}
- {{$profile.likes.1}}
{{/if}}
+ {{/if}}
+ {{if $f == 'dislikes'}}
{{if $profile.dislikes}}
- {{$profile.dislikes.0}}
- {{$profile.dislikes.1}}
{{/if}}
+ {{/if}}
+ {{if $f == 'contact'}}
{{if $profile.contact}}
- {{$profile.contact.0}}
- {{$profile.contact.1}}
{{/if}}
+ {{/if}}
+ {{if $f == 'channels'}}
{{if $profile.channels}}
- {{$profile.channels.0}}
- {{$profile.channels.1}}
{{/if}}
+ {{/if}}
+ {{if $f == 'music'}}
{{if $profile.music}}
- {{$profile.music.0}}
- {{$profile.music.1}}
{{/if}}
+ {{/if}}
+ {{if $f == 'book'}}
{{if $profile.book}}
- {{$profile.book.0}}
- {{$profile.book.1}}
{{/if}}
+ {{/if}}
+ {{if $f == 'tv'}}
{{if $profile.tv}}
- {{$profile.tv.0}}
- {{$profile.tv.1}}
{{/if}}
+ {{/if}}
+ {{if $f == 'film'}}
{{if $profile.film}}
- {{$profile.film.0}}
- {{$profile.film.1}}
{{/if}}
+ {{/if}}
+ {{if $f == 'romance'}}
{{if $profile.romance}}
- {{$profile.romance.0}}
- {{$profile.romance.1}}
{{/if}}
+ {{/if}}
+ {{if $f == 'work'}}
{{if $profile.work}}
- {{$profile.work.0}}
- {{$profile.work.1}}
{{/if}}
+ {{/if}}
+ {{if $f == 'education'}}
{{if $profile.education}}
- {{$profile.education.0}}
- {{$profile.education.1}}
{{/if}}
+ {{/if}}
- {{foreach $profile.extra_fields as $f}}
- {{if $profile.$f}}
-
- - {{$profile.$f.0}}
- - {{$profile.$f.1}}
+ {{foreach $profile.extra_fields as $fld}}
+ {{if $f == $fld}}
+ {{if $profile.$fld}}
+
+ - {{$profile.$fld.0}}
+ - {{$profile.$fld.1}}
{{/if}}
+ {{/if}}
{{/foreach}}
+ {{/foreach}}
{{if $things}}