Osclass Support Forums

Osclass plugin support => User Rating Plugin => Topic started by: Clonedefeat on July 20, 2018, 09:15:18 PM

Title: Show effective profile picture
Post by: Clonedefeat 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
Title: Re: Show effective profile picture
Post by: MB Themes 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.
Title: Re: Show effective profile picture
Post by: Clonedefeat 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 ?
Title: Re: Show effective profile picture
Post by: MB Themes 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.
Title: Re: Show effective profile picture
Post by: Tango on April 01, 2019, 08:32:40 PM
Hello Frosticek,

I'm having the same issue.

At the moment I use the Madhouse Avatar (https://osclassmadhouse.com/madhouse-avatar-documentation/) 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!
Title: Re: Show effective profile picture
Post by: MB Themes on April 02, 2019, 07:22:10 AM
@Tango
osc_user_id() may not be correct
Title: Re: Show effective profile picture
Post by: Tango 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...  :'(
Title: Re: Show effective profile picture
Post by: MB Themes 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.
Title: Re: Show effective profile picture
Post by: Tango 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' ?
Title: Re: Show effective profile picture
Post by: MB Themes on May 14, 2019, 08:24:58 AM
It's not identical, you are missing preview part there.