diff options
author | 2013-10-17 20:23:34 +0700 | |
---|---|---|
committer | 2013-10-17 20:23:34 +0700 | |
commit | 4757bfefd416ba905a8a1df73c570e3e700aeefb (patch) | |
tree | 16b634ad35f30f4c786f67768a253cde13f15b54 | |
parent | f5c7fe7a3f295f9b49bf19057b07b82d3e475223 (diff) |
Messages.getPopular SQL changed
-rw-r--r-- | src/com/juick/server/MessagesQueries.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/com/juick/server/MessagesQueries.java b/src/com/juick/server/MessagesQueries.java index 5e3cc238..ede236db 100644 --- a/src/com/juick/server/MessagesQueries.java +++ b/src/com/juick/server/MessagesQueries.java @@ -501,10 +501,10 @@ public class MessagesQueries { ResultSet rs = null; try { if (before > 0) { - stmt = sql.prepareStatement("SELECT messages.message_id FROM messages INNER JOIN favorites ON (favorites.user_id=11574 AND favorites.message_id=messages.message_id) WHERE messages.message_id<? AND messages.privacy>0 ORDER BY messages.message_id DESC LIMIT 20"); + stmt = sql.prepareStatement("SELECT message_id FROM messages WHERE message_id<? AND privacy>0 AND popular=1 ORDER BY message_id DESC LIMIT 20"); stmt.setInt(1, before); } else { - stmt = sql.prepareStatement("SELECT messages.message_id FROM messages INNER JOIN favorites ON (favorites.user_id=11574 AND favorites.message_id=messages.message_id) WHERE messages.privacy>0 ORDER BY messages.message_id DESC LIMIT 20"); + stmt = sql.prepareStatement("SELECT message_id FROM messages WHERE privacy>0 AND popular=1 ORDER BY message_id DESC LIMIT 20"); } rs = stmt.executeQuery(); rs.beforeFirst(); |