Skip to content

Commit

Permalink
Added in missing group by for older stories block. Update to last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
eSilverStrike committed Dec 20, 2016
1 parent 6cbcfc6 commit 5cf75ea
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions public_html/lib-common.php
Expand Up @@ -3907,12 +3907,14 @@ function COM_olderStoriesBlock($help = '', $title = '', $position = '')
FROM {$_TABLES['stories']}, {$_TABLES['topic_assignments']} ta
WHERE ta.type = 'article' AND ta.id = sid " . COM_getLangSQL('sid', 'AND') . "
AND (perm_anon = 2) AND (frontpage = 1) AND (date <= NOW()) AND (draft_flag = 0)" . COM_getTopicSQL('AND', 1, 'ta') . "
GROUP BY sid
ORDER BY featured DESC, date DESC LIMIT {$_CONF['limitnews']}, {$_CONF['limitnews']}";

$sql['pgsql'] = "SELECT sid,ta.tid,title,comments,date_part('epoch',date) AS day
FROM {$_TABLES['stories']}, {$_TABLES['topic_assignments']} ta
WHERE ta.type = 'article' AND ta.id = sid " . COM_getLangSQL('sid', 'AND') . "
AND (perm_anon = 2) AND (frontpage = 1) AND (date <= NOW()) AND (draft_flag = 0)" . COM_getTopicSQL('AND', 1, 'ta') . "
GROUP BY sid
ORDER BY featured DESC, date DESC LIMIT {$_CONF['limitnews']}, {$_CONF['limitnews']}";

$result = DB_query($sql);
Expand Down

0 comments on commit 5cf75ea

Please sign in to comment.