Keyword

K2 Rating Enable for Guest?

  • euphie alucard
  • euphie alucard's Avatar Topic Author
  • Offline
  • New Member
More
10 years 8 months ago #123099 by euphie alucard
K2 Rating Enable for Guest? was created by euphie alucard
Hi there!

I love K2 Rating and was just wondering if there was a way to enable Rating for Guest Users maybe by IP or something? Since I am just planning to use Disqus as a commenting feature and didn't want to deal with a lot of accounts created on site.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 8 months ago #123100 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: K2 Rating Enable for Guest?
Hello euphie,

You can do this with template overrides.

You can insert a check (not just for rating but for other parts as well) to see if the user is not a guest.

Example code:
<?php $user = JFactory::getUser(); ?>
<?php if( $user->guest ) : ?>
        do something (for example show text or image)
<?php else : ?>
        here goes ratings code
<?php endif; ?>

HInt: make sure that $user is not defined elsewhere in the template.
Hint2: Use template overrides, read this getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum