Первый фоллен на хелле (wildkin) wrote in changelog,
Первый фоллен на хелле
wildkin
changelog

[livejournal] r20637: LJSUP-10421: S1 Comments ?\226?\128?\148...

Committer: dnikolaev
LJSUP-10421: S1 Comments ?\226?\128?\148 v.2: New Threads

U   branches/commenting-form/cgi-bin/LJ/Talk.pm
Modified: branches/commenting-form/cgi-bin/LJ/Talk.pm
===================================================================
--- branches/commenting-form/cgi-bin/LJ/Talk.pm	2011-11-27 13:22:13 UTC (rev 20636)
+++ branches/commenting-form/cgi-bin/LJ/Talk.pm	2011-11-27 14:14:45 UTC (rev 20637)
@@ -1255,6 +1255,7 @@
 #                          datepost_unix => integer unix timestamp  1295268144,
 #                          datepost      => string 'YYYY-MM-DD hh:mm:ss',
 #                          state         => char ("A"=approved, "S"=screened, "D"=deleted stub, "B"=spam)
+#                          has_children  => boolean - true, if comment has children (need for 'flat' mode)
 #                          children      => arrayref of hashrefs like this,
 #                          _show         => boolean (if item is to be ideally shown, 0 - if deleted or screened),
 #                     }
@@ -1287,6 +1288,7 @@
     }
 
     my %children; # talkid -> [ childenids+ ]
+    my %has_children; # talkid -> 1 or undef
 
     my $uposterid = $opts->{'up'} ? $opts->{'up'}->{'userid'} : 0;
 
@@ -1296,6 +1298,9 @@
 
         foreach my $post (sort { $b->{'talkid'} <=> $a->{'talkid'} } values %$posts) {
 
+            $has_children{$post->{'parenttalkid'}} = 1;
+            $post->{'has_children'} = $has_children{$post->{'talkid'}};
+
             # kill the threading in flat mode
             if ($opts->{'flat'}) {
                 $post->{'parenttalkid_actual'} = $post->{'parenttalkid'};

Tags: dnikolaev, livejournal, pm, wildkin
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments