Changeset 4310
- Timestamp:
- 06/11/06 02:19:09 (2 years ago)
- Files:
-
- animanga/trunk/lib/Animanga/Display.pm (modified) (3 diffs)
- animanga/trunk/scripts/www/comments.pl (modified) (3 diffs)
- animanga/trunk/templates/www/comment-overview (added)
- animanga/trunk/templates/www/comments (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
animanga/trunk/lib/Animanga/Display.pm
r4303 r4310 175 175 176 176 # see if we found the first new comment 177 if(!$self->session("commentnewreply") && 178 Date::Parse::str2time($_->{"time"}) > Date::Parse::str2time($self->user("last"))) { 177 if(!$self->session("commentnewreply") && $_->{"unixtime"} > $self->user("unixlast")) { 179 178 $self->setSession("commentnewreply", $_->{"cid"}); 180 179 $self->setSession("commentnewreplyatcount", $self->session("commentcount")); … … 269 268 $self->display("comment-list", $_, $out); 270 269 } 270 elsif($style == $self->constant("commentoverview")) { 271 $self->display("comment-overview", $_, $out); 272 } 271 273 elsif($style == $self->constant("commentindex")) { 272 274 $self->display("comment-index", $_, $out); … … 276 278 # display children 277 279 unless($no_children) { 278 $self->displayComments($self->commentsWithPid($_->{"cid"}, 1), $style, $no_children, $no_pages, $out, 1);280 $self->displayComments($self->commentsWithPid($_->{"cid"}, ($style == $commentnested)), $style, $no_children, $no_pages, $out, 1); 279 281 } 280 282 } animanga/trunk/scripts/www/comments.pl
r4302 r4310 26 26 # get parameters 27 27 my $cid = $a->param("cid"); 28 my $overview = $a->param("overview"); 28 29 $a->redirect("search.pl") unless $cid; 29 30 … … 33 34 34 35 # get comment 35 my $comment = $a->commentWithCid($cid, 1);36 my $comment = $a->commentWithCid($cid, !$overview); 36 37 $a->redirect("search.pl") unless $comment->{"cid"}; 37 38 my $offset = $a->param("offset") || 0; 38 39 39 40 40 # display comments 41 41 my $comments; 42 $a->displayComments($comment, $a->constant("commentnested"), 0, 0, \$comments); 42 43 if($overview) { 44 $a->displayComments($comment, $a->constant("commentoverview"), 0, 1, \$comments); 45 } else { 46 $a->displayComments($comment, $a->constant("commentnested"), 0, 0, \$comments); 47 } 43 48 44 49 # check where it found our reply … … 68 73 # check if it overflowed into pages 69 74 my $pageselect; 70 my $pages = POSIX::ceil($a->session("commentcount") / $a->user("commentsperpage")); 71 72 if($pages > 1) { 73 $a->display("comments-pages", { 74 cid => $cid, 75 offset => $offset, 76 pages => $pages, 77 }, \$pageselect); 75 my $pages = 1; 76 77 if(!$overview) { 78 $pages = POSIX::ceil($a->session("commentcount") / $a->user("commentsperpage")); 79 80 if($pages > 1) { 81 $a->display("comments-pages", { 82 cid => $cid, 83 offset => $offset, 84 pages => $pages, 85 }, \$pageselect); 86 } 78 87 } 79 88 animanga/trunk/templates/www/comments
r4302 r4310 1 1 <div class="page"> 2 <? wrapper "include/header-green-large-small" ?><? page.commentcount ?> <? page.commentcount filter commentstring ?><? if page.pages > 1 ?>, visar <? page.offset + 1 ?>-<? if user.commentsperpage + page.offset > page.commentcount ?><? page.commentcount ?><? else ?><? user.commentsperpage + page.offset ?><? end ?><? end ?> | ”<? page.attached ?>”<? end ?>2 <? wrapper "include/header-green-large-small" ?><? page.commentcount ?> <? page.commentcount filter commentstring ?><? if page.pages > 1 ?>, visar <? page.offset + 1 ?>-<? if user.commentsperpage + page.offset > page.commentcount ?><? page.commentcount ?><? else ?><? user.commentsperpage + page.offset ?><? end ?><? end ?> | <? if !params.overview ?><a href="<? urls.www ?>/comments.pl?cid=<? params.cid ?>;overview=1">Översikt</a> | <? end ?> ”<? page.attached ?>”<? end ?> 3 3 4 4 <? if page.pageselect ?> … … 10 10 <table border="0" cellspacing="0" cellpadding="0"> 11 11 <tr><td> 12 <? if params.overview ?> 13 <br /> 14 <? end ?> 15 12 16 <? page.comments ?> 13 17 </td></tr> … … 24 28 <br /> 25 29 26 <? if !pa ge.locked || user.senseicomments?>27 <div style="clear: both;">30 <? if !params.overview && (!page.locked || user.senseicomments) ?> 31 <div style="clear: both;"> 28 32 <? wrapper "include/header-green-large" ?>Snabbsvar på ”<? page.title ?>”<? end ?> 29 33
