Типа я (zilogic) wrote in changelog,
Типа я
zilogic
changelog

[livejournal] r21725: LJSUP-11810: Change the widget trava.ru

Committer: amyshkin
LJSUP-11810: Change the widget trava.ru
U   trunk/cgi-bin/weblib.pl
Modified: trunk/cgi-bin/weblib.pl
===================================================================
--- trunk/cgi-bin/weblib.pl	2012-04-16 15:19:28 UTC (rev 21724)
+++ trunk/cgi-bin/weblib.pl	2012-04-17 05:38:09 UTC (rev 21725)
@@ -1162,7 +1162,14 @@
 
     if ( $POST->{'prop_current_music'} ) {
         if ( length( $POST->{'prop_current_music'} ) > 197 ) {
-            $req->{'prop_current_music'} = substr( $POST->{'prop_current_music'}, 0, 197 ) . '...';
+            my $pos = index( $POST->{'prop_current_music'}, '|' );
+
+            if ( $pos == -1 ) {
+                $req->{'prop_current_music'} = substr( $POST->{'prop_current_music'}, 0, 197 ) . '...';
+            }
+            else {
+                $req->{'prop_current_music'} = substr( substr($POST->{'prop_current_music'}, 0, $pos), 0, 197 ) . '...' . substr( $POST->{'prop_current_music'}, $pos + 1 );
+            }
         }
         else {
             $req->{'prop_current_music'} = $POST->{'prop_current_music'};

Tags: amyshkin, livejournal, pl, zilogic
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