lilalo

diff l3pre.php @ 147:94f587855947

mass upload
author igor@book.xt.vpn
date Tue Dec 16 00:17:33 2008 +0200 (2008-12-16)
parents e939c147dcdd
children 822b36252d7f
line diff
     1.1 --- a/l3pre.php	Tue Jul 22 00:16:20 2008 +0300
     1.2 +++ b/l3pre.php	Tue Dec 16 00:17:33 2008 +0200
     1.3 @@ -7,9 +7,21 @@
     1.4  }
     1.5  
     1.6  function renderLiLaLoPRE( $input ) {
     1.7 -    $input = preg_replace('/[^\n]*l3: local_session_id[^\n]*[\n]/', '', $input);
     1.8 -    $input = preg_replace('/((..:..:...)(#[^\n]*))/', '$2<b><a href="http://xgu.ru/">$3</a></b>', $input);
     1.9 -    return "<pre>$input</pre>";
    1.10 +    preg_match('/[^\n]*l3: local_session_id=([0-9-]*)[^\n]*[\n]/', $input, $matches);
    1.11 +    $session_id=$matches[1];
    1.12 +    preg_match('/([0-9]*)-([0-9]*)/', $session_id, $matches);
    1.13 +    $session_start_time = intval($matches[2]);
    1.14 +    $hour=intval(date('G', $session_start_time));
    1.15 +    $min=intval(date('i', $session_start_time));
    1.16 +    $sec=intval(date('s', $session_start_time));
    1.17 +    $input = preg_replace('/[^\n]*l3: local_session_id=([0-9-]*)[^\n]*[\n]/', '', $input);
    1.18 +    $input = preg_replace('/((..):(..):(...)(#[^\n]*))/e', 
    1.19 +                          '\'$2:$3:$4<b><a href="http://xgu.ru/l3?page='.$session_id.'&id='
    1.20 +                             .'\'.strval($session_start_time+3600*(intval("$2")-$hour)+60*(intval("$3")-$min)+1*(intval("$4")-$sec)).\''
    1.21 +                             .'">$5</a></b>\'', 
    1.22 +                          $input);
    1.23 +#                             .strval($session_start_time+3600*(intval($2)-$hour)+60*(intval($3)-$min)+(intval($4)-$sec))
    1.24 +    return "<pre>$hour:$min:$sec $input</pre>";
    1.25  }
    1.26  
    1.27  ?>