Osclass Support Forums
Osclass plugin support => User Rating Plugin => Topic started 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 :
$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
-
@Clonedefeat
Plugin works with free Profile Picture plugin, this must be installed in order to use profile images.
-
@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 ?
-
@Clonedefeat
It's bit older, could be somewhere on their forums. It's delivered with our themes.
-
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:
\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.
\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!
-
@Tango
osc_user_id() may not be correct
-
@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... :'(
-
@Tango
Compare links of images, I can see on show rating page you have corrupted image - means incorrect link.
-
Here's the code in rating.php:
$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' ?
-
It's not identical, you are missing preview part there.