diff options
-rw-r--r-- | nbproject/genfiles.properties | 4 | ||||
-rw-r--r-- | nbproject/project.properties | 3 | ||||
-rw-r--r-- | nbproject/project.xml | 12 | ||||
-rw-r--r-- | src/java/NewMessage.properties | 2 | ||||
-rw-r--r-- | src/java/NewMessage_ru.properties | 2 | ||||
-rw-r--r-- | src/java/com/juick/http/www/Blogs.java | 4 | ||||
-rw-r--r-- | src/java/com/juick/http/www/User.java | 2 | ||||
-rw-r--r-- | src/java/com/juick/http/www/Utils.java | 13 |
8 files changed, 24 insertions, 18 deletions
diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties index 9f68753d..a836f39b 100644 --- a/nbproject/genfiles.properties +++ b/nbproject/genfiles.properties @@ -3,6 +3,6 @@ build.xml.script.CRC32=c93fa366 build.xml.stylesheet.CRC32=651128d4@1.33.1.1 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=ace7f602 -nbproject/build-impl.xml.script.CRC32=e812c1f8 +nbproject/build-impl.xml.data.CRC32=b3ae4a4b +nbproject/build-impl.xml.script.CRC32=c272645e nbproject/build-impl.xml.stylesheet.CRC32=0cbf5bb7@1.33.1.1 diff --git a/nbproject/project.properties b/nbproject/project.properties index 5b8c8172..e4f4ee12 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -37,6 +37,7 @@ javac.classpath=\ ${reference.com_juick.jar}:\ ${reference.com_juick_server.jar}:\ ${reference.com_juick_xmpp.jar}:\ + ${reference.com_juick_json.jar}:\ ${libs.JSON.classpath} # Space-separated list of extra javac options javac.compilerargs= @@ -67,9 +68,11 @@ lib.dir=${web.docbase.dir}/WEB-INF/lib persistence.xml.dir=${conf.dir} platform.active=default_platform project.com_juick=../com.juick +project.com_juick_json=../com.juick.json project.com_juick_server=../com.juick.server project.com_juick_xmpp=../com.juick.xmpp reference.com_juick.jar=${project.com_juick}/dist/com.juick.jar +reference.com_juick_json.jar=${project.com_juick_json}/dist/com.juick.json.jar reference.com_juick_server.jar=${project.com_juick_server}/dist/com.juick.server.jar reference.com_juick_xmpp.jar=${project.com_juick_xmpp}/dist/com.juick.xmpp.jar resource.dir=setup diff --git a/nbproject/project.xml b/nbproject/project.xml index acac92b2..2b60b093 100644 --- a/nbproject/project.xml +++ b/nbproject/project.xml @@ -19,6 +19,10 @@ <path-in-war>WEB-INF/lib</path-in-war> </library> <library dirs="200"> + <file>${reference.com_juick_json.jar}</file> + <path-in-war>WEB-INF/lib</path-in-war> + </library> + <library dirs="200"> <file>${libs.JSON.classpath}</file> <path-in-war>WEB-INF/lib</path-in-war> </library> @@ -41,6 +45,14 @@ <id>jar</id> </reference> <reference> + <foreign-project>com_juick_json</foreign-project> + <artifact-type>jar</artifact-type> + <script>build.xml</script> + <target>jar</target> + <clean-target>clean</clean-target> + <id>jar</id> + </reference> + <reference> <foreign-project>com_juick_server</foreign-project> <artifact-type>jar</artifact-type> <script>build.xml</script> diff --git a/src/java/NewMessage.properties b/src/java/NewMessage.properties index 93d91111..2108f861 100644 --- a/src/java/NewMessage.properties +++ b/src/java/NewMessage.properties @@ -9,5 +9,5 @@ from\ webcam=from webcam Webcam\ photo=Webcam photo Post=Post Tags=Tags -Photo_JPG=Photo: JPG, up to 10Mb. Video: MP4/3GP/MOV/WMV/AVI/M4V, up to 100Mb. +Photo_JPG=Photo: JPG, PNG, up to 10Mb. Video: MP4/3GP/MOV/WMV/AVI/M4V, up to 100Mb. or=or diff --git a/src/java/NewMessage_ru.properties b/src/java/NewMessage_ru.properties index bb61fe23..5e674cfd 100644 --- a/src/java/NewMessage_ru.properties +++ b/src/java/NewMessage_ru.properties @@ -10,5 +10,5 @@ from\ webcam=\u0441 \u0432\u0435\u0431\u043a\u0430\u043c\u0435\u0440\u044b Webcam\ photo=\u0424\u043e\u0442\u043e \u0441 \u0432\u0435\u0431\u043a\u0430\u043c\u0435\u0440\u044b Post=\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c Tags=\u0422\u0435\u0433\u0438 -Photo_JPG=\u0424\u043e\u0442\u043e: JPG, \u0434\u043e 10\u041c\u0431. \u0412\u0438\u0434\u0435\u043e: MP4/3GP/MOV/WMV/AVI/M4V, \u0434\u043e 100Mb. +Photo_JPG=\u0424\u043e\u0442\u043e: JPG, PNG, \u0434\u043e 10\u041c\u0431. \u0412\u0438\u0434\u0435\u043e: MP4/3GP/MOV/WMV/AVI/M4V, \u0434\u043e 100Mb. or=\u0438\u043b\u0438 diff --git a/src/java/com/juick/http/www/Blogs.java b/src/java/com/juick/http/www/Blogs.java index 8e459dc1..0f13d946 100644 --- a/src/java/com/juick/http/www/Blogs.java +++ b/src/java/com/juick/http/www/Blogs.java @@ -213,7 +213,7 @@ public class Blogs { out.println(" <li><a href=\"/?show=photos\">" + rb.getString("With photos") + "</a></li>"); out.println(" </ul>"); out.println(" <hr/>"); - out.println(" <p>" + getTags(sql, 40) + "</p>"); + out.println(" <p>" + getTags(sql, 45) + "</p>"); out.println("</div>"); out.println("</div>"); // topwrapper @@ -233,7 +233,7 @@ public class Blogs { PreparedStatement stmt = null; ResultSet rs = null; try { - stmt = sql.prepareStatement("SELECT tags.name AS name,COUNT(DISTINCT messages.user_id) AS cnt FROM (messages INNER JOIN messages_tags ON (messages.ts>TIMESTAMPADD(DAY,-3,NOW()) AND messages.message_id=messages_tags.message_id)) INNER JOIN tags ON messages_tags.tag_id=tags.tag_id WHERE tags.tag_id NOT IN (SELECT tag_id FROM tags_ignore) GROUP BY tags.tag_id ORDER BY cnt DESC LIMIT ?"); + stmt = sql.prepareStatement("SELECT tags.name AS name,COUNT(DISTINCT messages.user_id) AS cnt FROM (messages INNER JOIN messages_tags ON (messages.ts>TIMESTAMPADD(MONTH,-1,NOW()) AND messages.message_id=messages_tags.message_id)) INNER JOIN tags ON messages_tags.tag_id=tags.tag_id WHERE tags.tag_id NOT IN (SELECT tag_id FROM tags_ignore) GROUP BY tags.tag_id ORDER BY cnt DESC LIMIT ?"); stmt.setInt(1, cnt); rs = stmt.executeQuery(); rs.beforeFirst(); diff --git a/src/java/com/juick/http/www/User.java b/src/java/com/juick/http/www/User.java index 83226089..3b526727 100644 --- a/src/java/com/juick/http/www/User.java +++ b/src/java/com/juick/http/www/User.java @@ -304,7 +304,7 @@ public class User { } else { out.println(" <li><a href=\"/post?body=BL+%40" + user.UName + "\" title=\"" + rb.getString("(UToolbar) Block") + "\"><div style=\"background-position: -80px 0\"></div></a></li>"); } - if (!UserQueries.isInBL(sql, user.UID, visitor.UID)) { + if (!UserQueries.isInBL(sql, user.UID, visitor.UID) && !UserQueries.isInBL(sql, visitor.UID, user.UID)) { out.println(" <li><a href=\"/post?body=PM+%40" + user.UName + "\" title=\"" + rb.getString("(UToolbar) Private") + "\"><div style=\"background-position: -112px 0\"></div></a></li>"); } out.println(" </ul>"); diff --git a/src/java/com/juick/http/www/Utils.java b/src/java/com/juick/http/www/Utils.java index 4c41555e..b2d9a999 100644 --- a/src/java/com/juick/http/www/Utils.java +++ b/src/java/com/juick/http/www/Utils.java @@ -107,20 +107,11 @@ public class Utils { } public static String encodeHTML(String str) { - String ret = str; - ret = ret.replaceAll("&", "&"); - ret = ret.replaceAll("<", "<"); - ret = ret.replaceAll(">", ">"); - ret = ret.replaceAll("'", "'"); - ret = ret.replaceAll("\"", """); - ret = ret.replaceAll("\n", " "); - return str; + return str.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll("'", "'").replaceAll("\"", """).replaceAll("\n", " "); } public static String encodeSphinx(String str) { - String ret = str; - ret = ret.replaceAll("@", "\\\\@"); - return ret; + return str.replaceAll("@", "\\\\@"); } public static String fetchURL(String url) { |