This topic contains a post which is marked as Best Answer. Press here if you would like to see it.
*

Macreus

  • **
  • 18 posts
Latest version failing to get user on public profile
« on: August 04, 2021, 11:15:32 PM »
Hi, on public profile page, clicking on the user rating returns "User has not been recognized"

I think this is because the code is getting the item_id on every single function, and there is no item_id to retrieve on the public profile page, so the '&&' returns false.

Any solution? Thanks

*

Macreus

  • **
  • 18 posts
Re: Latest version failing to get user on public profile
« Reply #1 on: August 04, 2021, 11:39:12 PM »
This is the code in the user-public-profile.php

Code: [Select]
         <?php if(function_exists('ur_show_rating_stars') && osc_user_id() > 0) { ?>
            <span class="ur-fdb">
<span class="strs"><?php echo ur_button_stars(); ?></span>
<br>
              <span class="lnk"><?php echo ur_button_add(); ?></span>
            </span>
          <?php ?>

Which looks like and gives this error

The code above contains osc_user_id because I thought that might fix it. Originally it has osc_item_user_id, but that did not work either and gave the same error.

When I looked in the functions of the user rating plugin though I noticed that osc_item_user_id seems to be on everything but I figure that it doesn't exist on a public profile page.

*

MB Themes

Re: Latest version failing to get user on public profile
« Reply #2 on: August 05, 2021, 07:54:17 AM »
@Marceus
You should provide user ID.
In previous versions user ID was identified automatically by plugin, but it was not correct. It might return user ID not related to one you were showing.
In user public profile, user id should be osc_user_id() or Params::getParam('id') - depends on theme and osclass version. Best is to find user ID at start of file and then keep it in variable.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Macreus

  • **
  • 18 posts
Re: Latest version failing to get user on public profile
« Reply #3 on: August 05, 2021, 06:27:51 PM »
@Marceus
You should provide user ID.
In previous versions user ID was identified automatically by plugin, but it was not correct. It might return user ID not related to one you were showing.
In user public profile, user id should be osc_user_id() or Params::getParam('id') - depends on theme and osclass version. Best is to find user ID at start of file and then keep it in variable.

I have tried osc_user_id() as I said and that does not work, I tried Params::getParam('id') as you suggested but that still returns the same error.  At the top of user-public-profile, $user is defined as "  $user = osc_user(); ", I have tried replacing osc_user_id() with osc_user(), but that does not work either.

Also, really love the new facelift, looks great, just hoping to get it working on the public profile page!
« Last Edit: August 05, 2021, 06:42:09 PM by Macreus »

*

MB Themes

Re: Latest version failing to get user on public profile
« Reply #4 on: August 05, 2021, 10:14:25 PM »
You can get it as $user['pk_i_id']
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Macreus

  • **
  • 18 posts
Re: Latest version failing to get user on public profile
« Reply #5 on: August 06, 2021, 02:24:08 AM »
You can get it as $user['pk_i_id']

Thanks for the suggestion, I tried that but it gives me the same error

Code: [Select]
         <?php if(function_exists('ur_show_rating_stars') && $user['pk_i_id'] > 0) { ?>
            <span class="ur-fdb">
<span class="strs"><?php echo ur_button_stars(); ?></span>
<br>
              <span class="lnk"><?php echo ur_button_add(); ?></span>
            </span>
          <?php ?>




I think the issue lies within functions in the plugin file, it's always looking for the itemID and when it comes back null, userid gets returned null as well because of the &&.

If I hover over, I can see the preview of the link it wants to make :

Thanks


Marked as best answer by Macreus on August 06, 2021, 01:21:32 PM
*

MB Themes

Re: Latest version failing to get user on public profile
« Reply #6 on: August 06, 2021, 08:44:12 AM »
@Macreus
You must provide that ID into function.
Code: [Select]
         <?php if(function_exists('ur_show_rating_stars')) { ?>
            <span class="ur-fdb">
<span class="strs"><?php echo ur_button_stars($user['pk_i_id']); ?></span>
<br/>
                <span class="lnk"><?php echo ur_button_add($user['pk_i_id']); ?></span>
            </span>
          <?php ?>
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Macreus

  • **
  • 18 posts
Re: Latest version failing to get user on public profile
« Reply #7 on: August 06, 2021, 01:18:59 PM »
@Macreus
You must provide that ID into function.
Code: [Select]
         <?php if(function_exists('ur_show_rating_stars')) { ?>
            <span class="ur-fdb">
<span class="strs"><?php echo ur_button_stars($user['pk_i_id']); ?></span>
<br/>
                <span class="lnk"><?php echo ur_button_add($user['pk_i_id']); ?></span>
            </span>
          <?php ?>

That works great, thank you for your help!

*

Macreus

  • **
  • 18 posts
Re: Latest version failing to get user on public profile
« Reply #8 on: August 06, 2021, 02:24:30 PM »
Ah I do have one more slight issue, on monochrome, it seems to work fine but with that ticked off, I get this


If the user has a mediocre rating they still get a full set of stars in a different colour, it should be 3 yellow stars?

*

MB Themes

Re: Latest version failing to get user on public profile
« Reply #9 on: August 06, 2021, 02:38:03 PM »
@Macreus
Can you send URL to such profile/rating?
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Macreus

  • **
  • 18 posts
Re: Latest version failing to get user on public profile
« Reply #10 on: August 06, 2021, 03:29:35 PM »
@Macreus
Can you send URL to such profile/rating?

Yes of course, I will PM you.

*

MB Themes

Re: Latest version failing to get user on public profile
« Reply #11 on: August 06, 2021, 03:50:16 PM »
Update plugin user.css with this one:
https://plugins3.abprofitrade.eu/oc-content/themes/sigma/css/style.css?v=20210806154925

There was 1 word missing, should be ok then ;)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Macreus

  • **
  • 18 posts
Re: Latest version failing to get user on public profile
« Reply #12 on: August 06, 2021, 04:45:06 PM »
Update plugin user.css with this one:
https://plugins3.abprofitrade.eu/oc-content/themes/sigma/css/style.css?v=20210806154925

There was 1 word missing, should be ok then ;)

Thanks, I'm not sure which CSS to replace here, I can't find any that look remotely similar. I don't have a style.css in the plugin folder css folder, only user.css, tipped.css, bootstrap-switch.css and admin.css

I did try swapping out the user.css but that was wrong.

The theme style.css, i.e gamma/css/style.css is also completely different so I don't think that's the right one either

*

Macreus

  • **
  • 18 posts
Re: Latest version failing to get user on public profile
« Reply #13 on: August 06, 2021, 04:49:26 PM »
I think maybe you sent wrong url. I changed the URL you sent me to https://plugins3.abprofitrade.eu/oc-content/plugins/user_rating/css/user.css

Knowing what you said about one word being wrong I looked to the relevant location and noticed

Code: [Select]
.ur-rate.ur-gray > span, .ur-rate.ur-has-cl.ur-gray > span, .ur-rate.ur-not-hover > span, .ur-rate.ur-select.ur-not-hover > span, .ur-rate.ur-not-select > span {background-color:#aaa;}
Which is different to my user.css which was

Code: [Select]
.ur-rate.ur-gray > span, .ur-rate.ur-not-hover > span, .ur-rate.ur-select.ur-not-hover > span, .ur-rate.ur-not-select > span {background-color:#aaa;}

All working great now! Many thanks, love the new design.

*

MB Themes

Re: Latest version failing to get user on public profile
« Reply #14 on: August 06, 2021, 05:33:50 PM »
Great  ;)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots