Osclass Support Forums

Osclass plugin support => User Rating Plugin => Topic started by: Tango on April 19, 2020, 10:51:24 PM

Title: Show the plugin only for registered users
Post by: Tango on April 19, 2020, 10:51:24 PM
Hello Frosticek,

At the moment, the plugin appears for all users (registered and unregistered), as it automatically hooks to the item details page.

I would like to show the plugin (buttons and stars) only for items added by registered users.
It's easy for the manual placement of the buttons, with:
Code: [Select]
if(function_exists('ur_show_rating_stars') && osc_item_user_id() !== 0) { echo ur_show_rating_stars(); }
if(function_exists('ur_add_rating_link') && osc_item_user_id() !== 0) { echo ur_add_rating_link(); }

But for the item details where the hook is automatically added, the plugin needs to be moded.

Can you please instruct us how to do it?

Thanks!
Title: Re: Show the plugin only for registered users
Post by: MB Themes on April 20, 2020, 08:03:50 AM
@Tango
You must place button manually and wrap it into block:
Code: [Select]
if(osc_is_web_user_logged_in()) {
... button...
}
Title: Re: Show the plugin only for registered users
Post by: Tango on April 20, 2020, 06:28:17 PM
That's right, I forgot you can disable the auto hooks from the plugin settings.

Thanks a lot!