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/Global.properties | 1 + src/java/Global_ru.properties | 1 + src/java/com/juick/http/www/Discover.java | 24 ++++++++++++++---------- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/java/Global.properties b/src/java/Global.properties index f823d7d2..afb765df 100644 --- a/src/java/Global.properties +++ b/src/java/Global.properties @@ -29,3 +29,4 @@ in\ reply\ to=in reply to (Dialog)\ Link\ to\ message=Permanent link to this message (Dialog)\ Message\ number=Message number (Dialog)\ Share=Share in social networks +LoginToReadMore=Sign in to read more diff --git a/src/java/Global_ru.properties b/src/java/Global_ru.properties index 2df1f883..84b12e5c 100644 --- a/src/java/Global_ru.properties +++ b/src/java/Global_ru.properties @@ -29,3 +29,4 @@ in\ reply\ to=\u0432 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 (Dialog)\ Link\ to\ message=\u041f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u044d\u0442\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 (Dialog)\ Message\ number=\u041d\u043e\u043c\u0435\u0440 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f (Dialog)\ Share=\u041f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0432 \u0441\u043e\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0435\u0442\u044f\u0445 +LoginToReadMore=\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0443\u0439\u0442\u0435\u0441\u044c, \u0447\u0442\u043e\u0431\u044b \u0447\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435 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