diff --git a/.gitignore b/.gitignore index 014d5b6fb3e..1aeeb02f41e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.directory .htaccess _cache/c* conf/_basic_config.php diff --git a/inc/settings/model/_generalsettings.class.php b/inc/settings/model/_generalsettings.class.php index 9cc427b04e4..b912c34a559 100644 --- a/inc/settings/model/_generalsettings.class.php +++ b/inc/settings/model/_generalsettings.class.php @@ -331,6 +331,8 @@ class GeneralSettings extends AbstractSettings 'bubbletip_anonymous' => 1, // Display bubbletips in Front-office for anonymous users 'bubbletip_size_anonymous' => 'fit-160x160-blur-18', // Avatar size in the bubbletip in the Front-office for anonymous users 'bubbletip_overlay' => "Log in to\r\nsee this\r\nimage",// Overlay text on the profile image for anonymous users + 'show_reputation_data' => 0, //Display reputation data in the Front-Office to anonymous users + 'blur_avatar_if_anonymous' => 1, //Display a blurred avatar image to anonymous users 'allow_anonymous_user_list' => 1, // Allow anonymous users to see user list (disp=users) 'allow_anonymous_user_profiles' => 0, // Allow anonymous users to see the user display ( disp=user ) 'allow_anonymous_user_level_min' => 0, // Min value of user group level to display for anonymous users diff --git a/inc/users/display.ctrl.php b/inc/users/display.ctrl.php index a7566919fb7..380d72ebd59 100644 --- a/inc/users/display.ctrl.php +++ b/inc/users/display.ctrl.php @@ -43,6 +43,8 @@ param( 'allow_anonymous_user_profiles', 'integer', 0 ); param( 'user_url_loggedin', 'string', '' ); param( 'user_url_anonymous', 'string', '' ); + param( 'show_reputation_data', 'integer', 0 ); + param( 'blur_avatar_if_anonymous', 'integer', 0 ); $updated_settings = array( array( 'use_gravatar', $use_gravatar ), @@ -58,7 +60,9 @@ array( 'allow_anonymous_user_list', $allow_anonymous_user_list ), array( 'allow_anonymous_user_profiles', $allow_anonymous_user_profiles ), array( 'user_url_loggedin', $user_url_loggedin ), - array( 'user_url_anonymous', $user_url_anonymous ) ); + array( 'user_url_anonymous', $user_url_anonymous ), + array( 'show_reputation_data', $show_reputation_data ), + array( 'blur_avatar_if_anonymous', $blur_avatar_if_anonymous ) ); if( $allow_anonymous_user_list || $allow_anonymous_user_profiles ) { // Update the user groups levels only if at least one users page is available for anonymous users diff --git a/inc/users/views/_display.form.php b/inc/users/views/_display.form.php index 2967ec8963d..6d0c8cac8e3 100644 --- a/inc/users/views/_display.form.php +++ b/inc/users/views/_display.form.php @@ -137,6 +137,10 @@ $Form->begin_fieldset( T_('Other permissions for anonymous users').get_manual_link('anonymous-users-permissions') ); + $Form->checkbox_input( 'show_reputation_data', $Settings->get('show_reputation_data'), T_('Show reputation data') ); + + $Form->checkbox_input( 'blur_avatar_if_anonymous', $Settings->get('blur_avatar_if_anonymous'), T_('Blur avatar image') ); + $Form->checkbox_input( 'allow_anonymous_user_list', $Settings->get('allow_anonymous_user_list'), T_('Allow to see user list') ); $user_level_params = array(); diff --git a/skins_fallback_v5/_user.disp.php b/skins_fallback_v5/_user.disp.php index ded56671eb6..4c666441a64 100644 --- a/skins_fallback_v5/_user.disp.php +++ b/skins_fallback_v5/_user.disp.php @@ -82,7 +82,15 @@ } else { // Avatar settings for anonymous user - $avatar_image_size = $params['avatar_image_size_if_anonymous']; + if ($Settings->get( 'blur_avatar_if_anonymous' ) ) + { + $avatar_image_size = $params['avatar_image_size_if_anonymous']; + } + else + { + $avatar_image_size = $params['avatar_image_size']; + } + if( $params['avatar_overlay_text_if_anonymous'] != '#default#' ) { // Get overlay text from params $avatar_overlay_text = $params['avatar_overlay_text_if_anonymous']; @@ -128,21 +136,27 @@ } // Login: - echo '
'.$gender_age_group.'
'; + $gender_age_group = $User->get_gender(); + if( ! empty( $User->age_min ) || ! empty( $User->age_max ) ) + { + if( ! empty( $gender_age_group ) ) + { + $gender_age_group .= ' • '; + } + $gender_age_group .= sprintf( T_('%s years old'), $User->get( 'age_min' ).'-'.$User->get( 'age_max' ) ); + } + echo ''.$gender_age_group.'
'; + } // Location: $location = array(); @@ -379,28 +393,31 @@ $profileForm->end_fieldset(); } - $profileForm->begin_fieldset( T_( 'Reputation' ) ); + if ($Settings->get( 'show_reputation_data' ) ) + { + $profileForm->begin_fieldset( T_( 'Reputation' ) ); - $profileForm->info( T_('Registration date'), mysql2localedate( $User->datecreated ) ); + $profileForm->info( T_('Registration date'), mysql2localedate( $User->datecreated ) ); - if( $Blog->get_setting( 'userdir_lastseen' ) ) - { // Display last visit only if it is enabled by current collection: - $profileForm->info( T_('Last seen on'), get_lastseen_date( $User->get( 'lastseen_ts' ), $Blog->get_setting( 'userdir_lastseen_view' ), $Blog->get_setting( 'userdir_lastseen_cheat' ) ) ); - } + if( $Blog->get_setting( 'userdir_lastseen' ) ) + { // Display last visit only if it is enabled by current collection: + $profileForm->info( T_('Last seen on'), get_lastseen_date( $User->get( 'lastseen_ts' ), $Blog->get_setting( 'userdir_lastseen_view' ), $Blog->get_setting( 'userdir_lastseen_cheat' ) ) ); + } - $profileForm->info( T_('Posts'), $User->get_reputation_posts() ); + $profileForm->info( T_('Posts'), $User->get_reputation_posts() ); - $profileForm->info( T_('Comments'), '' ); + $profileForm->info( T_('Comments'), '' ); - $profileForm->info( T_('Photos'), '' ); + $profileForm->info( T_('Photos'), '' ); - $profileForm->info( T_('Audio'), '' ); + $profileForm->info( T_('Audio'), '' ); - $profileForm->info( T_('Other files'), '' ); + $profileForm->info( T_('Other files'), '' ); - $profileForm->info( T_('Spam fighter score'), '' ); + $profileForm->info( T_('Spam fighter score'), '' ); - $profileForm->end_fieldset(); + $profileForm->end_fieldset(); + } $Plugins->trigger_event( 'DisplayProfileFormFieldset', array( 'Form' => & $profileForm, 'User' => & $User, 'edit_layout' => 'public' ) ); @@ -418,4 +435,4 @@ echo_user_report_window(); // Init JS for user contact editing echo_user_contact_groups_window(); -?> \ No newline at end of file +?> diff --git a/skins_fallback_v6/_user.disp.php b/skins_fallback_v6/_user.disp.php index 388174ff0c1..9d336fad6ba 100644 --- a/skins_fallback_v6/_user.disp.php +++ b/skins_fallback_v6/_user.disp.php @@ -83,15 +83,22 @@ } else { // Avatar settings for anonymous user - $avatar_image_size = $params['avatar_image_size_if_anonymous']; - if( $params['avatar_overlay_text_if_anonymous'] != '#default#' ) - { // Get overlay text from params - $avatar_overlay_text = $params['avatar_overlay_text_if_anonymous']; - } - else - { // Get default overlay text from Back-office settings - $avatar_overlay_text = $Settings->get('bubbletip_overlay'); - } + if ($Settings->get( 'blur_avatar_if_anonymous' ) ) + { + $avatar_image_size = $params['avatar_image_size_if_anonymous']; + } + else + { + $avatar_image_size = $params['avatar_image_size']; + } + if( $params['avatar_overlay_text_if_anonymous'] != '#default#' ) + { // Get overlay text from params + $avatar_overlay_text = $params['avatar_overlay_text_if_anonymous']; + } + else + { // Get default overlay text from Back-office settings + $avatar_overlay_text = $Settings->get('bubbletip_overlay'); + } } $avatar_imgtag = $User->get_avatar_imgtag( $avatar_image_size, 'main_profile_picture', '', true, $avatar_overlay_text, 'user', '300x300' ); @@ -129,21 +136,27 @@ } // Login: - echo ''.$gender_age_group.'
'; + $gender_age_group = $User->get_gender(); + if( ! empty( $User->age_min ) || ! empty( $User->age_max ) ) + { + if( ! empty( $gender_age_group ) ) + { + $gender_age_group .= ' • '; + } + $gender_age_group .= sprintf( T_('%s years old'), $User->get( 'age_min' ).'-'.$User->get( 'age_max' ) ); + } + echo ''.$gender_age_group.'
'; + } // Location: $location = array(); @@ -278,7 +291,7 @@ } if( count( $buttons ) ) - { // Dispaly all available buttons + { // Display all available buttons echo '