Rating:rankings limit bug
Posted: 18 September 2007 06:21 PM   [ Ignore ]
Sr. Member
Avatar
RankRankRankRank
Total Posts:  119
Joined  2005-09-13

{exp:rating:rankings weblog="photos" form_name="ratings" limit="10" precision="2" sort="desc"}
<a class="collectionthumb" href="{path=views/details}{entry_id}" target="top" title="{title}" style="background-image:url(/phpthumb/phpThumb.php?src={imagefile}&w;=50);"></a>
{/exp:rating:rankings}

The above code yields 6 loops. If I change it to limit="20" I get 16 (14 if I switch sort to asc)...?

Profile
 
 
Posted: 27 September 2007 11:45 PM   [ Ignore ]   [ # 1 ]
Sr. Member
Avatar
RankRankRankRank
Total Posts:  119
Joined  2005-09-13

This is still very perplexing. I put in limit="8" and I’m getting 5…

Profile
 
 
Posted: 28 September 2007 11:06 PM   [ Ignore ]   [ # 2 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  701
Joined  2004-03-30

That function is not the most brilliant I have ever written.

mk

 Signature 

Mitchell Kimbrough

Profile
 
 
Posted: 29 September 2007 10:58 AM   [ Ignore ]   [ # 3 ]
Sr. Member
Avatar
RankRankRankRank
Total Posts:  119
Joined  2005-09-13

Can you point me to the right lines to try to fix it? It’s really wacked. smile

Profile
 
 
Posted: 29 September 2007 11:24 AM   [ Ignore ]   [ # 4 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  701
Joined  2004-03-30

Tyler,

Due to the kinds of hooks that Ee does and does not have, the best ranking results that I have achieved have come from modifying the weblog module and installing an extension that is part of the Rating module package. Did you find an extension called ext:rating_order.php in the Rating module package, along with some instructions? That’s your best bet until EE adds some crucial extension hooks.

mk

 Signature 

Mitchell Kimbrough

Profile
 
 
Posted: 29 September 2007 11:31 AM   [ Ignore ]   [ # 5 ]
Sr. Member
Avatar
RankRankRankRank
Total Posts:  119
Joined  2005-09-13

Yeah, I got that extension installed and all, but how do I use it then? Just add orderby="rating" to the weblog:entries tag? That didn’t seem to work for me (unless I wasn’t looking closely enough). Also, if that IS the right paramters, is that ordering by the number of ratings or the average rating of the entries?

Profile
 
 
Posted: 29 September 2007 11:46 AM   [ Ignore ]   [ # 6 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  701
Joined  2004-03-30

Crack it open man. orderby_ratings="yes". It ranks by the rating total and you could hack it too if you wanted. I see you learning code over there man, don’t think I don’t see it. smile

mk

 Signature 

Mitchell Kimbrough

Profile
 
 
Posted: 29 September 2007 11:54 AM   [ Ignore ]   [ # 7 ]
Sr. Member
Avatar
RankRankRankRank
Total Posts:  119
Joined  2005-09-13

Okay, but what’s “t.sticky”?

Could I just replace t.rating_total with, eg., t.avg?

This won’t work if there are any other orderby parameters it looks like… correct?

Profile
 
 
Posted: 29 September 2007 12:31 PM   [ Ignore ]   [ # 8 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  701
Joined  2004-03-30

always preserve the sticky setting. If a blog entry is marked sticky, it floats to the top no matter what.

mk

 Signature 

Mitchell Kimbrough

Profile
 
 
Posted: 29 September 2007 12:33 PM   [ Ignore ]   [ # 9 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  701
Joined  2004-03-30

This method overrides whatever orderby params have been supplied. And yes, you can change the code to sort on rating avg, but for these purposes, rating total should give the same results.

mk

 Signature 

Mitchell Kimbrough

Profile
 
 
Posted: 29 September 2007 12:34 PM   [ Ignore ]   [ # 10 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  701
Joined  2004-03-30

Seriously, read the readme file and make sure you hack the weblog entries file.

 Signature 

Mitchell Kimbrough

Profile
 
 
Posted: 29 September 2007 06:38 PM   [ Ignore ]   [ # 11 ]
Sr. Member
Avatar
RankRankRankRank
Total Posts:  119
Joined  2005-09-13

Hey Mitchell, I’ve hacked the weblog module file, uploaded it, the extension is enabled and.... it’s working. At least as far as ordering by number of ratings. But what is the “t” table it’s refering to?

Profile
 
 
Posted: 30 September 2007 05:06 PM   [ Ignore ]   [ # 12 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  701
Joined  2004-03-30

Have a look at the main weblog:entries SQL query. Rick and Paul alias the exp_weblog_titles table as t

mk

 Signature 

Mitchell Kimbrough

Profile
 
 
Posted: 30 September 2007 05:11 PM   [ Ignore ]   [ # 13 ]
Sr. Member
Avatar
RankRankRankRank
Total Posts:  119
Joined  2005-09-13

So how do you get the t.rating_total from the weblog:entries query? Is it already joined for me to use then?

Profile