Crothian said:when I posted my review it subscribed it as a thread, except it linked to the main page of the reviews and listed Joe Kusner as the starter of the thread and 4 replies to it (which I guess to be the other three reviews and the single comment)
Michael Morris said:Yes, that's normal. The subscription system *sees* the product as a thread, and the reviews and comments are all replies to the product which starts the post. I may streamline it out later. As it stands though, you can subscribe to products and get updates whenever they are reviewed or commented to, but you can't subscribe to just one review.
Better than what we had though (no subscription system at all)
Shouldn't you just average the existing reviews without regard for how many products there are?Michael Morris said:Rats.. Hmm.. Well... I uh.. As soon as I figure out a correction to the query I'll recalculate it.
jmucchiello said:Shouldn't you just average the existing reviews without regard for how many products there are?
Select Sum(stars) as total_starts, Count(*) as total_reviews, publisher_id from reviews; (or join the reviews and pubs table if the pub_id is not available on the review table)
if (count > 0) stars = total_stars/total_reviews else stars = 0;
The number of products shouldn't enter into it.
But that averages the product scores which are already an average. So if a publisher have two products: one with 100 reviews and an average of 3 and one with 1 review of 5, the publisher will have a score of 4 by that querry. That's why my querry was off of the (assumed) review table instead of the product table.Michael Morris said:The correct query, I believe, will be
SELECT AVG(score) AS score FROM product WHERE publisherid = $publisherid AND score > 0
Haven't had time to test it yet - been taking a break.