Rating not working

chymp
Posts: 43
Joined: Tue Feb 12, 2013 11:00 pm

Rating not working

Post by chymp »

I've followed the instructions here http://smartcj.com/wiki/doku.php?id=new_rotation_hints and can't get the rating system to work. I get no message upon clicking and no rating is stored in the db.

Another thing is that I am not sure that new thumbs are rotating into the spots I have designated. This is a no skim site, but I do have the required code showing up after all galleries on every page (?7x1x87361) and clicks are being recorded, but I never see new thumbs move onto the main page.
chymp
Posts: 43
Joined: Tue Feb 12, 2013 11:00 pm

Re: Rating not working

Post by chymp »

Any help here? Let me know if you need more details or have any suggestions for me to check.
admin
Site Admin
Posts: 37241
Joined: Wed Sep 10, 2008 11:43 am

Re: Rating not working

Post by admin »

So you add that code in templates, right ?
Don't forget to run script update
chymp
Posts: 43
Joined: Tue Feb 12, 2013 11:00 pm

Re: Rating not working

Post by chymp »

Yes, I added the code to the picture gallery template so that it shows directly under the gallery. The <script> code is also in there above the rating code.
chymp
Posts: 43
Joined: Tue Feb 12, 2013 11:00 pm

Re: Rating not working

Post by chymp »

Please let me know about rotating in new thumbs as well. This does not seem to be working either.
admin
Site Admin
Posts: 37241
Joined: Wed Sep 10, 2008 11:43 am

Re: Rating not working

Post by admin »

are you talking about 7x1x87361 or rating ?

Let talk about 1 problem only in 1 topic.
Don't forget to run script update
chymp
Posts: 43
Joined: Tue Feb 12, 2013 11:00 pm

Re: Rating not working

Post by chymp »

Then let's talk about rating here. Please give me some feedback on what might be causing the issue, or what I should be looking for.
admin
Site Admin
Posts: 37241
Joined: Wed Sep 10, 2008 11:43 am

Re: Rating not working

Post by admin »

Get firebug for example and check if it posts any data to server plz.
Don't forget to run script update
chymp
Posts: 43
Joined: Tue Feb 12, 2013 11:00 pm

Re: Rating not working

Post by chymp »

In firebug I get this when I click:
ReferenceError: post_rating is not defined
[Break On This Error]

post_rating(1);

The exact code in my page is this:
<script src='/scj/includes/js/jquery.js' type="text/javascript"></script>

<script type="text/javascript">
function post_rating(value) {

$.get('/scj/tube/index.php',
{
'content_id': '<!--GALLERY_MD5-->',
'action': 'rating',
'rating': value
},
function(data) {
$('#rating_div').html('Thank you!');
}
);

</script>

and then for the rating images I have this:
<div id='rating_div'>
current rating = <?=(<!--RATING--> == 0) ? 'not rated' : round( (<!--RATING--> - 1) * 100 ) . '%'?> <br>
Rate This Set!

<span onclick='post_rating(2)' style="cursor: pointer"><img src="/images/thumbsup.png" alt="I like this gallery!" /></span>
<span onclick='post_rating(1)' style="cursor: pointer"><img src="/images/thumbsdown.png" alt="I dislike this gallery!" /></span>

</div>
chymp
Posts: 43
Joined: Tue Feb 12, 2013 11:00 pm

Re: Rating not working

Post by chymp »

I figured it out and it's a mistake in the manual, so you should fix it.

In your example code, you forgot the closing } after the );
Post Reply