hizel/lorsource — comment on commit 20fe477fe71917ae08e2f8b66cb8b8b24778ee2e
File:  line 0
By hizel:

```

SELECT t.userid as author,
t.id,
lastmod,
t.stat1 AS stat1,
t.stat3 AS stat3,
t.stat4 AS stat4,
g.id AS gid,
g.title AS gtitle,
t.title AS title,
comments.id as cid,
comments.userid AS last_comment_by,
t.resolved as resolved,
section,
urlname,
comments.postdate,
sections.moderate as smod,
t.moderate
FROM topics AS t,
groups AS g,
comments,
sections
WHERE g.section=sections.id AND
not t.deleted AND
t.id=comments.topic AND
t.groupid=g.id AND
comments.id=(SELECT id FROM comments WHERE NOT deleted AND comments.topic=t.id ORDER BY postdate DESC LIMIT 1) AND
t.lastmod > '2011-09-01' AND
t.userid NOT IN (select ignored from ignore_list where userid=40058)

UNION ALL

SELECT t.userid as author,
t.id,
lastmod,
t.stat1 AS stat1,
t.stat3 AS stat3,
t.stat4 AS stat4,
g.id AS gid,
g.title AS gtitle,
t.title AS title,
0,
0,
t.resolved as resolved,
section,
urlname,
postdate,
sections.moderate as smod,
t.moderate
FROM topics AS t,
groups AS g,
sections
WHERE sections.id=g.section AND
not t.deleted AND
t.postdate > '2011-09-01' AND
t.userid NOT IN (select ignored from ignore_list where userid=40058) AND
t.stat1=0 AND
g.id=t.groupid

UNION ALL

SELECT wiki_user_id as author,
topic_id as id,
change_date as lastmod,
0 as stat1,
0 as stat3,
0 as stat4,
0 as gid,
'wiki' as gtitle,
topic_name as title,
0 as cid,
0 as last_comment_by,
'f' as resolved,
0 as section,
'' as urlname,
change_date as postdate,
'f' as smod,
'f' as moderate
FROM jam_recent_change
WHERE topic_id is not null and change_date > '2011-09-01' ORDER BY lastmod DESC LIMIT 100 OFFSET 0;
```