From d8ee6e0d4ed19c41d0d059d0579e354859fcf8b4 Mon Sep 17 00:00:00 2001 From: Gerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org> Date: Fri, 24 Mar 2006 14:43:35 +0000 Subject: [PATCH] #55040, Author block doesn't obey settings, patch by dww --- modules/profile.module | 4 ++-- modules/profile/profile.module | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/profile.module b/modules/profile.module index 33c22f41c033..2ed1f61db3fa 100644 --- a/modules/profile.module +++ b/modules/profile.module @@ -120,7 +120,7 @@ function profile_block($op = 'list', $delta = 0, $edit = array()) { $result = db_query('SELECT name, title, type, visibility, weight FROM {profile_fields} WHERE visibility IN (%d, %d) ORDER BY weight', PROFILE_PUBLIC, PROFILE_PUBLIC_LISTINGS); while ($record = db_fetch_object($result)) { // Ensure that field is displayed only if it is among the defined block fields and, if it is private, the user has appropriate permissions. - if (in_array($record->name, $use_fields)) { + if (isset($use_fields[$record->name]) && $use_fields[$record->name]) { $fields[] = $record; } } @@ -131,7 +131,7 @@ function profile_block($op = 'list', $delta = 0, $edit = array()) { $output .= theme('profile_block', $account, $fields, true); } - if (in_array('user_profile', $use_fields)) { + if (isset($use_fields['user_profile']) && $use_fields['user_profile']) { $output .= '<div>' . l(t('View full user profile'), 'user/' . $account->uid) . '</div>'; } } diff --git a/modules/profile/profile.module b/modules/profile/profile.module index 33c22f41c033..2ed1f61db3fa 100644 --- a/modules/profile/profile.module +++ b/modules/profile/profile.module @@ -120,7 +120,7 @@ function profile_block($op = 'list', $delta = 0, $edit = array()) { $result = db_query('SELECT name, title, type, visibility, weight FROM {profile_fields} WHERE visibility IN (%d, %d) ORDER BY weight', PROFILE_PUBLIC, PROFILE_PUBLIC_LISTINGS); while ($record = db_fetch_object($result)) { // Ensure that field is displayed only if it is among the defined block fields and, if it is private, the user has appropriate permissions. - if (in_array($record->name, $use_fields)) { + if (isset($use_fields[$record->name]) && $use_fields[$record->name]) { $fields[] = $record; } } @@ -131,7 +131,7 @@ function profile_block($op = 'list', $delta = 0, $edit = array()) { $output .= theme('profile_block', $account, $fields, true); } - if (in_array('user_profile', $use_fields)) { + if (isset($use_fields['user_profile']) && $use_fields['user_profile']) { $output .= '<div>' . l(t('View full user profile'), 'user/' . $account->uid) . '</div>'; } } -- GitLab