Permalink
Browse files

Don't include hidden posts or nonapproved blogs in toplists. Oops.

  • Loading branch information...
1 parent 35f19ec commit bc5d01aeaebb18d68a6afb34ab7f68831ae42e40 @mhagander committed Jun 17, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 generator.py
View
@@ -77,12 +77,12 @@ def Generate(self):
description=desc))
self.items.append(PlanetPost(post[0], post[1], post[2], post[3], post[5], post[6], desc, post[8], post[9]))
- c.execute("SELECT name,blogurl,feedurl,count(*) FROM planet.feeds INNER JOIN planet.posts ON planet.feeds.id=planet.posts.feed WHERE age(dat) < '1 month' AND team IS NULL GROUP BY name,blogurl,feedurl ORDER BY 4 DESC,1 LIMIT 20")
+ c.execute("SELECT name,blogurl,feedurl,count(*) FROM planet.feeds INNER JOIN planet.posts ON planet.feeds.id=planet.posts.feed WHERE age(dat) < '1 month' AND team IS NULL AND approved AND NOT hidden GROUP BY name,blogurl,feedurl ORDER BY 4 DESC,1 LIMIT 20")
for feed in c.fetchall():
self.topposters.append(PlanetFeed(feed))
if len(self.topposters) < 2: self.topposters = []
- c.execute("SELECT teams.name,teams.teamurl,NULL,count(*) FROM planet.teams INNER JOIN planet.feeds ON planet.feeds.team=planet.teams.id INNER JOIN planet.posts ON planet.feeds.id=planet.posts.feed WHERE age(dat) < '1 month' GROUP BY teams.name,teams.teamurl ORDER BY 4 DESC,1 LIMIT 10")
+ c.execute("SELECT teams.name,teams.teamurl,NULL,count(*) FROM planet.teams INNER JOIN planet.feeds ON planet.feeds.team=planet.teams.id INNER JOIN planet.posts ON planet.feeds.id=planet.posts.feed WHERE age(dat) < '1 month' AND approved AND NOT hidden GROUP BY teams.name,teams.teamurl ORDER BY 4 DESC,1 LIMIT 10")
for feed in c.fetchall():
self.topteams.append(PlanetFeed(feed))
if len(self.topteams) < 2: self.topteams = []

0 comments on commit bc5d01a

Please sign in to comment.