wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[livejournal] r17791: LJSUP-7441. need crop text in recent pos...

Committer: gprochaev
LJSUP-7441. need crop text in recent post

U   trunk/cgi-bin/LJ/Widget/Browse.pm
Modified: trunk/cgi-bin/LJ/Widget/Browse.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/Browse.pm	2010-11-26 04:20:00 UTC (rev 17790)
+++ trunk/cgi-bin/LJ/Widget/Browse.pm	2010-11-26 04:43:49 UTC (rev 17791)
@@ -237,6 +237,8 @@
             my $poster = $entry->poster;
             my $userpic = $entry->userpic;
             my @tags = $entry->tags;
+            my $event = $entry->event_html;
+            my ($is_removed_video) = $event =~ s/<iframe.*?>(.*)<\/iframe>/$1/;
             push @tmpl_posts, {
                 subject         => $entry->subject_text,
                 userpic         => $userpic ? $userpic->url : '',
@@ -246,10 +248,10 @@
                 mood            => $entry->prop('current_mood') || LJ::mood_name($entry->prop('current_moodid')) || '',
                 music           => $entry->prop('current_music'),
                 location        => $entry->prop('current_location'),
-                post_text       => $entry->event_html,
+                post_text       => LJ::html_trim ($event, 800),
                 url_to_post     => $entry->url,
                 comments_count  => $entry->reply_count,
-                is_need_more    => bytes::length($entry->event_text) > 800 ? 1 : 0,
+                is_need_more    => $is_removed_video || bytes::length($entry->event_text) > 800 ? 1 : 0,
             };
         }
     }

Tags: livejournal, pm, wisest-owl
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