From 7206e8af3a943b0fb286f253ed3abbda2d2572b6 Mon Sep 17 00:00:00 2001 From: jeroenpraat Date: Tue, 1 Mar 2016 22:08:50 +0100 Subject: Small fix for deleted forum channels showing in the forum widget (had this after migration from RM on 1 or 2 channels) --- include/widgets.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/widgets.php b/include/widgets.php index a995fdf1c..aa0be87d6 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -1197,7 +1197,7 @@ function widget_forums($arr) { $perms_sql = item_permissions_sql(local_channel()) . item_normal(); - $r1 = q("select * from abook left join xchan on abook_xchan = xchan_hash where ( xchan_pubforum = 1 or ((abook_their_perms & %d ) != 0 and (abook_their_perms & %d ) = 0) ) and abook_channel = %d order by xchan_name $limit ", + $r1 = q("select * from abook left join xchan on abook_xchan = xchan_hash where ( xchan_pubforum = 1 or ((abook_their_perms & %d ) != 0 and (abook_their_perms & %d ) = 0) ) and xchan_deleted = 0 and abook_channel = %d order by xchan_name $limit ", intval(PERMS_W_TAGWALL), intval(PERMS_W_STREAM), intval(local_channel()) -- cgit v1.2.3 From 765dd5569b9ce2f18ac9974123d96452d0d19926 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 1 Mar 2016 14:55:04 -0800 Subject: Allow configuration of the display order of profile fields. This is an important piece of a more general profile configuration framework which will eventually be accessible via the admin page. --- include/identity.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'include') 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 )); -- cgit v1.2.3 From 548bf884a4b34a4881f3188e54c592597f755dc9 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 1 Mar 2016 21:06:27 -0800 Subject: profile field admin page (functional only: still needs a lot of HTML/CSS cleanup) --- include/identity.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/identity.php b/include/identity.php index 382b096fe..0a461dbe4 100644 --- a/include/identity.php +++ b/include/identity.php @@ -1652,7 +1652,7 @@ function get_profile_fields_basic($filter = 0) { $profile_fields_basic = (($filter == 0) ? get_config('system','profile_fields_basic') : null); if(! $profile_fields_basic) - $profile_fields_basic = array('name','pdesc','chandesc','gender','dob','dob_tz','address','locality','region','postal_code','country_name','marital','sexual','homepage','hometown','keywords','about','contact'); + $profile_fields_basic = array('name','pdesc','chandesc','gender','dob','dob_tz','address','locality','region','postal_code','country_name','marital','with','howlong','sexual','homepage','hometown','keywords','about','contact'); $x = array(); if($profile_fields_basic) @@ -1667,7 +1667,7 @@ function get_profile_fields_advanced($filter = 0) { $basic = get_profile_fields_basic($filter); $profile_fields_advanced = (($filter == 0) ? get_config('system','profile_fields_advanced') : null); if(! $profile_fields_advanced) - $profile_fields_advanced = array('with','howlong','politic','religion','likes','dislikes','interest','channels','music','book','film','tv','romance','work','education'); + $profile_fields_advanced = array('politic','religion','likes','dislikes','interest','channels','music','book','film','tv','romance','work','education'); $x = array(); if($basic) -- cgit v1.2.3 From 428b4dbad63d429c3b0d47b49ff5918dbda3c596 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 1 Mar 2016 22:47:07 -0800 Subject: sort out the with and howlong dependencies --- include/identity.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/identity.php b/include/identity.php index 0a461dbe4..382b096fe 100644 --- a/include/identity.php +++ b/include/identity.php @@ -1652,7 +1652,7 @@ function get_profile_fields_basic($filter = 0) { $profile_fields_basic = (($filter == 0) ? get_config('system','profile_fields_basic') : null); if(! $profile_fields_basic) - $profile_fields_basic = array('name','pdesc','chandesc','gender','dob','dob_tz','address','locality','region','postal_code','country_name','marital','with','howlong','sexual','homepage','hometown','keywords','about','contact'); + $profile_fields_basic = array('name','pdesc','chandesc','gender','dob','dob_tz','address','locality','region','postal_code','country_name','marital','sexual','homepage','hometown','keywords','about','contact'); $x = array(); if($profile_fields_basic) @@ -1667,7 +1667,7 @@ function get_profile_fields_advanced($filter = 0) { $basic = get_profile_fields_basic($filter); $profile_fields_advanced = (($filter == 0) ? get_config('system','profile_fields_advanced') : null); if(! $profile_fields_advanced) - $profile_fields_advanced = array('politic','religion','likes','dislikes','interest','channels','music','book','film','tv','romance','work','education'); + $profile_fields_advanced = array('with','howlong','politic','religion','likes','dislikes','interest','channels','music','book','film','tv','romance','work','education'); $x = array(); if($basic) -- cgit v1.2.3