*

Clonedefeat

  • **
  • 5 posts
Show effective profile picture
« on: July 20, 2018, 09:15:18 PM »
Hello,
In the code of the file /oc-content/plugins/user_rating/user/rating.php we can see :
Code: [Select]

$img = '';
  if(function_exists('profile_picture_show')) {
    $picture = ModelUR::newInstance()->getPictureByUserId($user_id);
    $picture['pic_ext'] = isset($picture['pic_ext']) ? $picture['pic_ext'] : '.jpg';

    if(file_exists(osc_base_path() . 'oc-content/plugins/profile_picture/images/profile' . $user_id . $picture['pic_ext'])) {
      $img = osc_base_url() . 'oc-content/plugins/profile_picture/images/profile' . $user_id . $picture['pic_ext'];
    }
  }

  $def_img = osc_base_url() . 'oc-content/plugins/user_rating/img/profile-default.png';

How can I do to show the profile picture of the user ?
I already have a directory with the profiles pictures and it works well on listings pages and user-public page.

Thank you,
Clone

*

MB Themes

Re: Show effective profile picture
« Reply #1 on: July 21, 2018, 09:00:41 PM »
@Clonedefeat
Plugin works with free Profile Picture plugin, this must be installed in order to use profile images.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Clonedefeat

  • **
  • 5 posts
Re: Show effective profile picture
« Reply #2 on: August 07, 2018, 06:01:29 PM »
@MB Themes
Thank you for your response.
I don't find a plugin called "Free Profile Picture" on osclasspoint, and also on osclass market.
Can you help me ?
Is it the plugin from Madhouse ? It is no more on the osclass market.

I actually use the Avatar Plugin by Media.Dmj and it is good working.
Am I able to show the profile picture from this plugin ?

*

MB Themes

Re: Show effective profile picture
« Reply #3 on: August 07, 2018, 06:42:14 PM »
@Clonedefeat
It's bit older, could be somewhere on their forums. It's delivered with our themes.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Tango

  • ****
  • 214 posts
Re: Show effective profile picture
« Reply #4 on: April 01, 2019, 08:32:40 PM »
Hello Frosticek,

I'm having the same issue.

At the moment I use the Madhouse Avatar plugin and I made it show the user avatar for new ratings by editing the following:
Code: [Select]
\oc-content\plugins\user_rating\user\new.php line 36

$def_img = mdh_avatar_normal_url(osc_user_id());

The problem is that I can't make it work for show ratings.
Code: [Select]
\oc-content\plugins\user_rating\user\rating.php line 37
What could be the issue, as the code in new.php is pretty much the same with the one in rating.php?

Thanks!
« Last Edit: May 12, 2019, 12:22:36 AM by Tango »

*

MB Themes

Re: Show effective profile picture
« Reply #5 on: April 02, 2019, 07:22:10 AM »
@Tango
osc_user_id() may not be correct
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Tango

  • ****
  • 214 posts
Re: Show effective profile picture
« Reply #6 on: May 12, 2019, 12:21:05 AM »
@Tango
osc_user_id() may not be correct
Then why does it work for New rating and not for Show rating?
It must be something in rating.php that is done differently from new.php, but sadly I can't figure out what...  :'(

*

MB Themes

Re: Show effective profile picture
« Reply #7 on: May 13, 2019, 08:10:31 AM »
@Tango
Compare links of images, I can see on show rating page you have corrupted image - means incorrect link.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Tango

  • ****
  • 214 posts
Re: Show effective profile picture
« Reply #8 on: May 13, 2019, 09:25:52 PM »
Here's the code in rating.php:
Code: [Select]
  $img = '';
  if(function_exists('profile_picture_show')) {
    $picture = ModelUR::newInstance()->getPictureByUserId($user_id);
    $picture['pic_ext'] = isset($picture['pic_ext']) ? $picture['pic_ext'] : '.jpg';

    if(file_exists(osc_base_path() . 'oc-content/uploads/user_resources' . $user_id . $picture['pic_ext'])) {
      $img = osc_base_url() . 'oc-content/uploads/user_resources' . $user_id . $picture['pic_ext'];
    }
  }

  $def_img = mdh_avatar_normal_url(osc_user_id());

?>

The problem is that anything I try in rating.php, like modifying the paths to 'oc-content/uploads/user_resources/0', it doesn't work...
The img related code in rating.php and in new.php is identical, that's why I'm thinking it's something else in the code that doesn't click.
The question is, how can I make the script go inside the 0 folder 'oc-content/uploads/user_resources/0' ?
« Last Edit: May 13, 2019, 09:29:13 PM by Tango »

*

MB Themes

Re: Show effective profile picture
« Reply #9 on: May 14, 2019, 08:24:58 AM »
It's not identical, you are missing preview part there.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots