diff --git a/htroot/BlogComments.html b/htroot/BlogComments.html index c912353e7..b66e5ca7d 100644 --- a/htroot/BlogComments.html +++ b/htroot/BlogComments.html @@ -7,96 +7,110 @@ #%env/templates/header.template%# #(mode)# - -
-

#[subject]#

-
#[page]#
-

- #[date]# | by #[author]# | #[comments]# Comments + +

+

#[subject]#

+
#[page]#
+ +
+ -
- - #{entries}# -
-

#[subject]#

-
#[page]#
-

- #[date]# | by #[author]# - #(admin)#::| delete #(moderate)#::| allow#(/moderate)##(/admin)# -

-
- #{/entries}# - #(allow)# -
-

Comments are not allowed for this posting!

-
- :: -
-
-
-
-
- -
-
-
- -
-
-
- -

- You can use Yacy-Wiki Code here. -

-
-
- - - - -
-
- #(/allow)# +

Comments:

+ #{entries}# +
+

#[subject]#

+
#[page]#
+

+ #[date]# | by #[author]# + #(admin)#::| delete #(moderate)#::| allow#(/moderate)##(/admin)# +

+
+ #{/entries}# +
+ #(preventries)# + << previous entries + :: + << previous entries + #(/preventries)# +              + #(moreentries)# + next entries >> + :: + next entries >> + #(/moreentries)# +
+ #(allow)# +
+

Comments are not allowed for this posting!

+
+ :: +
+
+
+
+
+ +
+
+
+ +
+
+
+ +

+ You can use Yacy-Wiki Code here. +

+
+
+ + + + +
+
+ #(/allow)# :: - -
-

#[subject]#

-
#[page]#
-

- #[date]# | by #[author]# + +

+

#[subject]#

+
#[page]#
+ +
+ -
- -
-
-
-
-
- -
-
-
- -
-
-
- -

- You can use Yacy-Wiki Code here. -

-
-
- - - - - -
-
+
+
+
+
+
+ +
+
+
+ +
+
+
+ +

+ You can use Yacy-Wiki Code here. +

+
+
+ + + + + +
+
#(/mode)# #%env/templates/footer.template%# diff --git a/htroot/BlogComments.java b/htroot/BlogComments.java index ddf332335..d66f6f86e 100644 --- a/htroot/BlogComments.java +++ b/htroot/BlogComments.java @@ -269,15 +269,22 @@ public class BlogComments { } int count = 0; //counts how many entries are shown to the user int start = post.getInt("start",0); //indicates from where entries should be shown - int num = post.getInt("num",20); //indicates how many entries should be shown + int num = post.getInt("num",10); //indicates how many entries should be shown + boolean prev = false; //indicates if there were previous comments to the ones that are dispalyed if(xml) num = 0; + if (start < 1) start = 1; // dirrrty fix for incorrect comment count, need to find reason + if (start > 1) prev = true; int nextstart = start+num; //indicates the starting offset for next results - while(i.hasNext()) { - if(count >= num && num > 0) - break; + int prevstart = start-num; //indicates the starting offset for previous results + while(i.hasNext() && count < num) { + pageid = (String) i.next(); - if(0 < start--) + + if(start > 0) { + start--; continue; + } + entry = switchboard.blogCommentDB.read(pageid); if (commentMode == 2 && !hasRights && !entry.isAllowed()) @@ -317,8 +324,16 @@ public class BlogComments { prop.put("mode_moreentries", "1"); //more entries are availible prop.put("mode_moreentries_start", nextstart); prop.put("mode_moreentries_num", num); + prop.put("mode_moreentries_pageid", page.key()); } else prop.put("moreentries", "0"); + if(prev) { + prop.put("mode_preventries", "1"); + if (prevstart < 0) prevstart = 0; + prop.put("mode_preventries_start", prevstart); + prop.put("mode_preventries_num", num); + prop.put("mode_preventries_pageid", page.key()); + } else prop.put("preventries", "0"); } catch (IOException e) { } diff --git a/htroot/env/base.css b/htroot/env/base.css index edb4dbed7..e56e897b0 100644 --- a/htroot/env/base.css +++ b/htroot/env/base.css @@ -732,6 +732,10 @@ margin: 0px 30px 0px 30px; background-color:#eeeeee; } +div.BlogCommentPrevNext { +text-align: center; +} + /* other ------------------------------------*/ ul#menu { padding:0;