aboutsummaryrefslogtreecommitdiff
path: root/src/java
diff options
context:
space:
mode:
authorGravatar Ugnich Anton2013-09-06 15:02:30 +0700
committerGravatar Ugnich Anton2013-09-06 15:02:30 +0700
commit02fa30624211b46c8f2adcd0c459ffeb1c35a743 (patch)
tree68fc8e0678395ae3cad98d5e4bcab7d9ea417961 /src/java
parente1d907ac56fcfe5c380ef781530488c799a1f477 (diff)
Bugfixes: PNG, tags, htmlencode
Diffstat (limited to 'src/java')
-rw-r--r--src/java/NewMessage.properties2
-rw-r--r--src/java/NewMessage_ru.properties2
-rw-r--r--src/java/com/juick/http/www/Blogs.java4
-rw-r--r--src/java/com/juick/http/www/User.java2
-rw-r--r--src/java/com/juick/http/www/Utils.java13
5 files changed, 7 insertions, 16 deletions
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("&", "&amp;");
- ret = ret.replaceAll("<", "&lt;");
- ret = ret.replaceAll(">", "&gt;");
- ret = ret.replaceAll("'", "&apos;");
- ret = ret.replaceAll("\"", "&quot;");
- ret = ret.replaceAll("\n", "&#10;");
- return str;
+ return str.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll("'", "&apos;").replaceAll("\"", "&quot;").replaceAll("\n", "&#10;");
}
public static String encodeSphinx(String str) {
- String ret = str;
- ret = ret.replaceAll("@", "\\\\@");
- return ret;
+ return str.replaceAll("@", "\\\\@");
}
public static String fetchURL(String url) {