Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[ljcom] r9535: LJSUP-6876 (Put all tweets after 10th un...

Committer: ailyin
LJSUP-6876 (Put all tweets after 10th under lj-cut tag)
U   trunk/cgi-bin/LJ/TwitterDigest.pm
Modified: trunk/cgi-bin/LJ/TwitterDigest.pm
===================================================================
--- trunk/cgi-bin/LJ/TwitterDigest.pm	2010-09-22 09:54:16 UTC (rev 9534)
+++ trunk/cgi-bin/LJ/TwitterDigest.pm	2010-09-22 10:09:57 UTC (rev 9535)
@@ -260,6 +260,10 @@
         };
     }
 
+    my @tweets_under_cut = @tweets_display;
+    @tweets_display =
+        splice @tweets_under_cut, 0, $LJ::TWITTER_DIGEST_CUT_AFTER;
+
     my $template = LJ::HTML::Template->new(
         'scalarref' => \q{
             <ul>
@@ -269,11 +273,24 @@
                         <TMPL_VAR text>
                     </li>
                 </TMPL_LOOP>
+                <TMPL_IF tweets_under_cut>
+                    <lj-cut>
+                        <TMPL_LOOP tweets_under_cut>
+                            <li>
+                                <a href="<TMPL_VAR url>"><em><TMPL_VAR time></em></a>:
+                                <TMPL_VAR text>
+                            </li>
+                        </TMPL_LOOP>
+                    </lj-cut>
+                </TMPL_IF>
             </ul>
         },
     );
 
-    $template->param( 'tweets' => \@tweets_display );
+    $template->param(
+        'tweets'            => \@tweets_display,
+        'tweets_under_cut'  => \@tweets_under_cut,
+    );
 
     my $evt = $template->output;
     $evt =~ s/\s+/ /sg;

Tags: andy, ljcom, pm
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