This topic contains a post which is marked as Best Answer. Press here if you would like to see it.
Profile image with implementation from SIGMA theme
« on: December 06, 2020, 10:02:41 AM »
Hi all

Please help me to make the AVATAR work on the GAMMA theme.
After updating osclass 4.2, the author tells us that we have support for avatar operation and we can load the code from THEMA SIGMA.
I uploaded the code, you can see the AVATAR implemented in the profile but I can't upload the avatar picture.
The photo upload button works and opens the way for me to upload the photo.
But, so far. It still doesn't work.
Please help. I'm new to programming :). But I can listen and place or change the codes if someone helps me.
Thanks so much for any help!

Here is the code loaded from the SIGMA theme:

<?php if(osc_profile_img_users_enabled()) { ?>
        <div class="control-group">
          <label class="control-label" for="name"><?php _e('Picture', 'gamma'); ?></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 } ?>

*

MB Themes

Re: Profile image with implementation from SIGMA theme
« Reply #1 on: December 06, 2020, 10:47:28 AM »
You miss line that loads cropper scripts (is in user-profile.php at start of file).
I will write guide to docs next week.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Re: Profile image with implementation from SIGMA theme
« Reply #2 on: December 06, 2020, 01:51:06 PM »
Thank you very much for your help!
I try to solve with these indications.
Otherwise, I'm waiting for the documentation.

Let's hear only good things!

Re: Profile image with implementation from SIGMA theme
« Reply #3 on: December 06, 2020, 02:24:05 PM »
I managed to get the load to work.
I think I'm waiting for the documentation because the avatar needs to be visible on the ad page and on the user profile on the ad page.

Greetings

*

MB Themes

Re: Profile image with implementation from SIGMA theme
« Reply #4 on: December 06, 2020, 02:40:07 PM »
Great.
Implementation to show profile image is very simle then.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Re: Profile image with implementation from SIGMA theme
« Reply #5 on: December 06, 2020, 08:09:22 PM »
Hello
I solved it with the profile picture on the ad page.
I can't solve the problem with the user profile page
I don't know what code to take and where.
I implemented the same code on the ad page but it doesn't work. In fact, the image is not visible.
A little help please ....
Thanks

Here is a printscreen

*

MB Themes

Re: Profile image with implementation from SIGMA theme
« Reply #6 on: December 06, 2020, 09:38:34 PM »
osc_item_user_id() ---> osc_user_id()
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Re: Profile image with implementation from SIGMA theme
« Reply #7 on: December 07, 2020, 08:13:17 PM »


Hello

Thanks for the guidance.
I think it would be simple if I knew where to implement the code sent by you :)  ;D

I used the code below for the avatar:

         <div <?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 } ?>      
          </div>


Can you help me with any code changes?
In the sense of showing me where to implement the code given by you?
Thank you!

Marked as best answer by frosticek on December 08, 2020, 07:23:36 PM
*

MB Themes

Re: Profile image with implementation from SIGMA theme
« Reply #8 on: December 08, 2020, 03:24:56 PM »
@Florentina
On public profile page, you should have:
Code: [Select]
<img src="<?php echo osc_user_profile_img_url(osc_user_id()); ?>" alt="<?php echo osc_esc_html(osc_user_name()); ?>"/>
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Re: Profile image with implementation from SIGMA theme
« Reply #9 on: December 08, 2020, 07:09:23 PM »
hello
Super! It works !!! :)
Thank you very much! You have been very helpful !!!
Greetings and let's just hear good!