Changeset 4310

Show
Ignore:
Timestamp:
06/11/06 02:19:09 (2 years ago)
Author:
morris
Message:

Add commentoverview again, but make it optional via a link

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • animanga/trunk/lib/Animanga/Display.pm

    r4303 r4310  
    175175                 
    176176                # 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")) { 
    179178                        $self->setSession("commentnewreply", $_->{"cid"}); 
    180179                        $self->setSession("commentnewreplyatcount", $self->session("commentcount")); 
     
    269268                                $self->display("comment-list", $_, $out); 
    270269                        } 
     270                        elsif($style == $self->constant("commentoverview")) { 
     271                                $self->display("comment-overview", $_, $out); 
     272                        } 
    271273                        elsif($style == $self->constant("commentindex")) { 
    272274                                $self->display("comment-index", $_, $out); 
     
    276278                # display children 
    277279                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); 
    279281                } 
    280282        } 
  • animanga/trunk/scripts/www/comments.pl

    r4302 r4310  
    2626        # get parameters 
    2727        my $cid = $a->param("cid"); 
     28        my $overview = $a->param("overview"); 
    2829        $a->redirect("search.pl") unless $cid; 
    2930         
     
    3334 
    3435        # get comment 
    35         my $comment = $a->commentWithCid($cid, 1); 
     36        my $comment = $a->commentWithCid($cid, !$overview); 
    3637        $a->redirect("search.pl") unless $comment->{"cid"}; 
    3738        my $offset = $a->param("offset") || 0; 
    38          
    3939 
    4040        # display comments 
    4141        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        } 
    4348 
    4449        # check where it found our reply 
     
    6873        # check if it overflowed into pages 
    6974        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                } 
    7887        } 
    7988 
  • animanga/trunk/templates/www/comments

    r4302 r4310  
    11<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 ?> | &rdquo;<? page.attached ?>&rdquo;<? 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 ?> &rdquo;<? page.attached ?>&rdquo;<? end ?> 
    33 
    44<? if page.pageselect ?> 
     
    1010<table border="0" cellspacing="0" cellpadding="0"> 
    1111<tr><td> 
     12<? if params.overview ?> 
     13<br /> 
     14<? end ?> 
     15 
    1216<? page.comments ?> 
    1317</td></tr> 
     
    2428<br /> 
    2529 
    26 <? if !page.locked || user.senseicomments ?> 
    27 <div style="clear: both;"> 
     30<? if !params.overview && (!page.locked || user.senseicomments) ?> 
     31<div style="clear: both;"> 
    2832<? wrapper "include/header-green-large" ?>Snabbsvar på &rdquo;<? page.title ?>&rdquo;<? end ?> 
    2933