0

Hope you can help me here. My problem is following: I would like to set and dynamicaly change K2 item rate by my self while creating/modifying it. I'm using sorting "Highest Rated" and found out that it works like

$query .= ", (r.rating_sum/r.rating_count) AS rating";

so I suppose that i need to change parameter rating_sum and set rating_count to 1 permanently. So the question is next: How can I realize it? Whould be great to pick value from from 1 to 5.

I added printscreen of that what I want

In code I wrote

<td class="k2Center center"> 
         
<select id="ratenews">
                <option value="0.0">0</option>
    <option value="0.5">1</option>
    <option value="1.0">2</option>
    <option value="1.5">3</option>
    <option value="2.0">4</option>
    <option value="2.5">5</option>
    <option value="3.0">6</option>
    <option value="3.5">7</option>
    <option value="4.0">8</option>
    <option value="4.5">9</option>
    <option value="5.0">10</option>
</select>
</td>

And now I would like to change value of $rating_sum according to value selected and to set it as the rate of article. I found something in post here K2_content module rating but dont know how to use it. Please help!

Community
  • 1
  • 1
Amonnn
  • 301
  • 1
  • 4
  • 7
  • Can you please give a (meaningful) set of sample data and the expected result for that data? (meaning: At least I didn't get what you're trying to achieve.) – VolkerK Jun 03 '16 at 11:40
  • The main aim is to sort articles according to its rate. But the rate of article should be defined not by users, but by myself. For example I'm creating a new article now and at this moment its rate should be 5/5. And it should be at the top of the sorting list. But in hour a would like to change it's rate to 4/5. So I would like to have such option to change item rate in administration part of K2 – Amonnn Jun 03 '16 at 13:56

0 Answers0