Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9deb2e7
Merge branch 'release/6.9.x'
fplanque Aug 25, 2017
46085e7
Merge branch 'release/6.9.x'
fplanque Aug 25, 2017
fd0a313
Merge branch 'release/6.9.x'
fplanque Nov 26, 2017
f901eb4
fix version number
fplanque Nov 26, 2017
56e0640
Merge branch 'release/6.9.x'
fplanque Dec 30, 2017
f44e25e
Merge branch 'release/6.9.6'
fplanque Jan 5, 2018
6cf2d88
Merge branch 'release/6.9.x'
fplanque Feb 24, 2018
d9fc7c6
Merge branch 'release/6.10.x'
fplanque May 30, 2018
9c42fd4
Merge branch 'release/6.10.x'
fplanque Jun 21, 2018
88e38f6
Merge branch 'release/6.10.x'
fplanque Sep 27, 2018
f8ec88c
Merge branch 'release/6.10.x'
fplanque Sep 27, 2018
00936f8
Merge branch 'release/6.10.x'
fplanque Oct 1, 2018
5017e56
Merge branch 'release/6.10.x'
fplanque Oct 2, 2018
386e151
Merge branch 'release/6.10.x'
fplanque Nov 20, 2018
e177e84
Merge branch 'release/6.10.x'
fplanque Dec 22, 2018
eb2d203
Merge branch 'release/6.10.x'
fplanque Jan 14, 2019
afd1543
Merge branch 'release/6.10.x'
fplanque Feb 12, 2019
e3ea5ce
Merge branch 'release/6.10.x'
fplanque Apr 19, 2019
2f01f03
Merge branch 'develop'
fplanque Jun 13, 2019
4a5fcc1
Merge branch 'release/6.11.x'
fplanque Dec 1, 2019
71ba9e8
Added option in user settings to hide Reputation data from the user i…
Dec 22, 2019
dc245a7
fixed a mistake. I had forgotten to ignore a file created by the file…
Dec 22, 2019
03dabd6
Previous fix didn't work. Now deleted the extra file
Dec 22, 2019
17ae51f
Fixed code style to follow b2evo conventions
Mar 22, 2020
fc2b064
Fixed code style to follow b2evo conventions
Mar 22, 2020
ec0cbb6
Rebasing from old/develop branch into the new release/6.11.x branch
Apr 16, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.directory
.htaccess
_cache/c*
conf/_basic_config.php
Expand Down
2 changes: 2 additions & 0 deletions inc/settings/model/_generalsettings.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion inc/users/display.ctrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ),
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions inc/users/views/_display.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
67 changes: 42 additions & 25 deletions skins_fallback_v5/_user.disp.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down Expand Up @@ -128,21 +136,27 @@
}

// Login:
echo '<h2 class="'.$User->get_gender_class().'">'.$User->get( 'login' ).'</h2>';
if ( $is_logged_in )
{
echo '<h2 class="'.$User->get_gender_class().'">'.$User->get( 'login' ).'</h2>';
}

echo '<hr class="profile_separator" />'."\n";

// Gender & age group:
$gender_age_group = $User->get_gender();
if( ! empty( $User->age_min ) || ! empty( $User->age_max ) )
if ( $is_logged_in )
{
if( ! empty( $gender_age_group ) )
{
$gender_age_group .= ' &bull; ';
}
$gender_age_group .= sprintf( T_('%s years old'), $User->get( 'age_min' ).'-'.$User->get( 'age_max' ) );
}
echo '<p>'.$gender_age_group.'</p>';
$gender_age_group = $User->get_gender();
if( ! empty( $User->age_min ) || ! empty( $User->age_max ) )
{
if( ! empty( $gender_age_group ) )
{
$gender_age_group .= ' &bull; ';
}
$gender_age_group .= sprintf( T_('%s years old'), $User->get( 'age_min' ).'-'.$User->get( 'age_max' ) );
}
echo '<p>'.$gender_age_group.'</p>';
}

// Location:
$location = array();
Expand Down Expand Up @@ -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'), '<span class="reputation_message">'.$User->get_reputation_comments().'</span>' );
$profileForm->info( T_('Comments'), '<span class="reputation_message">'.$User->get_reputation_comments().'</span>' );

$profileForm->info( T_('Photos'), '<span class="reputation_message">'.$User->get_reputation_files( array( 'file_type' => 'image' ) ).'</span>' );
$profileForm->info( T_('Photos'), '<span class="reputation_message">'.$User->get_reputation_files( array( 'file_type' => 'image' ) ).'</span>' );

$profileForm->info( T_('Audio'), '<span class="reputation_message">'.$User->get_reputation_files( array( 'file_type' => 'audio' ) ).'</span>' );
$profileForm->info( T_('Audio'), '<span class="reputation_message">'.$User->get_reputation_files( array( 'file_type' => 'audio' ) ).'</span>' );

$profileForm->info( T_('Other files'), '<span class="reputation_message">'.$User->get_reputation_files( array( 'file_type' => 'other' ) ).'</span>' );
$profileForm->info( T_('Other files'), '<span class="reputation_message">'.$User->get_reputation_files( array( 'file_type' => 'other' ) ).'</span>' );

$profileForm->info( T_('Spam fighter score'), '<span class="reputation_message">'.$User->get_reputation_spam().'</span>' );
$profileForm->info( T_('Spam fighter score'), '<span class="reputation_message">'.$User->get_reputation_spam().'</span>' );

$profileForm->end_fieldset();
$profileForm->end_fieldset();
}

$Plugins->trigger_event( 'DisplayProfileFormFieldset', array( 'Form' => & $profileForm, 'User' => & $User, 'edit_layout' => 'public' ) );

Expand All @@ -418,4 +435,4 @@
echo_user_report_window();
// Init JS for user contact editing
echo_user_contact_groups_window();
?>
?>
84 changes: 50 additions & 34 deletions skins_fallback_v6/_user.disp.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down Expand Up @@ -129,21 +136,27 @@
}

// Login:
echo '<h2 class="'.$User->get_gender_class().'">'.$User->get( 'login' ).'</h2>';
if ( $is_logged_in )
{
echo '<h2 class="'.$User->get_gender_class().'">'.$User->get( 'login' ).'</h2>';
}

echo '<hr class="profile_separator" />'."\n";

// Gender & age group:
$gender_age_group = $User->get_gender();
if( ! empty( $User->age_min ) || ! empty( $User->age_max ) )
if ( $is_logged_in )
{
if( ! empty( $gender_age_group ) )
{
$gender_age_group .= ' &bull; ';
}
$gender_age_group .= sprintf( T_('%s years old'), $User->get( 'age_min' ).'-'.$User->get( 'age_max' ) );
}
echo '<p>'.$gender_age_group.'</p>';
$gender_age_group = $User->get_gender();
if( ! empty( $User->age_min ) || ! empty( $User->age_max ) )
{
if( ! empty( $gender_age_group ) )
{
$gender_age_group .= ' &bull; ';
}
$gender_age_group .= sprintf( T_('%s years old'), $User->get( 'age_min' ).'-'.$User->get( 'age_max' ) );
}
echo '<p>'.$gender_age_group.'</p>';
}

// Location:
$location = array();
Expand Down Expand Up @@ -278,7 +291,7 @@
}

if( count( $buttons ) )
{ // Dispaly all available buttons
{ // Display all available buttons
echo '<hr class="profile_separator" />'."\n";
echo '<div class="profile_buttons">';
foreach( $buttons as $button )
Expand Down Expand Up @@ -380,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'), '<span class="reputation_message">'.$User->get_reputation_comments().'</span>' );
$profileForm->info( T_('Comments'), '<span class="reputation_message">'.$User->get_reputation_comments().'</span>' );

$profileForm->info( T_('Photos'), '<span class="reputation_message">'.$User->get_reputation_files( array( 'file_type' => 'image' ) ).'</span>' );
$profileForm->info( T_('Photos'), '<span class="reputation_message">'.$User->get_reputation_files( array( 'file_type' => 'image' ) ).'</span>' );

$profileForm->info( T_('Audio'), '<span class="reputation_message">'.$User->get_reputation_files( array( 'file_type' => 'audio' ) ).'</span>' );
$profileForm->info( T_('Audio'), '<span class="reputation_message">'.$User->get_reputation_files( array( 'file_type' => 'audio' ) ).'</span>' );

$profileForm->info( T_('Other files'), '<span class="reputation_message">'.$User->get_reputation_files( array( 'file_type' => 'other' ) ).'</span>' );
$profileForm->info( T_('Other files'), '<span class="reputation_message">'.$User->get_reputation_files( array( 'file_type' => 'other' ) ).'</span>' );

$profileForm->info( T_('Spam fighter score'), '<span class="reputation_message">'.$User->get_reputation_spam().'</span>' );
$profileForm->info( T_('Spam fighter score'), '<span class="reputation_message">'.$User->get_reputation_spam().'</span>' );

$profileForm->end_fieldset();
$profileForm->end_fieldset();
}

$Plugins->trigger_event( 'DisplayProfileFormFieldset', array( 'Form' => & $profileForm, 'User' => & $User, 'edit_layout' => 'public' ) );

Expand All @@ -420,4 +436,4 @@
echo_user_report_window();
// Init JS for user contact editing
echo_user_contact_groups_window();
?>
?>