diff options
author | Ugnich Anton | 2012-10-16 17:31:27 +0700 |
---|---|---|
committer | Ugnich Anton | 2012-10-16 17:31:27 +0700 |
commit | c49e78bef068f4c4607d6d572366661e40b404be (patch) | |
tree | 25f6cfdbe413aa3209f93a5f39cf26e1dfb89124 /src/java/com/juick/http/www/Blogs.java | |
parent | cd3776013be1846fc7081371abaae4c8ae5ec9f1 (diff) |
blog title
Diffstat (limited to 'src/java/com/juick/http/www/Blogs.java')
-rw-r--r-- | src/java/com/juick/http/www/Blogs.java | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/src/java/com/juick/http/www/Blogs.java b/src/java/com/juick/http/www/Blogs.java index ea728eab..e43addb9 100644 --- a/src/java/com/juick/http/www/Blogs.java +++ b/src/java/com/juick/http/www/Blogs.java @@ -154,10 +154,10 @@ public class Blogs { if (mids.size() == 20) { String nextpage = "?before=" + mids.get(mids.size() - 1); if (paramShow != null) { - nextpage += "&show=" + paramShow; + nextpage += "&show=" + paramShow; } if (paramTag > 0) { - nextpage += "&tag=" + URLEncoder.encode(paramTagStr, "UTF-8"); + nextpage += "&tag=" + URLEncoder.encode(paramTagStr, "UTF-8"); } out.println("<p class=\"page\"><a href=\"" + nextpage + "\">Older →</a></p>"); } @@ -167,23 +167,22 @@ public class Blogs { out.println("<div id=\"column\" class=\"stickya\">"); - out.println("<h2>" + rb.getString("Lists") + "</h2>"); if (visitor != null) { - out.println("<ul>"); - out.println(" <li><a href=\"?show=my\">" + rb.getString("My feed") + "</a></li>"); - out.println(" <li><a href=\"?show=private\">" + rb.getString("Private") + "</a></li>"); - out.println(" <li><a href=\"?show=discuss\">" + rb.getString("Discussions") + "</a></li>"); - out.println(" <li><a href=\"?show=recommended\">" + rb.getString("Recommended") + "</a></li>"); - out.println("</ul>"); - out.println("<hr/>"); + out.println(" <ul>"); + out.println(" <li><a href=\"?show=my\">" + rb.getString("My feed") + "</a></li>"); + out.println(" <li><a href=\"?show=private\">" + rb.getString("Private") + "</a></li>"); + out.println(" <li><a href=\"?show=discuss\">" + rb.getString("Discussions") + "</a></li>"); + out.println(" <li><a href=\"?show=recommended\">" + rb.getString("Recommended") + "</a></li>"); + out.println(" </ul>"); + out.println(" <hr/>"); } - out.println("<ul>"); - out.println(" <li><a href=\"?\">" + rb.getString("All messages") + "</a></li>"); - out.println(" <li><a href=\"?show=top\">" + rb.getString("Popular") + "</a></li>"); - out.println(" <li><a href=\"?show=photos\">" + rb.getString("With photos") + "</a></li>"); - out.println("</ul>"); - out.println("<hr/>"); - out.println("<p>" + getTags(sql, 30) + "</p>"); + out.println(" <ul>"); + out.println(" <li><a href=\"?\">" + rb.getString("All messages") + "</a></li>"); + out.println(" <li><a href=\"?show=top\">" + rb.getString("Popular") + "</a></li>"); + out.println(" <li><a href=\"?show=photos\">" + rb.getString("With photos") + "</a></li>"); + out.println(" </ul>"); + out.println(" <hr/>"); + out.println(" <p>" + getTags(sql, 30) + "</p>"); out.println("</div>"); out.println("<div id=\"rcol\"></div>"); @@ -204,7 +203,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 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(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.setInt(1, cnt); rs = stmt.executeQuery(); rs.beforeFirst(); |