htdocs/index.php
changeset 20 e2f6e3af9959
parent 15 5e2d1514ccd0
child 34 a8daa2016cf1
equal deleted inserted replaced
19:eb92dc5d9fb4 20:e2f6e3af9959
     1 <?php
     1 <?php
     2 require('../stats-fe.php');
     2 require('../stats-fe.php');
     3 require('../timezone.php');
     3 require('../timezone.php');
     4 require('../config.php');
       
     5 
     4 
     6 $channels = array_keys($stats_data['messages']);
     5 $channel_list = stats_channel_list();
     7 $first_channel = $channels[0];
     6 $first_channel = $channel_list[0];
     8 $channel = ( isset($_REQUEST['channel']) && isset($stats_data['messages'][$_REQUEST['channel']]) ) ? $_REQUEST['channel'] : $first_channel;
     7 $channel = ( isset($_REQUEST['channel']) && in_array($_REQUEST['channel'], $channel_list) ) ? $_REQUEST['channel'] : $first_channel;
     9 ?>
     8 ?>
    10 
     9 
    11 <html>
    10 <html>
    12   <head>
    11   <head>
    13     <title><?php echo $nick; ?> - Statistics</title>
    12     <title><?php echo $nick; ?> - Statistics</title>
    24     <div style="float: right;">
    23     <div style="float: right;">
    25       <p>
    24       <p>
    26         <?php
    25         <?php
    27         $tz_display = str_replace('_', ' ', str_replace('/', ': ', $tz));
    26         $tz_display = str_replace('_', ' ', str_replace('/', ': ', $tz));
    28         echo 'Time zone: ' . $tz_display . ' [<a href="changetz.php">change</a>]<br />';
    27         echo 'Time zone: ' . $tz_display . ' [<a href="changetz.php">change</a>]<br />';
    29         echo '<small>The time now is ' . date('H:i:s') . '.<br />Statistics last written to disk at ' . date('H:i:s', stats_last_updated()) . '.</small>';
    28         echo '<small>The time now is ' . date('H:i:s') . '.<br />Statistics now updated constantly (see <a href="news.php">news</a>)</small>';
    30         ?>
    29         ?>
    31       </p>
    30       </p>
    32       <p>
    31       <p>
    33         <big><b>Channels:</b></big><br />
    32         <big><b>Channels:</b></big><br />
    34         <?php
    33         <?php