diff options
author | Ugnich Anton | 2012-01-27 08:34:31 +0700 |
---|---|---|
committer | Ugnich Anton | 2012-01-27 08:34:31 +0700 |
commit | f656d844d0096cf8637746afaa1fab7dadaef261 (patch) | |
tree | 9c8145d8d72ed548f37d2e82596cfa9d63136ca0 /src/com/juick/server/UserQueries.java | |
parent | 55f03c70caeec32ae71e5afe99c4eae5b6b192d3 (diff) |
User.getCanMedia, Tag.getUserTagsAll
Diffstat (limited to 'src/com/juick/server/UserQueries.java')
-rw-r--r-- | src/com/juick/server/UserQueries.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/com/juick/server/UserQueries.java b/src/com/juick/server/UserQueries.java index 97cae91f..906f7742 100644 --- a/src/com/juick/server/UserQueries.java +++ b/src/com/juick/server/UserQueries.java @@ -215,4 +215,24 @@ public class UserQueries { Utils.finishSQL(null, stmt); } } + + public static boolean getCanMedia(Connection sql, int uid) { + boolean ret = false; + + PreparedStatement stmt = null; + ResultSet rs = null; + try { + stmt = sql.prepareStatement("SELECT users.lastphoto-UNIX_TIMESTAMP() FROM users WHERE id=?"); + stmt.setInt(1, uid); + rs = stmt.executeQuery(); + if (rs.first()) { + ret = rs.getInt(1) < 3600; + } + } catch (SQLException e) { + System.err.println(e); + } finally { + Utils.finishSQL(rs, stmt); + } + return ret; + } } |