aboutsummaryrefslogtreecommitdiff
path: root/src/java/com/juick/http/www/User.java
diff options
context:
space:
mode:
authorGravatar Ugnich Anton2014-02-15 13:13:04 +0700
committerGravatar Ugnich Anton2014-02-15 13:13:04 +0700
commit48b7aa72126b1a75e470077de48408d24fb1b546 (patch)
tree2149e2b47144a54280b965cc9a0b4b488c26d694 /src/java/com/juick/http/www/User.java
parentc25951ec334d94a9471ad0f2575b7c8ee4e7e21a (diff)
New message layout (article); Google Analytics; small bugfixes
Diffstat (limited to 'src/java/com/juick/http/www/User.java')
-rw-r--r--src/java/com/juick/http/www/User.java42
1 files changed, 23 insertions, 19 deletions
diff --git a/src/java/com/juick/http/www/User.java b/src/java/com/juick/http/www/User.java
index 71b9ae16..1e469a1d 100644
--- a/src/java/com/juick/http/www/User.java
+++ b/src/java/com/juick/http/www/User.java
@@ -49,8 +49,14 @@ public class User {
com.juick.Tag paramTag = null;
String paramTagStr = request.getParameter("tag");
- if (paramTagStr != null && paramTagStr.length() < 64) {
- paramTag = TagQueries.getTag(sql, paramTagStr, false);
+ if (paramTagStr != null) {
+ if (paramTagStr.length() < 64) {
+ paramTag = TagQueries.getTag(sql, paramTagStr, false);
+ }
+ if (paramTag == null) {
+ response.sendError(404);
+ return;
+ }
}
int paramBefore = 0;
@@ -107,28 +113,26 @@ public class User {
pageUserColumn(out, sql, user, visitor);
- out.println("<section id=\"content\">");
- out.println("<ul>");
if (mids.size() > 0) {
+ out.println("<section id=\"content\">");
PageTemplates.printMessages(out, sql, user, mids, visitor, visitor == null ? 4 : 5, 0);
- }
- out.println("</ul>");
- if (mids.size() >= 20) {
- String nextpage = "?before=" + mids.get(mids.size() - 1);
- if (paramShow != null) {
- nextpage += "&amp;show=" + paramShow;
- }
- if (paramTag != null) {
- nextpage += "&amp;tag=" + URLEncoder.encode(paramTag.Name, "UTF-8");
- }
- if (paramSearch != null) {
- nextpage += "&amp;search=" + URLEncoder.encode(paramSearch, "UTF-8");
+ if (mids.size() >= 20) {
+ String nextpage = "?before=" + mids.get(mids.size() - 1);
+ if (paramShow != null) {
+ nextpage += "&amp;show=" + paramShow;
+ }
+ if (paramTag != null) {
+ nextpage += "&amp;tag=" + URLEncoder.encode(paramTag.Name, "UTF-8");
+ }
+ if (paramSearch != null) {
+ nextpage += "&amp;search=" + URLEncoder.encode(paramSearch, "UTF-8");
+ }
+ out.println("<p class=\"page\"><a href=\"" + nextpage + "\">Older →</a></p>");
}
- out.println("<p class=\"page\"><a href=\"" + nextpage + "\">Older →</a></p>");
- }
- out.println("</section>");
+ out.println("</section>");
+ }
PageTemplates.pageFooter(request, out, visitor, true);
PageTemplates.pageDialogTemplate(out);