リビジョン | 356 (tree) |
---|---|
日時 | 2014-12-18 06:25:13 |
作者 | kmorimatsu |
Hide comments when HIDDEN flags are up.
@@ -18,7 +18,7 @@ | ||
18 | 18 | return '_JP_LATESTCOMMENTS_DESC'; |
19 | 19 | } |
20 | 20 | static public function version(){ |
21 | - return '0.1.2'; | |
21 | + return '0.1.3'; | |
22 | 22 | } |
23 | 23 | static public function tag_latestcomments(&$data,$skin=false,$max=false,$gid=false){ |
24 | 24 | if (!$max) $max=isset($data['max']) ? $data['max']:10; |
@@ -26,12 +26,14 @@ | ||
26 | 26 | $select='SELECT g.id as gid, ExtractValue(g.xml,"url") as url, c.id as id, c.itemid as itemid, c.body as body, c.author as author, c.flags as flags, c.xml as xml'; |
27 | 27 | if ($gid) { |
28 | 28 | $query=$select.' FROM jeans_comment as c, jeans_item as i, jeans_group as g |
29 | - WHERE c.itemid=i.id AND NOT i.flags & <%const:sql::FLAG_HIDDEN%> | |
29 | + WHERE c.itemid=i.id AND NOT c.flags & <%const:sql::FLAG_HIDDEN%> | |
30 | + AND NOT i.flags & <%const:sql::FLAG_HIDDEN%> | |
30 | 31 | AND i.gid=g.id AND g.id=<%gid%> AND NOT g.flags & <%const:sql::FLAG_HIDDEN%> |
31 | 32 | ORDER BY c.id ASC LIMIT <%max%> '; |
32 | 33 | } else { |
33 | 34 | $query=$select.' FROM jeans_comment as c, jeans_item as i, jeans_group as g |
34 | - WHERE c.itemid=i.id AND NOT i.flags & <%const:sql::FLAG_HIDDEN%> | |
35 | + WHERE c.itemid=i.id AND NOT c.flags & <%const:sql::FLAG_HIDDEN%> | |
36 | + AND NOT i.flags & <%const:sql::FLAG_HIDDEN%> | |
35 | 37 | AND i.gid=g.id AND NOT g.flags & <%const:sql::FLAG_HIDDEN%> |
36 | 38 | ORDER BY c.id DESC LIMIT <%max%> '; |
37 | 39 | } |