From 23ed8e10c1ced621413f116d3a324a2758949ec8 Mon Sep 17 00:00:00 2001 From: Ugnich Anton Date: Thu, 24 Oct 2013 02:14:55 +0700 Subject: 40 messages per tag for unknown user --- src/java/com/juick/http/www/Discover.java | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'src/java/com/juick') diff --git a/src/java/com/juick/http/www/Discover.java b/src/java/com/juick/http/www/Discover.java index b76a1d77..a9ae360a 100644 --- a/src/java/com/juick/http/www/Discover.java +++ b/src/java/com/juick/http/www/Discover.java @@ -83,7 +83,7 @@ public class Discover { if (paramShow == null) { if (paramTag > 0) { title = "*" + Utils.encodeHTML(paramTagStr); - mids = MessagesQueries.getTag(sql, paramTag, visitor_uid, paramBefore); + mids = MessagesQueries.getTag(sql, paramTag, visitor_uid, paramBefore, (visitor == null) ? 40 : 20); } else if (paramSearch != null) { title = rb.getString("Search") + ": " + Utils.encodeHTML(paramSearch); mids = MessagesQueries.getSearch(sql, sqlSearch, Utils.encodeSphinx(paramSearch), paramBefore); @@ -115,15 +115,19 @@ public class Discover { out.println(""); } - if (mids.size() == 20) { - String nextpage = "?before=" + mids.get(mids.size() - 1); - if (paramShow != null) { - nextpage += "&show=" + paramShow; + if (visitor != null) { + if (mids.size() == 20) { + String nextpage = "?before=" + mids.get(mids.size() - 1); + if (paramShow != null) { + nextpage += "&show=" + paramShow; + } + if (paramSearch != null) { + nextpage += "&search=" + URLEncoder.encode(paramSearch, "UTF-8"); + } + out.println("
"); } - if (paramSearch != null) { - nextpage += "&search=" + URLEncoder.encode(paramSearch, "UTF-8"); - } - out.println(""); + } else { + out.println("" + rb.getString("LoginToReadMore") + "
"); } PageTemplates.pageFooter(request, out, locale, visitor, true); out.println(""); @@ -136,7 +140,7 @@ public class Discover { out.println("" + getTags(sql, 45) + "
"); + out.println("" + getTags(sql, 60) + "
"); out.println(""); out.println(""); // topwrapper -- cgit v1.2.3