Keyword

Adding K2 rating system to custom module

  • William Gollinger
  • William Gollinger's Avatar Topic Author
  • Offline
  • New Member
More
13 years 3 weeks ago #99766 by William Gollinger
Adding K2 rating system to custom module was created by William Gollinger
I've made a custom module that displays information about an individual app, and I want to incorporate a rating system into it.  I found a rating system here: net.tutsplus.com/tutorials/html-css-techniques/building-a-5-star-rating-system-with-jquery-ajax-and-php/

 

I have it working in my module, but it's not the best.  Since my site already uses the K2 rating system, what I'd like to do is incorporate the K2 system instead.  Is there an easy way of doing this?  

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

  • William Gollinger
  • William Gollinger's Avatar Topic Author
  • Offline
  • New Member
More
13 years 16 hours ago #99767 by William Gollinger
Replied by William Gollinger on topic Adding K2 rating system to custom module
Here's a better question:

 

I decided that, in the interest of simplification, my module is only going to access and display the rating information that k2's system collects.  Specifically: each product will be rated on its individual page, and on the page featuring all of the products my custom module will indicate what the ratings are for each product.  

Therefore, I need to:

1) find out where k2 is storing the rating data, and

2) access the data, preferably with php and not javascript, since I am experiencing many javascript conflicts.  

 

Can anyone help me with either of these?  If I can find out where it's being stored, I can probably take it from there.

It's one of the last things I have left to do, but of course it's the stuff I haven't figured out that's still left.

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

  • William Gollinger
  • William Gollinger's Avatar Topic Author
  • Offline
  • New Member
More
12 years 11 months ago #99768 by William Gollinger
Replied by William Gollinger on topic Adding K2 rating system to custom module
Ok, so I think I understand what I need to do, but I need just a little help doing it.

 

If I can get a reference to a k2 item (presumably via its id), call it "$item", then I should be able to do "$item->params->get('itemRating')" or "$item->votingPercentage" to get the value I need.  Is that right?

 

So, what's the proper way to make this reference?  That's the part I'm having trouble understanding right now.  Like, what files do I need to include?  (Hopefully people are still reading this thread...)

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

  • Kannan Naidu Venugopal
  • Kannan Naidu Venugopal's Avatar
  • Offline
  • Platinum Member
  • Aham Brahmasmi
More
12 years 11 months ago #99769 by Kannan Naidu Venugopal
Replied by Kannan Naidu Venugopal on topic Adding K2 rating system to custom module
Hi William,

 

Maybe have a look at mod_k2content and see how it works and implement it into your custom module ?

K2 Rocks \m/

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


Powered by Kunena Forum