*

Web

  • ****
  • 183 posts
profile picture user dashboard
« on: December 14, 2020, 06:12:03 AM »
How to update profile pic in user dashboard ?

 echo '<div class="box"><img src="' . bet_profile_picture(osc_logged_user_id(), 'large') . '"/></div><strong>' . sprintf(__('Hi %s!', 'beta'), osc_logged_user_name()) . '</strong>';

*

MB Themes

Re: profile picture user dashboard
« Reply #1 on: December 14, 2020, 10:31:34 AM »
@Web
You must do several updates based on sigma theme.
In user-profile.php at top you first add required scripts.
Code: [Select]
if(osc_profile_img_users_enabled() == '1') {
  osc_enqueue_script('cropper');
  osc_enqueue_style('cropper', osc_assets_url('js/cropper/cropper.min.css'));
}


Then into form, you add:
Code: [Select]

      <?php if(osc_profile_img_users_enabled()) { ?>
        <div class="control-group">
          <label class="control-label" for="name"><?php _e('Picture''sigma'); ?></label>
          <div class="controls">
            <div class="user-img">
              <div class="img-preview">
                <img src="<?php echo osc_user_profile_img_url(osc_logged_user_id()); ?>" alt="<?php echo osc_esc_html(osc_logged_user_name()); ?>"/>
              </div>
            </div>

            <div class="user-img-button">
              <?php UserForm::upload_profile_img(); ?>
            </div>
          </div>
        </div>
      <?php ?>

Then, in item.php (as example) to show user picture you add:
Code: [Select]
              <?php if(osc_profile_img_users_enabled()) { ?>
                <p class="user-img">
                  <img src="<?php echo osc_user_profile_img_url(osc_item_user_id()); ?>" alt="<?php echo osc_esc_html(osc_item_contact_name()); ?>"/>
                </p>
              <?php ?>
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Web

  • ****
  • 183 posts
Re: profile picture user dashboard
« Reply #2 on: December 14, 2020, 07:00:08 PM »
@Web
You must do several updates based on sigma theme.
In user-profile.php at top you first add required scripts.
Code: [Select]
if(osc_profile_img_users_enabled() == '1') {
  osc_enqueue_script('cropper');
  osc_enqueue_style('cropper', osc_assets_url('js/cropper/cropper.min.css'));
}


Then into form, you add:
Code: [Select]

      <?php if(osc_profile_img_users_enabled()) { ?>
        <div class="control-group">
          <label class="control-label" for="name"><?php _e('Picture''sigma'); ?></label>
          <div class="controls">
            <div class="user-img">
              <div class="img-preview">
                <img src="<?php echo osc_user_profile_img_url(osc_logged_user_id()); ?>" alt="<?php echo osc_esc_html(osc_logged_user_name()); ?>"/>
              </div>
            </div>

            <div class="user-img-button">
              <?php UserForm::upload_profile_img(); ?>
            </div>
          </div>
        </div>
      <?php ?>

Then, in item.php (as example) to show user picture you add:
Code: [Select]
              <?php if(osc_profile_img_users_enabled()) { ?>
                <p class="user-img">
                  <img src="<?php echo osc_user_profile_img_url(osc_item_user_id()); ?>" alt="<?php echo osc_esc_html(osc_item_contact_name()); ?>"/>
                </p>
              <?php ?>


Beta theme user dashboard ??

function.php line - 989

*

Web

  • ****
  • 183 posts
Re: profile picture user dashboard
« Reply #3 on: December 16, 2020, 02:56:34 PM »
 :( :( :( :(

*

MB Themes

Re: profile picture user dashboard
« Reply #4 on: December 16, 2020, 08:33:07 PM »
Quote
...In user-profile.php at top you...
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Web

  • ****
  • 183 posts
Re: profile picture user dashboard
« Reply #5 on: December 17, 2020, 06:44:51 AM »
user-profile.php updated

*

MB Themes

Re: profile picture user dashboard
« Reply #6 on: December 17, 2020, 09:36:54 AM »
You have all the codes needed for changes in post above.
Everything is there.

Code: [Select]
<img src="<?php echo osc_user_profile_img_url(osc_user_id()); ?>"/>
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots